API
|
Method
|
Syntax
|
Request Body
|
Response Body
|
HTTP Status Codes
|
Notes
|
Query Snapshots
|
GET
|
[+]Show
/grs/v1/tenant/{tenantId}/package/{packageId}/snapshots
|
N/A
|
[+]Show
"snapshots":[
{
"snapshotId", "dcc4a39b-3442-4408-a907-b85c44663681",
"name":"Snap 01",
"comment":"Create prior to QA",
"createDate":30949200000,
},
{
"name":"Snap 02",
"comment":"UAT",
"createDate":31989200000,
}
]
}
|
- 200 OK—Response body provided
- 401 Unauthorized—APIToken not valid
- 404 Not Found—could not find specified package ID.
|
User must have SNAPSHOT_VIEW permission.
|
Create Snapshot
|
POST
|
[+]Show
/grs/v1/tenant/{tenantId}/package/{packageId}/snapshot
|
[+]Show
{
"name":"Snap 01",
"comment":"Create prior to QA",
}
|
[+]Show
{
"snapshotId", "dcc4a39b-3442-4408-a907-b85c44663681",
"name":"Snap 01",
"comment":"Create prior to QA",
"createDate":30949200000,
}
|
- 201 - Created - Response body provided
- 401 - Unauthorized - APIToken not valid
- 403 - Forbidden - User does not have permission for the specified tenant, or does not have proper permission to perform this operation.
- 422 - Unprocessable Entry - Field Validation Error
[+]Show
{
"message": "Validation Failed",
"errors": [
{
"code" : "1000",
"field" : "name",
"message": "snapshot name is not valid"
}
]
}
- 422 - Unprocessable Entry - Rules in package do not validate
[+]Show
{
"message": "Package Validation Failed",
"errors": [
{
"message": "Validation error 1"
},
{
"message": "Validation error 2"
}
]
}
|
User must have SNAPSHOT_CREATE permission.
- name—Snapshot name cannot contain special characters such as: { } [ ] . * | / : < > ' & due to internal restrictions.
|
Delete Snapshot
|
DELETE
|
[+]Show
/grs/v1/tenant/{tenantId}/package/{packageId}/snapshot/{snapshotId}
|
N/A
|
N/A
|
- 204 No Content—returned if successful operation
- 401 Unauthorized—APIToken not valid
- 403 Forbidden—User does not have permission for the specified tenant or does not have proper permission to perform this operation.
- 404 Not Found—could not find specified package ID.
|
User must have SNAPSHOT_DELETE permission.
|
Query Deployment History
|
GET
|
[+]Show
/grs/v1/tenant/{tenantId}/package/{packageId}/deploy
|
N/A
|
[+]Show
"deployments":[
{
"deploymentId" : 34234,
"packageVersion" : 1,
"snapshotName":"Snap 01",
"deployedTo", "GRECluster",
"deployedBy", "username",
"comments":"Deploy to QA servers",
"deployScheduleDateTime": 34243432432,
"status" : SUCCESS
}
]
}
|
- 200 OK—Response body provided
- 401 Unauthorized—APIToken not valid
- 403 Forbidden—User does not have permission for the specified tenant.
- 404 Not Found—could not find specified package ID.
|
status
- SUCCESS—deployment was successful
- FAILED—deployment failed
- PARTIAL—deployment was partially successful
- PENDING—deployment is still processing
- SCHEDULED—deployment is scheduled
|
Query Deployment Targets
|
GET
|
[+]Show
/grs/v1/tenant/{tenantId}/deploytargets
|
N/A
|
[+]Show
"deploytargets":[
{
"name" : "GRE_1",
"type" : SINGLE
},
{
"name" : "GRE_2",
"type" : SINGLE
},
{
"name" : "GRE_CLUSTER",
"type" : CLUSTER
}
]
}
|
- 200 OK—Response body provided
- 401 Unauthorized—APIToken not valid
- 403 Forbidden—User does not have permission for the specified tenant.
|
type
- SINGLE—represents a single GRE node target
- CLUSTER—represents a cluster of GRE nodes
|
Deploy Rule Package or Snapshot
|
POST
|
[+]Show
/grs/v1/tenant/{tenantId}/package/{packageId}/deploy
|
[+]Show
{
"target": "GRE_Cluster",
"snapshotName":"Snap 01",
"comments":"Deploy to QA servers",
"deployScheduledDateTime": 34243432432
}
|
[+]Show
{
"target": "GRE_Cluster", "deploymentId" : 34234,
"snapshotName":"Snap 01",
"comments":"Deploy to QA servers",
"deployScheduleDateTime": 34243432432
}
|
- 201 Created—Response body provided with deployment ID
- 401 Unauthorized—APIToken not valid
- 403 Forbidden—User does not have permission for the specified tenant or does not have proper permission to perform this operation.
- 404 Not Found—could not find specified package ID or snapshot name
- 422 Unprocessable Entry—Field Validation Error
[+]Show
{
"message": "Validation Failed",
"errors": [
{
"code" : "1000",
"field" : "name",
"message": "snapshot name is not found"
}
{
"code" : "1001",
"field" : "deployScheduleDateTime",
"message": "scheduled date/time is in the past."
}
]
}
- 422 Unprocessable Entry—Rules in package do not validate
[+]Show
{
"message": "Package Validation Failed",
"errors": [
{
"message": "Validation error 1"
},
{
"message": "Validation error 2"
}
]
}
|
User must have PACKAGE_DEPLOY and SNAPSHOT_VIEW permissions.
- target—Indicate which GRE or GRE Cluster you want to deploy to. Use "Query Deploy Targets" to get the list of valid targets.
- snapShotName—To deploy "latest" package, specify "LATEST" as snapshot name (or omit the field).
- deployScheduledDateTime—To schedule deployment for a future time, pass in scheduledDateTime field in UTC ms since EPOCH. To schedule immediately, omit this field.
|