public class RestAPIPublisherImpl extends Object
| Modifier and Type | Field and Description |
|---|---|
ApiDocumentsApi |
apiDocumentsApi |
ApiLifecycleApi |
apiLifecycleApi |
ApiClient |
apiPublisherClient |
ApIsApi |
apIsApi |
static String |
appName |
static String |
appOwner |
static String |
callBackURL |
ClientCertificatesApi |
clientCertificatesApi |
EndpointCertificatesApi |
endpointCertificatesApi |
static String |
grantType |
static String |
password |
RolesApi |
rolesApi |
SubscriptionsApi |
subscriptionsApi |
String |
tenantDomain |
ThrottlingPoliciesApi |
throttlingPoliciesApi |
static String |
tokenScope |
static String |
username |
ValidationApi |
validationApi |
| 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.
|
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 type,
String endpointUrl,
String providerName,
String apiName,
String apiVersion)
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) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
deleteDocument(String apiId,
String documentId)
delete Document
|
void |
deprecateAPI(String apiId)
This method is used to deprecate the created API.
|
APIListDTO |
getAllAPIs() |
APIListDTO |
getAllAPIs(String tenantDomain)
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) |
APIListDTO |
getAPIs(int offset,
int limit)
This method is used to upload endpoint certificates
Get APIs for the given limit and offset values
|
DocumentListDTO |
getDocuments(String apiId)
This method is used to get documents
Get Documents for the given limit and offset values
|
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 |
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
|
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 |
updateDocument(String apiId,
String docId,
DocumentDTO documentDTO)
Update API document.
|
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
|
OpenAPIDefinitionValidationResponseDTO |
validateOASDefinition(File oasDefinition) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
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 ApiLifecycleApi apiLifecycleApi
public RolesApi rolesApi
public ValidationApi validationApi
public SubscriptionsApi subscriptionsApi
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 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 type, String endpointUrl, String providerName, String apiName, String apiVersion) throws APIManagerIntegrationTestException
endpointUrl - url of the endpointtype - type of EndpointAPIManagerIntegrationTestException - - Check for valid endpoint fails.public 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 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 deleteDocument(String apiId, String documentId) throws ApiException
apiId - - API iddocumentId - - API idApiException - - Throws if API delete failspublic APIListDTO getAllAPIs(String tenantDomain) throws APIManagerIntegrationTestException, ApiException
APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doGet() method callApiExceptionpublic APIListDTO getAllAPIs() throws APIManagerIntegrationTestException, ApiException
public 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 org.wso2.carbon.automation.test.utils.http.client.HttpResponse 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 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 - alisendpoint - endpoint.ApiException - if an error occurred while uploading the certificate.public APIDTO updateAPI(APIDTO apidto) throws ApiException
apidto - ApiExceptionpublic SubscriptionListDTO getSubscriptionByAPIID(String apiID) throws ApiException
apiID - ApiExceptionCopyright © 2019 WSO2 Inc. All rights reserved.