public class ApiPlatformClient extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ApiPlatformClient.RestClientStatus |
| Modifier and Type | Field and Description |
|---|---|
static String |
GATEWAY_API_BASE_RESOURCE |
static String |
PROXIES_API_BASE_RESOURCE |
| Constructor and Description |
|---|
ApiPlatformClient() |
| Modifier and Type | Method and Description |
|---|---|
PlatformResponse<Void> |
activateEndpoint(String organizationId,
String environmentId,
Long apiId)
Marks a specific API as active in API Manager, using endpoint .
|
void |
cleanConnections() |
void |
configure(com.mulesoft.mule.runtime.gw.api.config.GatewayConfiguration gatewayConfiguration) |
void |
connect()
Performs an initial connect where configured runtime credentials and general control plane configuration can be validated.
|
InputStream |
downloadTemplateAsset(String link)
Downloads a policy template asset from the specified link.
|
PlatformResponse<ApiResponse> |
getApi(com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey,
String apiEntityTag)
Retrieves the API details of a specific API, including applied policies, identity management, associated SLAs and metadata of
the API from API Manager, using endpoint .
|
PlatformResponse<ApiClientsResponse> |
getApiClients(String organizationId,
String environmentId,
Long apiId,
String contractsEntityTag)
Retrieves Contracts from CCS for a particular API, using endpoint .
|
PlatformResponse<LegacyCoreServicesClientDto> |
getClient(String id)
Retrieves a Client Application from Auth Service using the id as key, using endpoint
.
|
PlatformResponse<CoreServicesClientDto> |
getClient(String id,
String secret)
Validates a Client Application against Auth Service using its credentials.
|
PolicyTemplateDto |
getPolicyTemplateMetadata(com.mulesoft.mule.runtime.gw.api.policy.PolicyTemplateKey templateKey)
Retrieves download URLs of a specific policy template, using API Manager's endpoint
Authorization token injected is API Manager's. |
String |
getRootOrgId() |
boolean |
isConnected() |
int |
postHttpEvents(List<com.mulesoft.mule.runtime.gw.api.analytics.AnalyticsHttpEvent> events)
Pushes API Analytics events to Anypoint Platform, using endpoint .
|
int |
postMetrics(String eventsBody)
Pushes internal metrics, as a set of events, to Anypoint Platform.
|
void |
shutdown() |
public static final String GATEWAY_API_BASE_RESOURCE
public static final String PROXIES_API_BASE_RESOURCE
public void configure(com.mulesoft.mule.runtime.gw.api.config.GatewayConfiguration gatewayConfiguration) throws URISyntaxException
URISyntaxExceptionpublic void cleanConnections()
public PlatformResponse<ApiClientsResponse> getApiClients(String organizationId, String environmentId, Long apiId, String contractsEntityTag)
organizationId - organization where the API lives, can be a sub-orgenvironmentId - environment where the API livesapiId - API owning the contractscontractsEntityTag - contracts ETag that the service uses to detect if a NOT_MODIFIED response can be returnedPlatformResponse containing a ApiClientsResponse with the list of downloaded contracts if the
status code is 200 or an empty response if the status code was 304NotFoundException - if the response's status code is 404HttpResponseException - if the response's status is not 200 nor 304HttpConnectionException - if any connection issue arises while executing the requestEntityUnparsingException - if the response's body can not be parsedpublic PlatformResponse<Void> activateEndpoint(String organizationId, String environmentId, Long apiId)
organizationId - organization where the API lives, can be a sub-orgenvironmentId - environment where the API livesapiId - API to mark as activePlatformResponse without an entityNotFoundException - if the response's status code is 404HttpResponseException - if the response's status is not 201HttpConnectionException - if any connection issue arises while executing the requestpublic PlatformResponse<ApiResponse> getApi(com.mulesoft.mule.runtime.gw.api.key.ApiKey apiKey, String apiEntityTag)
ApiResponse but rather injected in each of the applied policies that
require it apiKey - API to which retrieve details fromapiEntityTag - API ETag that the service uses to detect if a NOT_MODIFIED response can be returnedPlatformResponse containing a ApiClientsResponse with the list of downloaded contracts if the
status code is 200 or an empty response if the status code was 304NotFoundException - if the response's status code is 404HttpResponseException - if the response's status code is not 200 nor 304HttpConnectionException - if any connection issue arises while executing the requestEntityUnparsingException - if the response's body can not be parsedpublic int postHttpEvents(List<com.mulesoft.mule.runtime.gw.api.analytics.AnalyticsHttpEvent> events) throws IOException
events - the list of events to pushNotFoundException - if the response's status code is 404HttpResponseException - if the response's status code is 4xx or 5xxIOException - if any connection issue arises while executing the requestEntityParsingException - if the events to push can not be parsedpublic int postMetrics(String eventsBody) throws IOException
eventsBody - the JSON containing every internal metrics event that the runtime gatheredNotFoundException - if the response's status code is 404HttpResponseException - if the response's status code is 4xx or 5xxIOException - if any connection issue arises while executing the requestpublic void connect()
me() when the other method does not contain it. NotFoundException - if the me() response's status code is 404HttpResponseException - if the me() response's status code is 4xx or 5xxHttpConnectionException - if any connection issue arises while executing the me() requestEntityUnparsingException - if the me() response's body can not be parsedRuntimeException - when root org id can not be retrieved from either sourcepublic PolicyTemplateDto getPolicyTemplateMetadata(com.mulesoft.mule.runtime.gw.api.policy.PolicyTemplateKey templateKey)
templateKey - the GAV of the policy templateNotFoundException - if the response's status code is 404HttpResponseException - if the response's status code is 4xx or 5xxHttpConnectionException - if any connection issue arises while executing the requestEntityUnparsingException - if the response's body can not be parsedpublic InputStream downloadTemplateAsset(String link) throws IOException
link - the link of the assetNotFoundException - if the response's status code is 404HttpResponseException - if the response's status code is 4xx or 5xxIOException - if any connection issue arises while executing the requestpublic PlatformResponse<LegacyCoreServicesClientDto> getClient(String id)
id - id of the Client App to retrievePlatformResponse containing a LegacyCoreServicesClientDto which has the data, including the
sensitive, of the Client App, like secret, name, etc.NotFoundException - if the response's status code is 404HttpResponseException - if the response's status code is 4xx or 5xxHttpConnectionException - if any connection issue arises while executing the requestEntityUnparsingException - if the response's body can not be parsedpublic PlatformResponse<CoreServicesClientDto> getClient(String id, String secret)
id - id of the Client App to retrievePlatformResponse containing a CoreServicesClientDto which has only the non-sensitive data of the
Client App.NotFoundException - if the response's status code is 404HttpResponseException - if the response's status code is 4xx or 5xxHttpConnectionException - if any connection issue arises while executing the requestEntityUnparsingException - if the response's body can not be parsedpublic String getRootOrgId()
public boolean isConnected()
public void shutdown()
Copyright © 2014–2024 MuleSoft, Inc.. All rights reserved.