Class RestAPIAdminImpl


  • public class RestAPIAdminImpl
    extends Object
    This util class performs the actions related to APIDTOobjects.
    • Constructor Detail

      • RestAPIAdminImpl

        public RestAPIAdminImpl​(String username,
                                String password,
                                String tenantDomain,
                                String adminURl)
    • Method Detail

      • getThrottlePolicies

        public ThrottlePolicyDetailsListDTO getThrottlePolicies​(String query)
                                                         throws ApiException
        This method is used to get a list throttling policy details
        Parameters:
        query - Filters by throttling policy type
        Returns:
        Throttling Policy details list
        Throws:
        ApiException - Throws if an error occurred while getting throttling policy details
      • exportThrottlePolicy

        public ApiResponse<ExportThrottlePolicyDTO> exportThrottlePolicy​(String policyName,
                                                                         String policyType)
                                                                  throws ApiException
        This method is used to export a Throttling Policy
        Parameters:
        policyName - Throttling Policy name to be exported
        policyType - Throttling Policy type
        Returns:
        ExportThrottlePolicyApi response returned by the API call
        Throws:
        ApiException - Throws if an error occurred while exporting Throttling policy
      • importThrottlePolicy

        public ApiResponse<Void> importThrottlePolicy​(File file,
                                                      Boolean overwrite)
                                               throws ApiException
        This method is used to import a Throttling Policy
        Parameters:
        file - Exported throttling policy file
        overwrite - overwrites already existing throttling policy
        Returns:
        ImportThrottlePolicyApi response returned by the API call
        Throws:
        ApiException - Throws if an error occurred while importing Throttling policy
      • addApiCategory

        public ApiResponse<APICategoryDTO> addApiCategory​(APICategoryDTO apiCategoryDTO)
                                                   throws ApiException
        This method is used to add an API category.
        Parameters:
        apiCategoryDTO - API category DTO to be added
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while adding the new API category.
      • updateApiCategory

        public ApiResponse<APICategoryDTO> updateApiCategory​(String uuid,
                                                             APICategoryDTO apiCategoryDTO)
                                                      throws ApiException
        This method is used to update an API category
        Parameters:
        uuid - UUID of the API category to be updated
        apiCategoryDTO - API category DTO to be updated
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while updating the new API category.
      • getApiCategories

        public ApiResponse<APICategoryListDTO> getApiCategories()
                                                         throws ApiException
        This method is used to retrieve all API categories.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while retrieving all API categories.
      • deleteApiCategory

        public ApiResponse<Void> deleteApiCategory​(String uuid)
                                            throws ApiException
        This method is used to delete an API category.
        Parameters:
        uuid - uuid of the API category to be deleted.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while deleting the API category.
      • putRoleAliases

        public ApiResponse<RoleAliasListDTO> putRoleAliases​(RoleAliasListDTO roleAliasListDTO)
                                                     throws ApiException
        This method is used to put an system scopes mapping.
        Parameters:
        roleAliasListDTO - Role Alias DTO to be updated
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while adding the new API category.
      • getRoleAliases

        public ApiResponse<RoleAliasListDTO> getRoleAliases()
                                                     throws ApiException
        This method is used to get role aliases.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while adding the new API category.
      • addApplicationThrottlingPolicy

        public ApiResponse<ApplicationThrottlePolicyDTO> addApplicationThrottlingPolicy​(ApplicationThrottlePolicyDTO applicationThrottlePolicyDTO)
                                                                                 throws ApiException
        This method is used to create an application throttling policy.
        Parameters:
        applicationThrottlePolicyDTO - Application throttling policy DTO to be added.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - if an error occurs while creating the application throttling policy.
      • getApplicationThrottlingPolicy

        public ApiResponse<ApplicationThrottlePolicyDTO> getApplicationThrottlingPolicy​(String policyId)
                                                                                 throws ApiException
        This method is used to retrieve an application throttling policy.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - if an error occurs while retrieving the application throttling policy.
      • updateApplicationThrottlingPolicy

        public ApiResponse<ApplicationThrottlePolicyDTO> updateApplicationThrottlingPolicy​(String policyId,
                                                                                           ApplicationThrottlePolicyDTO applicationThrottlePolicyDTO)
                                                                                    throws ApiException
        This method is used to update an application throttling policy.
        Parameters:
        policyId - Policy Id of the application throttling policy to be updated.
        applicationThrottlePolicyDTO - Application throttling policy DTO which contains the update content.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - if an error occurs while updating the application throttling policy.
      • deleteApplicationThrottlingPolicy

        public ApiResponse<Void> deleteApplicationThrottlingPolicy​(String policyId)
                                                            throws ApiException
        This method is used to delete an application throttling policy.
        Parameters:
        policyId - Policy Id of the application throttling policy to be deleted.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - if an error occurs while deleting the application throttling policy.
      • addSubscriptionThrottlingPolicy

        public ApiResponse<SubscriptionThrottlePolicyDTO> addSubscriptionThrottlingPolicy​(SubscriptionThrottlePolicyDTO subscriptionThrottlePolicyDTO)
                                                                                   throws ApiException
        This method is used to create a subscription throttling policy.
        Parameters:
        subscriptionThrottlePolicyDTO - Subscription throttling policy DTO to be added.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while creating the new subscription throttling policy.
      • getSubscriptionThrottlingPolicy

        public ApiResponse<SubscriptionThrottlePolicyDTO> getSubscriptionThrottlingPolicy​(String policyId)
                                                                                   throws ApiException
        This method is used to retrieve a subscription throttling policy.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while retrieving the subscription throttling policy.
      • updateSubscriptionThrottlingPolicy

        public ApiResponse<SubscriptionThrottlePolicyDTO> updateSubscriptionThrottlingPolicy​(String policyId,
                                                                                             SubscriptionThrottlePolicyDTO subscriptionThrottlePolicyDTO)
                                                                                      throws ApiException
        This method is used to update a subscription throttling policy.
        Parameters:
        policyId - Policy Id of the subscription throttling policy to be updated.
        subscriptionThrottlePolicyDTO - Subscription throttling policy DTO which contains the updated content.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while updating the subscription throttling policy.
      • deleteSubscriptionThrottlingPolicy

        public ApiResponse<Void> deleteSubscriptionThrottlingPolicy​(String policyId)
                                                             throws ApiException
        This method is used to delete a subscription throttling policy.
        Parameters:
        policyId - Subscription throttling policy Id.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while deleting the subscription throttling policy.
      • addCustomThrottlingPolicy

        public ApiResponse<CustomRuleDTO> addCustomThrottlingPolicy​(CustomRuleDTO customRuleDTO)
                                                             throws ApiException
        This method is used to create an custom throttling policy.
        Parameters:
        customRuleDTO - Custom throttling policy DTO to be added.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while creating the custom throttling policy.
      • getCustomThrottlingPolicy

        public ApiResponse<CustomRuleDTO> getCustomThrottlingPolicy​(String policyId)
                                                             throws ApiException
        This method is used to retrieve a custom throttling policy.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while retrieving the custom throttling policy.
      • updateCustomThrottlingPolicy

        public ApiResponse<CustomRuleDTO> updateCustomThrottlingPolicy​(String policyId,
                                                                       CustomRuleDTO customRuleDTO)
                                                                throws ApiException
        This method is used to update a custom throttling policy.
        Parameters:
        policyId - Policy Id of the custom throttling policy to be updated.
        customRuleDTO - Custom throttling policy DTO which contains the updated content.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while updating the custom throttling policy.
      • deleteCustomThrottlingPolicy

        public ApiResponse<Void> deleteCustomThrottlingPolicy​(String policyId)
                                                       throws ApiException
        This method is used to delete a custom throttling policy.
        Parameters:
        policyId - Policy Id of the custom throttling policy to be deleted.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while deleting the custom throttling policy.
      • addDenyThrottlingPolicy

        public ApiResponse<BlockingConditionDTO> addDenyThrottlingPolicy​(BlockingConditionDTO denyPolicyDTO)
                                                                  throws ApiException
        Creates an deny throttling policy.
        Parameters:
        denyPolicyDTO - deny throttling policy DTO to be added.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while creating the deny throttling policy.
      • updateDenyThrottlingPolicy

        public ApiResponse<BlockingConditionDTO> updateDenyThrottlingPolicy​(String conditionId,
                                                                            String conditionType,
                                                                            BlockingConditionStatusDTO blockingConditionStatusDTO)
                                                                     throws ApiException
        Updates an deny throttling policy.
        Parameters:
        conditionId - policy id of the deny throttling policy to be updated.
        conditionType - condition type of the deny throttling policy to be.
        blockingConditionStatusDTO - deny throttling policy status DTO to be updated.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while creating the deny throttling policy.
      • deleteDenyThrottlingPolicy

        public ApiResponse<Void> deleteDenyThrottlingPolicy​(String policyId)
                                                     throws ApiException
        Deletes a deny throttling policy.
        Parameters:
        policyId - policy id of the deny throttling policy to be deleted.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while deleting the deny throttling policy.
      • addAdvancedThrottlingPolicy

        public ApiResponse<AdvancedThrottlePolicyDTO> addAdvancedThrottlingPolicy​(AdvancedThrottlePolicyDTO advancedThrottlePolicyDTO)
                                                                           throws ApiException
        This method is used to create an advanced throttling policy.
        Parameters:
        advancedThrottlePolicyDTO - Advanced throttling policy DTO to be added.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while creating the new advanced policy.
      • getAdvancedThrottlingPolicy

        public ApiResponse<AdvancedThrottlePolicyDTO> getAdvancedThrottlingPolicy​(String policyId)
                                                                           throws ApiException
        This method is used to retrieve an advanced throttling policy.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while retrieving the advanced throttling policy.
      • updateAdvancedThrottlingPolicy

        public ApiResponse<AdvancedThrottlePolicyDTO> updateAdvancedThrottlingPolicy​(String policyId,
                                                                                     AdvancedThrottlePolicyDTO advancedThrottlePolicyDTO)
                                                                              throws ApiException
        This method is used to update an advanced throttling policy.
        Parameters:
        policyId - Policy Id of the advanced throttling policy to be updated.
        advancedThrottlePolicyDTO - Advanced throttling policy DTO which contains the updated content.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while updating the advanced throttling policy.
      • deleteAdvancedThrottlingPolicy

        public ApiResponse<Void> deleteAdvancedThrottlingPolicy​(String policyId)
                                                         throws ApiException
        This method is used to delete an advanced throttling policy.
        Parameters:
        policyId - Policy Id of the advanced throttling policy to be deleted.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while deleting the advanced throttling policy.
      • addLabel

        public ApiResponse<LabelDTO> addLabel​(LabelDTO labelDTO)
                                       throws ApiException
        This method is used to add a label.
        Parameters:
        labelDTO - Label DTO to be added.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while adding the new label.
      • getLabels

        public ApiResponse<LabelListDTO> getLabels()
                                            throws ApiException
        This method is used to retrieve all labels.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while retrieving all labels.
      • updateLabel

        public ApiResponse<LabelDTO> updateLabel​(String labelId,
                                                 LabelDTO labelDTO)
                                          throws ApiException
        This method is used to update a label.
        Parameters:
        labelId - Label Id of the label to be updated.
        labelDTO - Label DTO which contains the updated content.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while updating the label.
      • deleteLabel

        public ApiResponse<Void> deleteLabel​(String labelId)
                                      throws ApiException
        This method is used to delete a label.
        Parameters:
        labelId - Label Id of the label to be updated.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while deleting the label.
      • addEnvironment

        public ApiResponse<EnvironmentDTO> addEnvironment​(EnvironmentDTO environmentDTO)
                                                   throws ApiException
        This method is used to add an environment.
        Parameters:
        environmentDTO - Environment DTO to be added.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while adding the new environment.
      • getEnvironments

        public ApiResponse<EnvironmentListDTO> getEnvironments()
                                                        throws ApiException
        This method is used to retrieve all environments.
        Returns:
        API response returned by the API call.
        Throws:
        ApiException - Throws if an error occurred while retrieving all environments of tenant.
      • updateEnvironment

        public ApiResponse<EnvironmentDTO> updateEnvironment​(String environmentId,
                                                             EnvironmentDTO environmentDTO)
                                                      throws ApiException
        This method is used to update an environment.
        Parameters:
        environmentId - Environment Id of the label to be updated.
        environmentDTO - Environment DTO which contains the updated content.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while updating the environment.
      • deleteEnvironment

        public ApiResponse<Void> deleteEnvironment​(String environmentId)
                                            throws ApiException
        This method is used to delete an environment.
        Parameters:
        environmentId - Environment Id of the label to be deleted.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while deleting the environment.
      • getApplications

        public ApiResponse<ApplicationListDTO> getApplications​(String user,
                                                               Integer limit,
                                                               Integer offset,
                                                               String appTenantDomain)
                                                        throws ApiException
        This method is used to retrieve applications.
        Parameters:
        user - Username of the application creator.
        limit - Maximum number of applications to return.
        offset - Starting point within the complete list of applications qualified.
        appTenantDomain - Tenant domain of the applications to get.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while retrieving applications.
      • changeApplicationOwner

        public ApiResponse<Void> changeApplicationOwner​(String newOwner,
                                                        String applicationId)
                                                 throws ApiException
        This method is used to change the owner of an application.
        Parameters:
        newOwner - New owner of the application.
        applicationId - Application ID of the application.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while changing the owner of an application.
      • getTenantConfig

        public String getTenantConfig()
                               throws ApiException
        This method is used to retrieve tenant Config.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while retrieving tenant Config.
      • updateTenantConfig

        public Object updateTenantConfig​(Object tenantConf)
                                  throws ApiException
        This method is used to update tenant config.
        Parameters:
        tenantConf - Tenant Configuration.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs updating the tenant conf.
      • getTenantConfigSchema

        public Object getTenantConfigSchema()
                                     throws ApiException
        This method is used to retrieve tenant Config Schema.
        Returns:
        API response returned by API call.
        Throws:
        ApiException - if an error occurs while retrieving tenant Config schema.