Generate Commands And Implement
To generate commands for the command repository and implementation.
Request Structure
| Endpoint: | /generate-commands-and-implement |
| Type: | POST |
| Sample URL: | https://<IP/HostName/TenantName>:<GWPORT>/avxapi/generate-commands-and-implement?gwsource=externalTo understand the elements of the sample URL, click here. |
| Headers: | |
| Content-Type: | application/json |
| Name | Description |
|---|---|
| sessionID
|
(Mandatory) Use session ID retrieved from login
API is required if username and password are not
provided. Example: "sessionId": "ce7f1a14-2bf9-4e4a-89a8-bc780a255813" |
| username
|
(Mandatory) AppViewX login username is required if
sessionId is not provided. Example: "admin" |
| password
|
(Mandatory) AppViewX login password is required if
sessionId is not provided.. Example: "AppViewX@123" |
| Content-Type
|
(Mandatory) The parameter should be set to
application/json to specify the nature of
the data in the payload. Example: "application/json" |
| gwsource
|
(Mandatory) Source from which the request is
triggered. The values can be:
|
| payload
|
(Mandatory) Contains all the params to be sent in
the request body for the post request. Type: Map |
Response Structure
- Status Code: 200 OK
- Message: Success
- Headers:
- Content-Type: application/json
| Name | Description |
|---|---|
| response
|
Contains the response object along with the hierarchy of the object mapped in field children. |
| message
|
Success message or failure description in case of error. |
| appStatusCode
|
Application specific status code for the response. Will be non-null for failure response. |
| tags
|
More info in case of failure response. |
Status Codes
| HTTP Code | appStatusCode | Message and Remediation |
|---|---|---|
| 200 OK | NA | Success |
| 500 Internal Server Error | AVX_INVALID_DEVICE | Device not present. Possible Remediation: Check whether the device given in payload is available in device inventory. |
| 500 Internal Server Error | AVX_INVALID_REPO_COMMAND | No command present in repository. Possible Remediation: Check whether the provided intent is present in the command repository collection. |
| 500 Internal Server Error | CMD_REPO_ERROR_0006 | Proxy details not configured. Possible Remediation: Check whether proxy is configured in UI ,If proxy required toggle is set to true for that particular device. |
| 500 Internal Server Error | CMD_REPO_ERROR_0007 | Vendor specific details details are null ,hence not
able to fetch the device credentials for AkamaiCPS
device. Possible Remediation: Provide valid device details. |
| 500 Internal Server Error | CMD_REPO_ERROR_0008 | Access details are null ,hence not able to fetch the
akamai device credentials. Possible Remediation: Provide valid device details. |
Sample Request/Response
To generate commands for the command repository and its implementation.
https://<IP/HostName/TenantName>:<GWPORT>/avxapi/generate-commands-and-implement?gwsource=external{
"payload": {
"intent": "common-avi-intent",
"resource": "avi_v20",
"attributes": {
"input_dict": "{}",
"request_type": "GET",
"device_version": "20.1.3",
"url": "https://192.168.142.203/api/virtualservice?name=test_saas_vs",
"tenant_name": "admin"
}
}
}{
"response": {
"status": "Success",
"deviceName": "avi_v20",
"logs": [
{
"type": "rest",
"command": "https://192.168.142.203/api/virtualservice?name=test_saas_vs",
"output": {
"Transfer-Encoding": "chunked",
"response_entity": "{\"count\": 1, \"results\": [{\"_last_modified\": \"1663667361860630\", \"active_standby_se_tag\": \"ACTIVE_STANDBY_SE_1\", \"advertise_down_vs\": false, \"allow_invalid_client_cert\": false, \"analytics_profile_ref\": \"https://192.168.142.203/api/analyticsprofile/analyticsprofile-305c2061-aa37-4b91-b5fd-ef1b77dfbf4c\", \"application_profile_ref\": \"https://192.168.142.203/api/applicationprofile/applicationprofile-dbd5d9bd-7996-4b49-92ca-9f034324a0e0\", \"bulk_sync_kvcache\": false, \"close_client_conn_on_config_update\": false, \"cloud_ref\": \"https://192.168.142.203/api/cloud/cloud-77c521f0-b1b6-45e2-a140-9eedc12189c1\", \"cloud_type\": \"CLOUD_NONE\", \"delay_fairness\": false, \"east_west_placement\": false, \"enable_autogw\": true, \"enabled\": true, \"flow_dist\": \"LOAD_AWARE\", \"flow_label_type\": \"NO_LABEL\", \"ign_pool_net_reach\": false, \"limit_doser\": false, \"marked_for_delete\": false, \"max_cps_per_client\": 0, \"name\": \"test_saas_vs\", \"network_profile_ref\": \"https://192.168.142.203/api/networkprofile/networkprofile-d1cf6c38-8428-4716-a170-f6e36dbd7938\", \"pool_ref\": \"https://192.168.142.203/api/pool/pool-6ad1994a-1c5f-40ee-9546-9c2f0862d08e\", \"redis_db\": 1, \"redis_port\": 5024, \"remove_listening_port_on_vs_down\": false, \"scaleout_ecmp\": false, \"se_group_ref\": \"https://192.168.142.203/api/serviceenginegroup/serviceenginegroup-69cec0db-ac5a-4e0d-a464-6d11cde48da9\", \"self_se_election\": true, \"services\": [{\"enable_http2\": false, \"enable_ssl\": false, \"port\": 80, \"port_range_end\": 80}], \"ssl_sess_cache_avg_size\": 1024, \"tenant_ref\": \"https://192.168.142.203/api/tenant/admin\", \"tls_ticket_key\": [{\"aes_key\": \"Qpzy0H29GhmfyM6O6TUR0A==\", \"hmac_key\": \"bUVgFuTX3l/Kv7Ufxrupwg==\", \"name\": \"4b253145-1058-40ae-9983-736daf1bc9c8\"}, {\"aes_key\": \"0TFukILKfmBFlx8aACcozw==\", \"hmac_key\": \"ebGOv2ciOeWnE7/eV9AN6g==\", \"name\": \"384c4140-0e4e-4b00-a3a5-bd50628c255e\"}, {\"aes_key\": \"jF2dCsCAexOPSFg5hliwuA==\", \"hmac_key\": \"qgOsgOYrOoTSsw8RFVJpwA==\", \"name\": \"dfbb4430-4b28-4832-b101-1e776074fcb7\"}], \"traffic_enabled\": true, \"type\": \"VS_TYPE_NORMAL\", \"url\": \"https://192.168.142.203/api/virtualservice/virtualservice-136b7997-05e2-4e6b-9fd3-fd187b8270cf\", \"use_bridge_ip_as_vip\": false, \"use_vip_as_snat\": false, \"uuid\": \"virtualservice-136b7997-05e2-4e6b-9fd3-fd187b8270cf\", \"version\": \"6\", \"vh_type\": \"VS_TYPE_VH_SNI\", \"vip_runtime\": [{\"num_additional_se\": 0, \"requested_resource\": {\"num_se\": 1, \"num_standby_se\": 0}, \"vip_id\": \"0\"}], \"vrf_context_ref\": \"https://192.168.142.203/api/vrfcontext/vrfcontext-670d9c1d-b9a3-49c5-b593-089c70fc67c2\", \"vsvip_ref\": \"https://192.168.142.203/api/vsvip/vsvip-995e5148-1161-4ae1-ac59-8a2e21d4dcb4\", \"weight\": 1}]}\n",
"X-Content-Type-Options": "nosniff",
"Access-Control-Allow-Methods": "GET",
"Connection": "keep-alive",
"sessionid": "sessionid=None; expires=Thu, 22-Sep-2022 06:51:35 GMT; HttpOnly; Max-Age=86400; Path=/; SameSite=None; Secure",
"Access-Control-Allow-Headers": "Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,X-Avi-Tenant,X-Avi-UserAgent,X-Avi-Tenant-UUID,X-CSRFToken,X-PORTAL-AUTHTOKEN",
"Date": "Wed, 21 Sep 2022 06:51:35 GMT",
"Allow": "OPTIONS, HEAD, GET, POST",
"Referrer-Policy": "strict-origin",
"X-Frame-Options": "SAMEORIGIN",
"AVI_API_VERSION": "20.1.3",
"Access-Control-Expose-Headers": "X-NEXT-CALL",
"Strict-Transport-Security": "max-age=31536000; includeSubdomains",
"Cache-Control": "private, no-cache, must-revalidate",
"Access-Control-Allow-Credentials": "true",
"Content-Security-Policy": "default-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self' data:; img-src 'self' data:;",
"Vary": "Origin",
"Set-Cookie": "sessionid=None; expires=Thu, 22-Sep-2022 06:51:35 GMT; HttpOnly; Max-Age=86400; Path=/; SameSite=None; Secure",
"X-XSS-Protection": "1; mode=block",
"status": "200",
"Content-Type": "application/json"
},
"status": "Success",
"timestamp": 1663743389000,
"sequenceNumber": 0,
"uniqueNumber": 1,
"retriedOutput": [],
"executionCount": 0
}
],
"checkCompletion": true,
"autoSyncNeeded": false,
"activeDeviceName": "avi_v20",
"queueEnabled": false,
"executeDevicesSequentially": false
},
"message": null,
"appStatusCode": null,
"tags": null,
"headers": null
}Reference
- 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.
- IP: A unique identifier assigned to each device connected to
a computer network that uses the Internet Protocol for communication
- 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.