public class RestAPIPublisherImpl extends Object
| Constructor and Description |
|---|
RestAPIPublisherImpl()
Deprecated.
|
RestAPIPublisherImpl(String username,
String password,
String tenantDomain,
String publisherURL) |
| Modifier and Type | Method and Description |
|---|---|
APIDTO |
addAPI(APICreationRequestBean apiCreationRequestBean) |
APIDTO |
addAPI(APIDTO apidto,
String osVersion) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
addAPI(APIRequest apiRequest)
\
This method is used to create an API.
|
APIDTO |
addAPI(APIRequest apiRequest,
String osVersion)
\
This method is used to create an API.
|
APIProductDTO |
addApiProduct(APIProductDTO apiProductDTO) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
addContentDocument(String apiId,
String docId,
String docContent)
Adding a content to the document
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
addDocument(String apiId,
DocumentDTO body)
Adding a documentation
|
void |
blockAPI(String apiId)
This method is used to block the created API.
|
WorkflowResponseDTO |
changeAPILifeCycleStatus(String apiId,
String action) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
changeAPILifeCycleStatus(String apiId,
String action,
String lifecycleChecklist)
This method is used to publish the created API.
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
changeAPILifeCycleStatusToPublish(String apiId,
boolean isRequireReSubscription)
Change the API Lifecycle status to Publish with the option of Re-subscription is required or not
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
checkValidEndpoint(String endpointUrl,
String apiId)
Check whether the Endpoint is valid
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
copyAPI(String newVersion,
String apiId,
Boolean isDefault)
copy API from existing API
|
APIDTO |
copyAPIWithReturnDTO(String newVersion,
String apiId,
Boolean isDefault) |
String |
createNewAPIVersion(String newVersion,
String apiId,
boolean defaultVersion)
This method is used to create a new API of the existing API.
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
deleteAPI(String apiId)
delete API
|
void |
deleteAPIByID(String apiId) |
void |
deleteApiProduct(String apiProductId) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
deleteDocument(String apiId,
String documentId)
delete Document
|
void |
deployPrototypeAPI(String apiId)
This method is used to deploy the api as a prototype.
|
void |
deprecateAPI(String apiId)
This method is used to deprecate the created API.
|
APIProductListDTO |
getAllApiProducts() |
APIListDTO |
getAllAPIs()
Retrieve the All APIs available for the user in Publisher.
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getAPI(String apiId)
Method to get API information
|
APIDTO |
getAPIByID(String apiId,
String tenantDomain) |
APIProductDTO |
getApiProduct(String apiProductId) |
APIListDTO |
getAPIs(int offset,
int limit)
This method is used to upload endpoint certificates
Get APIs for the given limit and offset values
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getAuditApi(String apiId)
Method to retrieve the Audit Report of an API
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getDocumentContent(String apiId,
String documentId)
This method is used to get the content of API documents
|
DocumentListDTO |
getDocuments(String apiId)
This method is used to get documents
Get Documents for the given limit and offset values
|
GraphQLSchemaDTO |
getGraphqlSchemaDefinition(String apiId) |
LifecycleHistoryDTO |
getLifecycleHistory(String apiId) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getLifecycleStatus(String apiId) |
LifecycleStateDTO |
getLifecycleStatusDTO(String apiId) |
SubscriptionListDTO |
getSubscriptionByAPIID(String apiID)
Get subscription of an API
|
String |
getSwaggerByID(String apiId) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getTierPermissionsPage()
Retrieve the Tier Permission Page
|
ThrottlingPolicyListDTO |
getTiers(String policyLevel)
This method is used to get all throttling tiers.
|
APIDTO |
importGraphqlSchemaDefinition(File file,
String properties) |
APIDTO |
importOASDefinition(File file,
String properties) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
removeDocumentation(String apiId,
String docId)
Remove document
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
revokeAccessToken(String accessToken,
String consumerKey,
String authUser)
revoke access token
|
SearchResultListDTO |
searchAPIs(String query)
Retrieve the APIs according to the search query in Publisher.
|
APIDTO |
updateAPI(APIDTO apidto)
Update an API
|
APIDTO |
updateAPI(APIDTO apidto,
String apiId) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
updateAPI(APIRequest apiRequest,
String apiId)
Facilitate update API
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
updateContentDocument(String apiId,
String docId,
File docContent)
Updating the document content using file
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
updateDocument(String apiId,
String docId,
DocumentDTO documentDTO)
Update API document.
|
void |
updateGraphqlSchemaDefinition(String apiId,
String schemaDefinition) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
updatePermissions(String tierName,
String permissionType,
String roles)
update permissions to API access
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
updateResourceOfAPI(String apiId,
String api)
Update resources of API
|
String |
updateSwagger(String apiId,
String definition) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
uploadCertificate(File certificate,
String alias,
String apiId,
String tier)
This method is used to upload certificates
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
uploadEndpointCertificate(File certificate,
String alias,
String endpoint)
This method is used to upload certificates
|
GraphQLValidationResponseDTO |
validateGraphqlSchemaDefinition(File schemaDefinition) |
OpenAPIDefinitionValidationResponseDTO |
validateOASDefinition(File oasDefinition) |
ApiResponse<Void> |
validateRoles(String roleId)
This method is used to validate roles.
|
public ApIsApi apIsApi
public ApiDocumentsApi apiDocumentsApi
public ThrottlingPoliciesApi throttlingPoliciesApi
public ClientCertificatesApi clientCertificatesApi
public EndpointCertificatesApi endpointCertificatesApi
public GraphQlSchemaApi graphQlSchemaApi
public GraphQlSchemaIndividualApi graphQlSchemaIndividualApi
public ApiLifecycleApi apiLifecycleApi
public RolesApi rolesApi
public ValidationApi validationApi
public SubscriptionsApi subscriptionsApi
public ApiAuditApi apiAuditApi
public UnifiedSearchApi unifiedSearchApi
public ApiClient apiPublisherClient
public static final String appName
public static final String callBackURL
public static final String tokenScope
public static final String appOwner
public static final String grantType
public static final String username
public static final String password
public String tenantDomain
@Deprecated public RestAPIPublisherImpl()
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addAPI(APIRequest apiRequest) throws ApiException
apiRequest - ApiException - throws of an error occurred when creating the API.public APIDTO addAPI(APIRequest apiRequest, String osVersion) throws ApiException
apiRequest - ApiException - throws of an error occurred when creating the API.public APIDTO addAPI(APIDTO apidto, String osVersion) throws ApiException
ApiExceptionpublic String createNewAPIVersion(String newVersion, String apiId, boolean defaultVersion) throws ApiException
newVersion - new API versionapiId - old API IDdefaultVersion - is this theApiException - Throws if an error occurs when creating the new API version.public org.wso2.carbon.automation.test.utils.http.client.HttpResponse changeAPILifeCycleStatus(String apiId, String action, String lifecycleChecklist) throws ApiException
action - API id that need to published.apiId - API id that need to published.
return ApiResponseApiException - throws if an error occurred when publishing the API.public WorkflowResponseDTO changeAPILifeCycleStatus(String apiId, String action) throws ApiException
ApiExceptionpublic void deprecateAPI(String apiId) throws ApiException
apiId - API id that need to published.ApiException - throws if an error occurred when publishing the API.public void deployPrototypeAPI(String apiId) throws ApiException
apiId - API id that need to be prototyped.ApiException - throws if an error occurred when publishing the API.public void blockAPI(String apiId) throws ApiException
apiId - API id that need to published.ApiException - throws if an error occurred when publishing the API.public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getLifecycleStatus(String apiId) throws ApiException
ApiExceptionpublic LifecycleStateDTO getLifecycleStatusDTO(String apiId) throws ApiException
ApiExceptionpublic LifecycleHistoryDTO getLifecycleHistory(String apiId) throws ApiException
ApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse copyAPI(String newVersion, String apiId, Boolean isDefault) throws ApiException
newVersion - - new version of the APIapiId - - existing API IdisDefault - - make the default versionAPIManagerIntegrationTestException - - Throws if error occurred at API copy operationApiExceptionpublic APIDTO copyAPIWithReturnDTO(String newVersion, String apiId, Boolean isDefault) throws ApiException
newVersion - apiId - isDefault - ApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateAPI(APIRequest apiRequest, String apiId) throws ApiException
apiRequest - - constructed API request objectAPIManagerIntegrationTestException - - throws if update API failsApiExceptionpublic APIDTO updateAPI(APIDTO apidto, String apiId) throws ApiException
ApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPI(String apiId) throws ApiException
apiId - - API idApiException - - Throws if api information cannot be retrieved.public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteAPI(String apiId) throws ApiException
apiId - - API idApiException - - Throws if API delete failspublic void deleteAPIByID(String apiId) throws ApiException
apiId - ApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse removeDocumentation(String apiId, String docId) throws ApiException
apiId - - API iddocId - - document idApiException - - Throws if remove API document failspublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse revokeAccessToken(String accessToken, String consumerKey, String authUser) throws APIManagerIntegrationTestException
accessToken - - access token already receivedconsumerKey - - consumer key returnedauthUser - - user nameAPIManagerIntegrationTestException - - throws if access token revoke failspublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse updatePermissions(String tierName, String permissionType, String roles) throws APIManagerIntegrationTestException
tierName - - name of api throttling tierpermissionType - - permission typeroles - - roles of permissionAPIManagerIntegrationTestException - - throws if permission update failspublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateResourceOfAPI(String apiId, String api) throws APIManagerIntegrationTestException
apiId - - API IdAPIManagerIntegrationTestException - - throws if API resource update failspublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse checkValidEndpoint(String endpointUrl, String apiId) throws APIManagerIntegrationTestException, ApiException
endpointUrl - url of the endpointapiId - id of the api which the endpoint to be validatedAPIManagerIntegrationTestException - - Check for valid endpoint fails.ApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse changeAPILifeCycleStatusToPublish(String apiId, boolean isRequireReSubscription) throws ApiException
apiId - - API IDisRequireReSubscription - - true if Re-subscription is required else false.APIManagerIntegrationTestException - - Exception Throws in checkAuthentication() and when do the REST
service calls to do the lifecycle change.ApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse getTierPermissionsPage()
throws APIManagerIntegrationTestException
APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doGet() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse addDocument(String apiId, DocumentDTO body) throws ApiException
apiId - - Id of the API.body - - document Body.ApiException - - Exception throws if error occurred when adding document.public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addContentDocument(String apiId, String docId, String docContent) throws ApiException
apiId - - Id of the API.docId - - document Id.docContent - - document contentApiException - - Exception throws if error occurred when adding document.public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateContentDocument(String apiId, String docId, File docContent) throws ApiException
apiId - - Id of the API.docId - - document Id.docContent - - file contentApiException - - Exception throws if error occurred when adding document.public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateDocument(String apiId, String docId, DocumentDTO documentDTO) throws ApiException
apiId - api IddocId - document IddocumentDTO - documentation object.ApiException - Exception throws if error occurred when updating document.public DocumentListDTO getDocuments(String apiId) throws ApiException
apiId - apiIdApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse getDocumentContent(String apiId, String documentId) throws ApiException
apiId - UUID of the APIdocumentId - UUID of the API documentApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteDocument(String apiId, String documentId) throws ApiException
apiId - - API iddocumentId - - API idApiException - - Throws if API delete failspublic APIListDTO getAllAPIs() throws APIManagerIntegrationTestException, ApiException
APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doGet() method callApiExceptionpublic SearchResultListDTO searchAPIs(String query) throws ApiException
query - - The query on which the APIs needs to be filteredApiExceptionpublic APIListDTO getAPIs(int offset, int limit) throws ApiException
offset - starting positionlimit - maximum number of APIs to returnApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse uploadEndpointCertificate(File certificate, String alias, String endpoint) throws ApiException
certificate - certificatealias - alisendpoint - endpoint.ApiException - if an error occurred while uploading the certificate.public ThrottlingPolicyListDTO getTiers(String policyLevel) throws ApiException
- - API or resourceApiExceptionpublic ApiResponse<Void> validateRoles(String roleId) throws ApiException
roleId - role IdAPIManagerIntegrationTestExceptionApiExceptionpublic String getSwaggerByID(String apiId) throws ApiException
ApiExceptionpublic String updateSwagger(String apiId, String definition) throws ApiException
ApiExceptionpublic OpenAPIDefinitionValidationResponseDTO validateOASDefinition(File oasDefinition) throws ApiException
ApiExceptionpublic APIDTO getAPIByID(String apiId, String tenantDomain) throws ApiException
ApiExceptionpublic APIDTO importOASDefinition(File file, String properties) throws ApiException
ApiExceptionpublic GraphQLValidationResponseDTO validateGraphqlSchemaDefinition(File schemaDefinition) throws ApiException
ApiExceptionpublic APIDTO importGraphqlSchemaDefinition(File file, String properties) throws ApiException
ApiExceptionpublic GraphQLSchemaDTO getGraphqlSchemaDefinition(String apiId) throws ApiException
ApiExceptionpublic void updateGraphqlSchemaDefinition(String apiId, String schemaDefinition) throws ApiException
ApiExceptionpublic APIDTO addAPI(APICreationRequestBean apiCreationRequestBean) throws ApiException
ApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse uploadCertificate(File certificate, String alias, String apiId, String tier) throws ApiException
certificate - certificatealias - alisApiException - if an error occurred while uploading the certificate.public APIDTO updateAPI(APIDTO apidto) throws ApiException
apidto - ApiExceptionpublic SubscriptionListDTO getSubscriptionByAPIID(String apiID) throws ApiException
apiID - ApiExceptionpublic APIProductListDTO getAllApiProducts() throws ApiException
ApiExceptionpublic APIProductDTO getApiProduct(String apiProductId) throws ApiException
ApiExceptionpublic APIProductDTO addApiProduct(APIProductDTO apiProductDTO) throws ApiException
ApiExceptionpublic void deleteApiProduct(String apiProductId) throws ApiException
ApiExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAuditApi(String apiId) throws ApiException
apiId - apiId of the APIApiExceptionCopyright © 2020 WSO2 Inc. All rights reserved.