Cluster Policy Template Create

This API is used to create cluster policy template.

Request Structure

Endpoint: /kube-cluster-policy-template-add
Type: POST
Sample URL: https://<IP/HostName/TenantName>:<GWPORT>/avxapi/kube-cluster-policy-template-add?gwsource=external

To understand the elements of the sample URL, click here.

Headers:
Content-Type: application/json
Table 1. Input Parameter
Name Description
sessionId

Header

(Mandatory) A unique identifier assigned to a user's session upon successful authentication. The session ID remains valid until it expires, and it can contain alphanumeric characters.

Type: String

Constraints: The session ID is used when username and password are not provided.

Example: A1B2c3d4E5F6

gwsource

Query

(Mandatory) Source from which the request is triggered.

Type: String

Example: DataCenterA

payload

Body

(Mandatory) Input data for request body in application/json format. For payload details, see Payload section.

Payload

Name Description
policyName

String

Unique name assigned to the policy.
description

String

A brief description of the policy’s purpose or details.
discoveryExclusionRegex

Object

Object defining regex patterns for excluding certain items from discovery.
caSettingTemplates

Object

Contains CA setting template details.
casettingType

String

Specifies the type of certificate used in the policy based on the CA setting template.

Response Structure

  • Status Code: 200 OK
  • Message: SUCCESS
  • Headers:
    • Content-Type: application/json
Name Description
response

String

Successfully added policy.
message

String

Success message or failure description in case of error.
appStatusCode

String

Application specific status code for the response. Will be non-null for failure response.
tags More info in case of failure response.

Sample Request/Response

Use case: Create a Cluster policy template using policy name "cluster-policy".
Request URL

https://<IP/HostName/TenantName>:<GWPORT>/avxapi/kube-issuer-ca-template-add?gwsource=external

Sample Request
POST Content type: application/json Username: <> Password: <>
{
    "payload": {
        "policyName": "cluster-policy",
        "description": "Description",
        "discoveryExclusionRegex": [
            "test.*"
        ],
        "caSettingTemplates": [],
        "casettingType": "CA Setting Cluster"
    }
}
Sample Response
{
    "response": {
        "messageType": "SUCCESS",
        "message": "Successfully added policy."
    },
    "message": "Successfully added policy.",
    "appStatusCode": "success",
    "tags": null,
    "headers": null
}
Use case: Create a Cluster policy template using policy name "cluster-policy".
Request URL

https://<IP/HostName/TenantName>:<GWPORT>/avxapi/cluster-policy-cluster-wide?gwsource=external

Sample Request
POST Content type: application/json Username: <> Password: <>
{
    "payload": {
        "policyName": "cluster-policy-cluster-wide",
        "description": "Description",
        "discoveryExclusionRegex": [
            "test.*"
        ],
        "caSettingTemplates": [],
        "casettingType": "CA Setting"
    }
}
Sample Response
{
    "response": {
        "messageType": "SUCCESS",
        "message": "Successfully added policy."
    },
    "message": "Successfully added policy.",
    "appStatusCode": "success",
    "tags": null,
    "headers": null
}

Reference

Understanding the sample URL: This section provides an explanation of each component of the sample URL structure used in API requests. For quick reference, this section is referenced in all the API topics as Reference in this guide.
  • IP/HostName/TenantName: Replace with the actual IP address, hostname, or tenant name based on the specific configuration in AppViewX.
    • IP: A unique identifier assigned to each device connected to a computer network that uses the Internet Protocol for communication

      The IP address will be included in the endpoint URL for an on-prem deployment.

    • HostName: A human-readable label assigned to a device (host) on a network

      The hostname will be included in the endpoint URL for an on-prem deployment.

    • TenantName: An identifier label for a tenant given to indicate which tenant's data the API request will access/modify

      The tenant name will be included in the endpoint URL for a SaaS deployment.

  • GWPORT: AppViewX gateway port

    A gateway port refers to a network port through which data is sent and received to communicate with a gateway in an on-prem deployment.

    Example: 31443

  • avxapi: Path parameter value (static) that is part of the endpoint's URL
  • Endpoint: Endpoint of the API, for example: execute-hook
  • gwsource: Source or origin of a gateway, for example: external.

What's Next