Host Key Group Change

The API will change the key group for the selected host keys to the selected key group.

Before you begin

Before attempting to change the key group, make sure the current key groups of the selected keys and the target group have RW permissions.

Request Structure

Endpoint: /ssh/host-key/group/update
Type: POST
Sample URL: https://<IP/HostName/TenantName>:<GWPORT>/avxapi/ssh/host-key/group/update?gwsource=external

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

Headers:
Content-Type: application/json
Table 1. Request Parameters
Name Description
sessionId

Header

(Mandatory) Session ID received after login.

Type: String

Constraints: Required if username and password are not provided.

username

Header

(Mandatory) AppViewX login username.

Type: String

Constraints: Required if sessionId is not provided.

password

Header

(Mandatory) AppViewX login password.

Type: String

Constraints: Required if sessionId is not provided.

Content-Type

Header

(Mandatory) Specifies the nature of the data in the payload.

Type: String

Constraints: The value of the param should be ‘application/json’.

gwsource

Query

(Mandatory) Source from which the request is triggered. (E.g. external)

Type: String

requestId

queryParam

(Mandatory) Request Id of the bulk upload request.

Type: String

Payload

Body

(Mandatory) Contains all the parameters to be sent in the request body for the post request.

Type: Payload

Payload

Name Description
keyGroupUpdateRequests

(Mandatory) List of keyGroupUpdateRequests containing list of fingerPrints and newGroupId.

Type: keyGroupUpdateRequests

comments

(Mandatory) Fingerprints of the host keys.

Type: List of Strings

Table 2. keyGroupUpdateRequests
Name Description
keyFingerPrints

(Mandatory) Fingerprints of the host keys.

Type: List of Strings

newGroupId

(Mandatory) ID of the new group.

Type: String

Response Structure

200 OK returns string of type application/json with the following body params.

Table 3. Response Parameters
Name Description
response

Contains the response message of the API.

Type: Host key group change response

message null

Type: String

appStatusCode null.

Type: String

tags More info in case of failure response.
Table 4. Host key group change response
Name Description
status

Status of the key group change request.

Type: String

Status Codes

Table 5. Status Codes and Description
HTTP Status code appStatusCode Message and Possible remediation
200 OK NA Success
401 Unauthorized AVX_GW_003 Authentication failed, reason - Invalid Credentials

Possible remediation: Ensure that valid username and password or valid sessionId is provided as the header param.

400 Bad Request VALIDATION_ERROR_0004 Mandatory field <<field name>> is missing or or empty

Possible remediation: Check and ensure that valid value is provided for <<field name>> field in the request.

417 Expectation Failed ERR-SSH-NB-302 Error while getting groups with read-write permission

Possible remediation: Check and ensure that a user has RW access to the given key group.

417 Expectation Failed ERR-SSH-NB-303 User does not have read-write access to the selected group

Possible remediation: Check and ensure that a user has RW access to the given key group.

417 Expectation Failed SSH-TAG-006 Tag ID is not valid

Possible remediation: Check and ensure that the proper keyId is provided in tags.

Sample Request/Response

Use Case

To update a host-key group using /host-key/group/update API.

Request URL
https://<IP/HostName/TenantName>:<GWPORT>/avxapi/ssh/host-key/group/update?gwsource=external&requestId=<requestId>
Sample Request
{
"keyGroupUpdateRequests": [
    {
 "keyFingerPrints":["BBWMYTYpb99M2Xa4GMqBadsrAFH/XYqBKJ5y4oZmUmU"],
              "newGroupId": "685e972802676f799a85d40b"
           } 
 ]
}
Sample Response

{
   "response": {
       "status": "Key group changed Successfully"
   },
   "message": null,
   "appStatusCode": null,
   "tags": null,
   "headers": null
}

Reference

Understanding the sample URL:
  • 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.
    Note: GWPORT is not required for SaaS setups.

    Example: 31443

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

What's Next