Class RestAPIGovernanceImpl
- java.lang.Object
-
- org.wso2.am.integration.test.impl.RestAPIGovernanceImpl
-
public class RestAPIGovernanceImpl extends Object
-
-
Field Summary
Fields Modifier and Type Field Description ApiClientapiGovernanceClientstatic StringappNamestatic StringappOwnerstatic StringcallBackURLstatic StringgrantTypestatic StringpasswordStringtenantDomainstatic StringtokenScopestatic Stringusername
-
Constructor Summary
Constructors Constructor Description RestAPIGovernanceImpl(String username, String password, String tenantDomain, String url)Constructor for the RestAPIGovernanceImpl
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiResponse<APIMGovernancePolicyDTO>createPolicy(APIMGovernancePolicyDTO policyDTO)Create a new governance policyApiResponse<RulesetInfoDTO>createRuleset(String name, File rulesetContent, String ruleType, String artifactType, String description, String ruleCategory, String documentationLink, String provider)Create a new rulesetApiResponse<Void>deletePolicy(String policyId)Delete a governance policyApiResponse<Void>deleteRuleset(String rulesetId)Delete a rulesetApiResponse<ArtifactComplianceDetailsDTO>getAPICompliance(String apiId)Get the compliance details of an artifactApiResponse<APIMGovernancePolicyListDTO>getPolicies(Integer limit, Integer offset, String query)Get all governance policiesApiResponse<APIMGovernancePolicyDTO>getPolicy(String policyId)Get a governance policyApiResponse<PolicyAdherenceDetailsDTO>getPolicyAdherence(String poilcyId)Get the policy adherence details of a policyApiResponse<RulesetInfoDTO>getRuleset(String rulesetId)Get a rulesetApiResponse<RulesetListDTO>getRulesets(Integer limit, Integer offset, String query)Get all rulesetsApiResponse<APIMGovernancePolicyDTO>updatePolicy(String policyId, APIMGovernancePolicyDTO policyDTO)Update an existing governance policyApiResponse<RulesetInfoDTO>updateRuleset(String rulesetId, String name, File rulesetContent, String ruleType, String artifactType, String description, String ruleCategory, String documentationLink, String provider)Update an existing ruleset
-
-
-
Field Detail
-
apiGovernanceClient
public ApiClient apiGovernanceClient
-
appName
public static final String appName
- See Also:
- Constant Field Values
-
callBackURL
public static final String callBackURL
- See Also:
- Constant Field Values
-
tokenScope
public static final String tokenScope
- See Also:
- Constant Field Values
-
appOwner
public static final String appOwner
- See Also:
- Constant Field Values
-
grantType
public static final String grantType
- See Also:
- Constant Field Values
-
username
public static final String username
- See Also:
- Constant Field Values
-
password
public static final String password
- See Also:
- Constant Field Values
-
tenantDomain
public String tenantDomain
-
-
Method Detail
-
createRuleset
public ApiResponse<RulesetInfoDTO> createRuleset(String name, File rulesetContent, String ruleType, String artifactType, String description, String ruleCategory, String documentationLink, String provider) throws ApiException
Create a new ruleset- Parameters:
name- Name of the rulesetrulesetContent- Content of the rulesetruleType- Type of the ruleartifactType- Type of the artifactdescription- Description of the rulesetruleCategory- Category of the ruledocumentationLink- Documentation link of the rulesetprovider- Provider of the ruleset- Returns:
- RulesetInfoDTO
- Throws:
ApiException- If there is an issue with the API request
-
updateRuleset
public ApiResponse<RulesetInfoDTO> updateRuleset(String rulesetId, String name, File rulesetContent, String ruleType, String artifactType, String description, String ruleCategory, String documentationLink, String provider) throws ApiException
Update an existing ruleset- Parameters:
rulesetId- Id of the rulesetname- Name of the rulesetrulesetContent- Content of the rulesetruleType- Type of the ruleartifactType- Type of the artifactdescription- Description of the rulesetruleCategory- Category of the ruledocumentationLink- Documentation link of the rulesetprovider- Provider of the ruleset- Returns:
- RulesetInfoDTO
- Throws:
ApiException- If there is an issue with the API request
-
deleteRuleset
public ApiResponse<Void> deleteRuleset(String rulesetId) throws ApiException
Delete a ruleset- Parameters:
rulesetId- Id of the ruleset- Returns:
- Void
- Throws:
ApiException- If there is an issue with the API request
-
getRuleset
public ApiResponse<RulesetInfoDTO> getRuleset(String rulesetId) throws ApiException
Get a ruleset- Parameters:
rulesetId- Id of the ruleset- Returns:
- RulesetInfoDTO
- Throws:
ApiException- If there is an issue with the API request
-
getRulesets
public ApiResponse<RulesetListDTO> getRulesets(Integer limit, Integer offset, String query) throws ApiException
Get all rulesets- Parameters:
limit- Limit of the rulesetsoffset- Offset of the rulesetsquery- Query to search for rulesets- Returns:
- RulesetListDTO
- Throws:
ApiException- If there is an issue with the API request
-
createPolicy
public ApiResponse<APIMGovernancePolicyDTO> createPolicy(APIMGovernancePolicyDTO policyDTO) throws ApiException
Create a new governance policy- Parameters:
policyDTO- APIMGovernancePolicyDTO object- Returns:
- APIMGovernancePolicyDTO
- Throws:
ApiException- If there is an issue with the API request
-
updatePolicy
public ApiResponse<APIMGovernancePolicyDTO> updatePolicy(String policyId, APIMGovernancePolicyDTO policyDTO) throws ApiException
Update an existing governance policy- Parameters:
policyId- Id of the policypolicyDTO- APIMGovernancePolicyDTO object- Returns:
- APIMGovernancePolicyDTO
- Throws:
ApiException- If there is an issue with the API request
-
deletePolicy
public ApiResponse<Void> deletePolicy(String policyId) throws ApiException
Delete a governance policy- Parameters:
policyId- Id of the policy- Returns:
- Void
- Throws:
ApiException- If there is an issue with the API request
-
getPolicy
public ApiResponse<APIMGovernancePolicyDTO> getPolicy(String policyId) throws ApiException
Get a governance policy- Parameters:
policyId- Id of the policy- Returns:
- APIMGovernancePolicyDTO
- Throws:
ApiException- If there is an issue with the API request
-
getPolicies
public ApiResponse<APIMGovernancePolicyListDTO> getPolicies(Integer limit, Integer offset, String query) throws ApiException
Get all governance policies- Parameters:
limit- Limit of the policiesoffset- Offset of the policiesquery- Query to search for policies- Returns:
- APIMGovernancePolicyListDTO
- Throws:
ApiException- If there is an issue with the API request
-
getAPICompliance
public ApiResponse<ArtifactComplianceDetailsDTO> getAPICompliance(String apiId) throws ApiException
Get the compliance details of an artifact- Parameters:
apiId- Id of the API- Returns:
- ArtifactComplianceDetailsDTO
- Throws:
ApiException- If there is an issue with the API request
-
getPolicyAdherence
public ApiResponse<PolicyAdherenceDetailsDTO> getPolicyAdherence(String poilcyId) throws ApiException
Get the policy adherence details of a policy- Parameters:
poilcyId- Id of the policy- Returns:
- PolicyAdherenceDetailsDTO
- Throws:
ApiException- If there is an issue with the API request
-
-