public class SampleUtils extends Object
| Constructor and Description |
|---|
SampleUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
blockAPI(String apiId)
This method is used to block the created API.
|
static String |
createApi(String apiName,
String version,
String context,
ArrayList<String> visibleRoles,
ArrayList<String> visibleTenants,
API.SubscriptionAvailabilityEnum subscriptionAvailabilityEnum,
String hostname,
String port,
ArrayList<String> tags)
This method is used to create an API.
|
static String |
createApiForTenant(String apiName,
String version,
String context,
API.VisibilityEnum visibilityEnum,
ArrayList<String> visibleRoles,
ArrayList<String> visibleTenants,
API.SubscriptionAvailabilityEnum subscriptionAvailabilityEnum,
String hostname,
String port,
ArrayList<String> tags,
String tenantDomain,
String adminUsername,
String adminPassword)
This method is used to create an API for a tenant.
|
static String |
createApplication(String appName,
String description,
String throttleTier) |
static String |
createNewAPIVersion(String newVersion,
String apiId)
This method is used to create a new API of the existing API.
|
static String |
createSubscription(String apiId,
String applicationId,
String subscriptionTier,
Subscription.StatusEnum statusEnum) |
static void |
deprecateAPI(String apiId)
This method is used to deprecate the created API.
|
static ApplicationKey |
generateKeys(String applicationId,
String validityTime,
String callBackUrl,
ApplicationKeyGenerateRequest.KeyTypeEnum keyTypeEnum,
ArrayList<String> scopes,
ArrayList<String> allowDomains,
ArrayList<String> grantTypes) |
static void |
publishAPI(String apiId)
This method is used to publish the created API.
|
static void |
publishAPI(String apiId,
String tenantDomain,
String adminUsername,
String adminPassword)
This methos id used to publish the created API for tenants.
|
static void |
rejectAPI(String apiId)
This method is used to reject the created API.
|
public static String createApi(String apiName, String version, String context, ArrayList<String> visibleRoles, ArrayList<String> visibleTenants, API.SubscriptionAvailabilityEnum subscriptionAvailabilityEnum, String hostname, String port, ArrayList<String> tags) throws ApiException
apiName - API name.version - API version.context - API context.visibleRoles - visible roles of the API.visibleTenants - visible tenants of the API.subscriptionAvailabilityEnum - subscription visible tenants if the API.hostname - host name of the API Manager instance that needs to create the API.port - port of the API Manager instance that need to create the API.tags - tags that need to be added to the API.ApiException - throws of an error occurred when creating the API.public static String createApiForTenant(String apiName, String version, String context, API.VisibilityEnum visibilityEnum, ArrayList<String> visibleRoles, ArrayList<String> visibleTenants, API.SubscriptionAvailabilityEnum subscriptionAvailabilityEnum, String hostname, String port, ArrayList<String> tags, String tenantDomain, String adminUsername, String adminPassword) throws ApiException
apiName - API name.version - API version.context - API context.visibleRoles - visible roles of the API.visibleTenants - visible tenants of the API.subscriptionAvailabilityEnum - subscription visible tenants if the API.hostname - host name of the API Manager instance that needs to create the API.port - port of the API Manager instance that need to create the API.tags - tags that need to be added to the API.tenantDomain - tenant domain nameadminUsername - tenant admin usernameadminPassword - tenant admin passwordApiException - throws of an error occurred when creating the API.public static String createNewAPIVersion(String newVersion, String apiId) throws ApiException
newVersion - new API versionapiId - old API IDApiException - Throws if an error occurs when creating the new API version.public static void publishAPI(String apiId) throws ApiException
apiId - API id that need to published.ApiException - throws if an error occurred when publishing the API.public static void deprecateAPI(String apiId) throws ApiException
apiId - API id that need to published.ApiException - throws if an error occurred when publishing the API.public static void blockAPI(String apiId) throws ApiException
apiId - API id that need to published.ApiException - throws if an error occurred when publishing the API.public static void rejectAPI(String apiId) throws ApiException
apiId - API id that need to published.ApiException - throws if an error occurred when publishing the API.public static void publishAPI(String apiId, String tenantDomain, String adminUsername, String adminPassword) throws ApiException
apiId - API id that need to published.ApiException - throws if an error occurred when publishing the API.public static String createApplication(String appName, String description, String throttleTier)
public static String createSubscription(String apiId, String applicationId, String subscriptionTier, Subscription.StatusEnum statusEnum) throws ApiException
ApiExceptionpublic static ApplicationKey generateKeys(String applicationId, String validityTime, String callBackUrl, ApplicationKeyGenerateRequest.KeyTypeEnum keyTypeEnum, ArrayList<String> scopes, ArrayList<String> allowDomains, ArrayList<String> grantTypes) throws ApiException
ApiExceptionCopyright © 2018 WSO2 Inc. All rights reserved.