public class APIPublisherRestClient extends Object
| Constructor and Description |
|---|
APIPublisherRestClient(String backendURL)
construct of API rest client
|
| Modifier and Type | Method and Description |
|---|---|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
addAPI(APICreationRequestBean creationRequestBean)
Add a API using APICreationRequestBean object
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
addAPI(APIRequest apiRequest)
Facilitate add API into publisher node
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
addDocument(AddDocumentRequestBean addDocRequestBean)
Adding a Document to a API using AddDocumentRequestBean
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
addDocument(String apiName,
String version,
String provider,
String docName,
String docType,
String sourceType,
String docUrl,
String summary,
String docLocation)
Adding a Document to a API
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
addDocument(String apiName,
String version,
String provider,
String docName,
String docType,
String sourceType,
String docUrl,
String summary,
String docLocation,
String mimeType,
String newType)
Adding a Document to a API
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
changeAPILifeCycleStatus(APILifeCycleStateRequest updateRequest)
change status of a created API
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
changeAPILifeCycleStatusToPublish(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier,
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 |
checkValidAPIName(String apiName)
Validate API Name when creating a new API
|
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 provider,
String apiName,
String oldVersion,
String newVersion,
String isDefaultVersion)
copy API from existing API
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
deleteAPI(String apiName,
String version,
String provider)
delete API
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
designAPI(APIDesignBean designBean)
Design an API using APIDesignBean object
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getAllAPIs()
Retrieve the All APIs available for the user in Publisher.
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getAPI(String apiName,
String provider)
Method to get API information
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getApi(String apiName,
String provider,
String version)
Get the API information for the given API Name,API Version and API Provider
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getAPI(String apiName,
String provider,
String version)
Get the API information for the given API Name, API Version and API Provider
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getAPIImplementPage(String apiName,
String provider,
String version)
Retrieve implementation page for the requested API
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getAPIInformationPage(String apiName,
String provider,
String version)
Retrieve the API Information Page
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getAPIManagePage(String apiName,
String provider,
String version)
Retrieve the API Manage Page
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getTierPermissionsPage()
Retrieve the Tier Permission Page
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
getTiers() |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
implement(APIImplementationBean implementationBean) |
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
login(String userName,
String password)
login to publisher app
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
logout()
log out from publisher
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
removeDocumentation(String apiName,
String version,
String provider,
String docName,
String docType)
Remove document
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
revokeAccessToken(String accessToken,
String consumerKey,
String authUser)
revoke access token
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
updateAPI(APICreationRequestBean creationRequestBean)
Update a API using APICreationRequestBean object
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
updateAPI(APIRequest apiRequest)
Facilitate update API
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
updateDocument(String apiName,
String version,
String provider,
String docName,
String content) |
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 provider,
String apiName,
String version,
String swaggerRes)
Update resources of API
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
uploadCertificate(ClientCertificateCreationBean clientCertificateCreationBean)
To upload a client certificate against an API.
|
org.wso2.carbon.automation.test.utils.http.client.HttpResponse |
validateRoles(String role) |
public APIPublisherRestClient(String backendURL)
backendURL - - backend URL of the publisher Jaggery apppublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse login(String userName, String password) throws APIManagerIntegrationTestException
userName - - provided user namepassword - - passwordAPIManagerIntegrationTestException - - Throws if user cannot login to the publisherpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse logout()
throws APIManagerIntegrationTestException
APIManagerIntegrationTestException - - Throws if logout failspublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse addAPI(APIRequest apiRequest) throws APIManagerIntegrationTestException
apiRequest - - Constructed API request objectAPIManagerIntegrationTestException - - Throws if API addition failspublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse copyAPI(String provider, String apiName, String oldVersion, String newVersion, String isDefaultVersion) throws APIManagerIntegrationTestException
provider - - name of the provider , ex: adminapiName - - API nameoldVersion - - existing versionnewVersion - - new versionisDefaultVersion - - check default versionAPIManagerIntegrationTestException - - Throws if error occurred at API copy operationpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateAPI(APIRequest apiRequest) throws Exception
apiRequest - - constructed API request objectAPIManagerIntegrationTestException - - throws if update API failsExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse changeAPILifeCycleStatus(APILifeCycleStateRequest updateRequest) throws APIManagerIntegrationTestException
updateRequest - - APILifeCycleStateRequest objectAPIManagerIntegrationTestException - - throws if change lifecycle state failspublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPI(String apiName, String provider) throws APIManagerIntegrationTestException
apiName - - API nameprovider - - name of the providerAPIManagerIntegrationTestException - - Throws if api information cannot be retrieved.public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteAPI(String apiName, String version, String provider) throws APIManagerIntegrationTestException
apiName - - API nameversion - - API versionprovider - - name of the providerAPIManagerIntegrationTestException - - Throws if API delete failspublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse removeDocumentation(String apiName, String version, String provider, String docName, String docType) throws APIManagerIntegrationTestException
apiName - - API nameversion - - API versionprovider - - name of the providerdocName - - document namedocType - - document typeAPIManagerIntegrationTestException - - 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 provider, String apiName, String version, String swaggerRes) throws APIManagerIntegrationTestException
provider - - provider name of creatorapiName - - name of apiversion - - api versionswaggerRes - - swagger docAPIManagerIntegrationTestException - - throws if API resource update failspublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPI(String apiName, String provider, String version) throws APIManagerIntegrationTestException
apiName - Name of the APIprovider - Provider Name of the APIversion - Version of the APIAPIManagerIntegrationTestException - - Unable to get API informationpublic 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(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier,
boolean isRequireReSubscription)
throws APIManagerIntegrationTestException
apiIdentifier - - Instance of APIIdentifierisRequireReSubscription - - 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.public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getApi(String apiName, String provider, String version) throws APIManagerIntegrationTestException
apiName - - Name of the APIprovider - - Provider Name of the APIversion - - Version of the APIAPIManagerIntegrationTestException - - Exception Throws in checkAuthentication() and when do the REST
service calls to get the API information.public 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 getAPIManagePage(String apiName, String provider, String version) throws APIManagerIntegrationTestException
apiName - - Name of the API.provider - - Name of the API Provider.version - - Version of the API.APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doGet() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPIInformationPage(String apiName, String provider, String version) throws APIManagerIntegrationTestException
apiName - - Name of the API.provider - - Name of the API Provider.version - - Version of the API.APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doGet() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse addDocument(String apiName, String version, String provider, String docName, String docType, String sourceType, String docUrl, String summary, String docLocation, String mimeType, String newType) throws APIManagerIntegrationTestException
apiName - - Name of the API.version - - Version of the API.provider - - Name of the API Provider.docName - - Name of the DocumentdocType - - Document TypesourceType - - Source TypedocUrl - - Document URLsummary - - Document summarydocLocation - - Document LocationAPIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doPost() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse addDocument(String apiName, String version, String provider, String docName, String docType, String sourceType, String docUrl, String summary, String docLocation) throws APIManagerIntegrationTestException
apiName - - Name of the API.version - - Version of the API.provider - - Name of the API Provider.docName - - Name of the DocumentdocType - - Document TypesourceType - - Source TypedocUrl - - Document URLsummary - - Document summarydocLocation - - Document LocationAPIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doPost() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse addDocument(AddDocumentRequestBean addDocRequestBean) throws APIManagerIntegrationTestException
addDocRequestBean - - Bean that contains all the values that needed to create a Document.APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doPost() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateDocument(String apiName, String version, String provider, String docName, String content) throws APIManagerIntegrationTestException
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAllAPIs()
throws APIManagerIntegrationTestException
APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doGet() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse addAPI(APICreationRequestBean creationRequestBean) throws APIManagerIntegrationTestException
creationRequestBean - - Instance of APICreationRequestBean object with all needed information to create the API.APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doPost() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse uploadCertificate(ClientCertificateCreationBean clientCertificateCreationBean) throws APIManagerIntegrationTestException
clientCertificateCreationBean - Client Certificate Creation Bean with required information for uploading
client certificate.APIManagerIntegrationTestException - API Manager Integration Test Exception.public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateAPI(APICreationRequestBean creationRequestBean) throws APIManagerIntegrationTestException
creationRequestBean - - Instance of APICreationRequestBean object with all needed information to Update the API.APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doPost() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse designAPI(APIDesignBean designBean) throws APIManagerIntegrationTestException
designBean - -Instance of APIDesignBean object with all needed information to create an API up to design level.APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doPost() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse implement(APIImplementationBean implementationBean) throws APIManagerIntegrationTestException
public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPIImplementPage(String apiName, String provider, String version) throws APIManagerIntegrationTestException
apiName - - Name of the APIprovider - - Provider of the APIversion - -Version of the APIAPIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and
HTTPSClientUtils.doGet() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse checkValidAPIName(String apiName) throws APIManagerIntegrationTestException
apiName - - Name of the APIAPIManagerIntegrationTestException - - Exception throws from checkAuthentication()
method and HTTPSClientUtils.doPost() method callpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse getTiers()
throws APIManagerIntegrationTestException
APIManagerIntegrationTestExceptionpublic org.wso2.carbon.automation.test.utils.http.client.HttpResponse validateRoles(String role) throws APIManagerIntegrationTestException
role - roleAPIManagerIntegrationTestExceptionCopyright © 2020 WSO2 Inc. All rights reserved.