Api Proxy Policy APIs
1. Get all existing policies of specified API Proxy
Description/Purpose: List the policies in the API Proxy whose name is sent as a parameter.
Authorization: In order to access the services, the user who wants to access the services must have a role within the project that has “Manage Proxies ‘ and ’Deploy/Undeploy Proxies” authorization.
Endpoint: https://<APINIZER_MANAGER_ADDRESS>/apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/
HTTP Method: GET
Request Headers:
Header | Value |
|---|---|
| Authorization | <ACCESS_TOKEN> Token is required to access this endpoint. For detailed information on how to get a token, please visit the Authorization API page. |
| Accept | application/json |
Request Path Parameters:
Parameter | Value |
|---|---|
| projectName | Full name of the project where the queried API Proxy is located |
| apiProxyName | Full name of the API Proxy to query |
Request Body: (none)
Response:
Status | Status Code | Description | Body |
|---|---|---|---|
| Success | 200 | successful operation | { "responsePolicyList": [ "requestPolicyList": [ |
| Wrong | 400 | bad request | { "error": "...", "error_description": "..." } |
| Wrong | 401 | not authorized for this operation | { |
| Wrong | 500 | internal error | { "error": "...", "error_description": "..." } |
2. Add a policy to specified API Proxy
Description/Purpose: Adds a new policy to the specified API Proxy.
Authorization: The user who wants to access the services must have a role in the project that has “Manage Proxies ‘ and ’Deploy/Undeploy Proxies” authorization.
Endpoint: https://<APINIZER_MANAGER_ADDRESS>/apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
HTTP Method: POST
Request Headers:
Header | Value |
|---|---|
| Authorization | <ACCESS_TOKEN> Token is required to access this endpoint. For detailed information on how to get a token, please visit the Authorization API page. |
| Accept | application/json |
| Content-Type | application/json |
Request Path Parameters:
Parameter | Value |
|---|---|
| projectName | Full name of the project where the API Proxy to add a policy is located |
| apiProxyName | Full name of the API Proxy to add policy to |
| policyName | Full name of the policy to be added |
Request Body:
|
İşlem Metadata bilgilerini içeren operationMetadata alanının özellikleri:
Field | Status | Values It Can Take | Description |
|---|---|---|---|
| targetScope | Required | ALL, | Specifies whether to add the policy to the API Proxy global (ALL) or to an endpoint (ENDPOINT). |
| targetEndpoint | Conditional (mandatory when the value of “targetScope” is “ENDPOINT”) | Text Value | Destination endpoint information. |
| targetEndpointHTTPMethod | Conditional (mandatory when the value of “targetScope” is “ENDPOINT”) | GET, POST, PUT, HEAD, OPTIONS, DELETE, PATCH, TRACE, ALL | HTTP Method information of the target endpoint. |
| targetPipeline | Required | REQUEST, RESPONSE, ERROR | The information on which line in the destination the policy will be added. |
| order | Optional | Numeric value | When sent, the policy is added to the corresponding queue in the target pipeline. |
| deploy | Optional | Boolean Value | When it is sent and its value is “true”, it allows the corresponding API Proxy to be installed on the target environment. |
| deployTargetEnvironmentNameList | Conditional | Text Value | Specifies which environment(s) the Api Proxy will be installed to. |
Fields containing Common Policy information:
Field | Status | Values It Can Take | Description |
|---|---|---|---|
| type | Required | policy-api-authentication | Holds the type of policy. |
| description | Optional | Text Value | It is a statement of policy. |
| active | Required | Boolean Value | Whether the policy is active or not. |
Politikaya ait diğer alanlar politikanın tipine göre değişir.
Response:
Status | Status Code | Description | Body |
|---|---|---|---|
| Success | 200 | successful operation | { |
| Fault | 400 | bad request | { "error": "...", "error_description": "..." } |
| Fault | 401 | not authorized for this operation | { |
| Fault | 500 | internal error | { "error": "...", "error_description": "..." } |
3. Update an existing policy at specified API Proxy
Description/Purpose: Allows the policy in the specified API Proxy to be updated. The policy to be updated is found on the target line with the policy name.
Authorization: The user who wants to access the services must have a role in the project that has the “Manage Proxies ‘ and ’Deploy/Undeploy Proxies” authorization.
Endpoint: https://<APINIZER_MANAGER_ADDRESS>/apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
HTTP Method: PUT
Request Headers:
Header | Value |
|---|---|
| Authorization | <ACCESS_TOKEN> Token is required to access this endpoint. For detailed information on how to get a token, please visit the Authorization API page. |
| Accept | application/json |
| Content-Type | application/json |
Request Path Parameters:
Parameter | Value |
|---|---|
| projectName | Full name of the project where the API Proxy whose policy will be updated is located |
| apiProxyName | Full name of the API Proxy whose policy will be updated |
| policyName | Full name of the policy to be updated |
Request Body:
|
İşlem Metadata bilgilerini içeren operationMetadata alanının özellikleri:
Field | Status | Values It Can Take | Description |
|---|---|---|---|
| targetScope | Required | ALL, | Specifies whether to look for the policy across the API Proxy (ALL) or at an endpoint (ENDPOINT). |
| targetEndpoint | Conditional (Required when the value of “targetScope” is “ENDPOINT”) | Text Value | Destination endpoint information. |
| targetEndpointHTTPMethod | Conditional (Required when the value of “targetScope” is “ENDPOINT”) | GET, POST, PUT, HEAD, OPTIONS, DELETE, PATCH, TRACE, ALL | HTTP Method information of the target endpoint. |
| targetPipeline | Required | REQUEST, RESPONSE, ERROR | The information on which line in the destination the policy will be called. |
| order | Optional | Numeric Value | When sent, if the policy is not in the relevant queue in the target pipeline, its queue is updated. |
| deploy | Optional | Boolean Value | When it is sent and its value is “true”, it allows the corresponding API Proxy to be installed on the target environment. |
| deployTargetEnvironmentNameList | Conditional (required when “deploy” is “true”) | Text Value | Specifies which environment(s) the Api Proxy will be installed to. |
Fields containing Common Policy information:
Field | Status | Values It Can Take | Description |
|---|---|---|---|
| type | Required | policy-api-authentication | Holds the type of policy. |
| description | Optional | Text Value | It is a statement of policy. |
| active | Required | Boolean Value | Whether the policy is active or not. |
Response:
Status | Status Code | Description | Body |
|---|---|---|---|
| Succes | 200 | successful operation | { |
| Fault | 400 | bad request | { "error": "...", "error_description": "..." } |
| Fault | 401 | not authorized for this operation | { |
| Fault | 500 | internal error | { "error": "...", "error_description": "..." } |
4. Delete a policy from specified API Proxy
Description/Purpose: Deletes the policy in the specified API Proxy. The policy to be deleted is found on the target line with the policy name.
Authorization: The user who wants to access the services must have a role in the project that has the “Manage Proxies ‘ and ’Deploy/Undeploy Proxies” authorization.
Endpoint: https://<APINIZER_MANAGER_ADDRESS>/apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/
HTTP Method: DELETE
Request Headers:
Header | Value |
|---|---|
| Authorization | <ACCESS_TOKEN> Token is required to access this endpoint. For detailed information on how to get a token, please visit the Authorization API page. |
| Accept | application/json |
| Content-Type | application/json |
Request Path Parameters:
Parameter | Value |
|---|---|
| projectName | Full name of the project where the API Proxy whose policy will be deleted is located |
| apiProxyName | Full name of the API Proxy whose policy will be deleted |
| policyName | Full name of the policy to be deleted |
Request Body:
|
İşlem Metadata bilgilerini içeren operationMetadata alanının özellikleri:
Field | Status | Values It Can Take | Description |
|---|---|---|---|
| targetScope | Required | ALL, | Specifies whether to look for the policy across the API Proxy (ALL) or at an endpoint (ENDPOINT). |
| targetEndpoint | Conditional (Required when the value of “targetScope” is “ENDPOINT”) | Text Value | Destination endpoint information. |
| targetEndpointHTTPMethod | Conditional (Required when the value of “targetScope” is “ENDPOINT”) | GET, POST, PUT, HEAD, OPTIONS, DELETE, PATCH, TRACE, ALL | HTTP Method information of the target endpoint. |
| targetPipeline | Required | REQUEST, RESPONSE, ERROR | The information on which line in the destination the policy will be called. |
| deploy | Optional | Boolean Value | When it is sent and its value is “true”, it allows the corresponding API Proxy to be installed on the target environment. |
| deployTargetEnvironmentNameList | Conditional (required when “deploy” is “true”) | Text Value | Specifies which environment(s) the Api Proxy will be installed to. |
Response:
Status | Status Code | Description | Body |
|---|---|---|---|
| Success | 200 | successful operation | { |
| Fault | 400 | bad request | { "error": "...", "error_description": "..." } |
| Fault | 401 | not authorized for this operation | { |
| Fault | 500 | internal error | { "error": "...", "error_description": "..." } |