Workload Policies

get
List Policies

https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy
Requests the list of available Workload Policies
Request
Response
Request
Path Parameters
tvm_address
required
string
IP or FQDN of TrilioVault service
tenant_id
required
string
ID of Tenant/Project
Headers
X-Auth-Project-Id
required
string
Project to authenticate against
X-Auth-Token
required
string
Authentication token to use
Accept
required
string
application/json
User-Agent
optional
string
python-workloadmgrclient
Response
200: OK
Response contains the list of available Workload Policies with Policy details
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Fri, 13 Nov 2020 13:56:08 GMT
Content-Type: application/json
Content-Length: 1399
Connection: keep-alive
X-Compute-Request-Id: req-4618161e-64e4-489a-b8fc-f3cb21d94096
{
"policy_list":[
{
"id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"created_at":"2020-10-26T12:52:22.000000",
"updated_at":"2020-10-26T12:52:22.000000",
"status":"available",
"name":"Gold",
"description":"",
"metadata":[
],
"field_values":[
{
"created_at":"2020-10-26T12:52:22.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"0201f8b4-482d-4ec1-9b92-8cf3092abcc2",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"policy_field_name":"retention_policy_value",
"value":"10"
},
{
"created_at":"2020-10-26T12:52:22.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"48cc7007-e221-44de-bd4e-6a66841bdee0",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"policy_field_name":"interval",
"value":"5"
},
{
"created_at":"2020-10-26T12:52:22.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"79070c67-9021-4220-8a79-648ffeebc144",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"policy_field_name":"retention_policy_type",
"value":"Number of Snapshots to Keep"
},
{
"created_at":"2020-10-26T12:52:22.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"9fec205a-9528-45ea-a118-ffb64d8c7d9d",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"policy_field_name":"fullbackup_interval",
"value":"-1"
}
]
}
]
}

get
Show Policy

https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy/<policy_id>
Requests the details of a given policy
Request
Response
Request
Path Parameters
tvm_address
required
string
IP or FQDN of TrilioVault service
tenant_id
required
string
ID of Tenant/Project
policy_id
required
string
ID of the Policy to show
Headers
X-Auth-Project-Id
required
string
Project to authenticate against
X-Auth-Token
required
string
Authentication token to use
Accept
required
string
application/json
User-Agent
optional
string
python-workloadmgrclient
Response
200: OK
Returns details of the requested Workload Policy
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Fri, 13 Nov 2020 14:18:42 GMT
Content-Type: application/json
Content-Length: 2160
Connection: keep-alive
X-Compute-Request-Id: req-0583fc35-0f80-4746-b280-c17b32cc4b25
{
"policy":{
"id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"created_at":"2020-10-26T12:52:22.000000",
"updated_at":"2020-10-26T12:52:22.000000",
"user_id":"adfa32d7746a4341b27377d6f7c61adb",
"project_id":"4dfe98a43bfa404785a812020066b4d6",
"status":"available",
"name":"Gold",
"description":"",
"field_values":[
{
"created_at":"2020-10-26T12:52:22.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"0201f8b4-482d-4ec1-9b92-8cf3092abcc2",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"policy_field_name":"retention_policy_value",
"value":"10"
},
{
"created_at":"2020-10-26T12:52:22.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"48cc7007-e221-44de-bd4e-6a66841bdee0",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"policy_field_name":"interval",
"value":"5"
},
{
"created_at":"2020-10-26T12:52:22.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"79070c67-9021-4220-8a79-648ffeebc144",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"policy_field_name":"retention_policy_type",
"value":"Number of Snapshots to Keep"
},
{
"created_at":"2020-10-26T12:52:22.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"9fec205a-9528-45ea-a118-ffb64d8c7d9d",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"policy_field_name":"fullbackup_interval",
"value":"-1"
}
],
"metadata":[
],
"policy_assignments":[
{
"created_at":"2020-10-26T12:53:01.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"3e3f1b12-1b1f-452b-a9d2-b6e5fbf2ab18",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"project_id":"4dfe98a43bfa404785a812020066b4d6",
"policy_name":"Gold",
"project_name":"admin"
},
{
"created_at":"2020-10-29T15:39:13.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"8b4a6236-63f1-4e2d-b8d1-23b37f4b4346",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"project_id":"c76b3355a164498aa95ddbc960adc238",
"policy_name":"Gold",
"project_name":"robert"
}
]
}
}

get
list assigned Policies

https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy/assigned/<project_id>
Requests the lists of Policies assigned to a Project.
Request
Response
Request
Path Parameters
tvm_address
required
string
IP or FQDN of TrilioVault service
tenant_id
required
string
ID of Tenant/Project
project_id
required
string
ID of the Project to fetch assigned Policies from
Headers
X-Auth-Project-Id
required
string
Project to authenticate against
X-Auth-Token
required
string
Authentication token to use
Accept
required
string
application/json
User-Agent
optional
string
python-workloadmgrclient
Response
200: OK
Returns list of Policies with some information assigned to the provided Project
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Tue, 17 Nov 2020 09:14:01 GMT
Content-Type: application/json
Content-Length: 338
Connection: keep-alive
X-Compute-Request-Id: req-57175488-d267-4dcb-90b5-f239d8b02fe2
{
"policies":[
{
"created_at":"2020-10-29T15:39:13.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"8b4a6236-63f1-4e2d-b8d1-23b37f4b4346",
"policy_id":"b79aa5f3-405b-4da4-96e2-893abf7cb5fd",
"project_id":"c76b3355a164498aa95ddbc960adc238",
"policy_name":"Gold",
"project_name":"robert"
}
]
}

post
Create Policy

https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy
Creates a Policy with the given parameters
Request
Response
Request
Path Parameters
tvm_address
required
string
IP or FQDN of TrilioVault service
tenant_id
required
string
ID of the Tenant/Project to do the restore in
Headers
X-Auth-Project-Id
required
string
Project to authenticate against
X-Auth-Token
required
string
Authentication token to use
Content-Type
required
string
application/json
Accept
required
string
application/json
User-Agent
optional
string
python-workloadmgrclient
Response
200: OK
Policy got created successfully
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Tue, 17 Nov 2020 09:24:03 GMT
Content-Type: application/json
Content-Length: 1413
Connection: keep-alive
X-Compute-Request-Id: req-05e05333-b967-4d4e-9c9b-561f1a7add5a
{
"policy":{
"id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:24:01.000000",
"status":"available",
"name":"CLI created",
"description":"CLI created",
"metadata":[
],
"field_values":[
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"767ae42d-caf0-4d36-963c-9b0e50991711",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"interval",
"value":"4 hr"
},
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"7e34ce5c-3de0-408e-8294-cc091bee281f",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"retention_policy_value",
"value":"10"
},
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"95537f7c-e59a-4365-b1e9-7fa2ed49c677",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"retention_policy_type",
"value":"Number of Snapshots to Keep"
},
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"f635bece-be61-4e72-bce4-bc72a6f549e3",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"fullbackup_interval",
"value":"-1"
}
]
}
}

Body Format

{
"workload_policy":{
"field_values":{
"fullbackup_interval":"<-1 for never / 0 for always / Integer>",
"retention_policy_type":"<Number of Snapshots to Keep/Number of days to retain Snapshots>",
"interval":"<Integer hr>",
"retention_policy_value":"<Integer>"
},
"display_name":"<String>",
"display_description":"<String>",
"metadata":{
<key>:<value>
}
}
}

put
Update Policy

https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy/<policy-id>
Updates a Policy with the given information
Request
Response
Request
Path Parameters
tvm_address
required
string
IP or FQDN of TrilioVault service
tenant_id
required
string
ID of the Tenant/Project to do the restore in
policy_id
required
string
ID of the Policy to update
Headers
X-Auth-Project-Id
required
string
Project to authenticate against
X-Auth-Token
required
string
Authentication token to use
Content-Type
required
string
application/json
Accept
required
string
application/json
User-Agent
optional
string
python-workloadmgrclient
Response
200: OK
Policy has been updated successfully
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Tue, 17 Nov 2020 09:32:13 GMT
Content-Type: application/json
Content-Length: 1515
Connection: keep-alive
X-Compute-Request-Id: req-9104cf1c-4025-48f5-be92-1a6b7117bf95
{
"policy":{
"id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:24:01.000000",
"status":"available",
"name":"API created",
"description":"API created",
"metadata":[
],
"field_values":[
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:31:45.000000",
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"767ae42d-caf0-4d36-963c-9b0e50991711",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"interval",
"value":"8 hr"
},
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:31:45.000000",
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"7e34ce5c-3de0-408e-8294-cc091bee281f",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"retention_policy_value",
"value":"20"
},
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:31:45.000000",
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"95537f7c-e59a-4365-b1e9-7fa2ed49c677",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"retention_policy_type",
"value":"Number of days to retain Snapshots"
},
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:31:45.000000",
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"f635bece-be61-4e72-bce4-bc72a6f549e3",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"fullbackup_interval",
"value":"7"
}
]
}
}

Body Format

{
"policy":{
"field_values":{
"fullbackup_interval":"<-1 for never / 0 for always / Integer>",
"retention_policy_type":"<Number of Snapshots to Keep/Number of days to retain Snapshots>",
"interval":"<Integer hr>",
"retention_policy_value":"<Integer>"
},
"display_name":"String",
"display_description":"String",
"metadata":{
<key>:<value>
}
}
}

post
Assign Policy

https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy/<policy-id>
Updates a Policy with the given information
Request
Response
Request
Path Parameters
tvm_address
required
string
IP or FQDN of TrilioVault service
tenant_id
required
string
ID of the Tenant/Project to do the restore in
policy_id
required
string
ID of the Policy to assign
Headers
X-Auth-Project-Id
required
string
Project to authenticate against
X-Auth-Token
required
string
Authentication token to use
Content-Type
required
string
application/json
Accept
required
string
application/json
User-Agent
optional
string
python-workloadmgrclient
Response
200: OK
Policy has been assigned successfully
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Tue, 17 Nov 2020 09:46:23 GMT
Content-Type: application/json
Content-Length: 2318
Connection: keep-alive
X-Compute-Request-Id: req-169a53e4-b1c9-4bd1-bf68-3416d177d868
{
"policy":{
"id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:24:01.000000",
"user_id":"adfa32d7746a4341b27377d6f7c61adb",
"project_id":"4dfe98a43bfa404785a812020066b4d6",
"status":"available",
"name":"API created",
"description":"API created",
"field_values":[
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:31:45.000000",
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"767ae42d-caf0-4d36-963c-9b0e50991711",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"interval",
"value":"8 hr"
},
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:31:45.000000",
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"7e34ce5c-3de0-408e-8294-cc091bee281f",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"retention_policy_value",
"value":"20"
},
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:31:45.000000",
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"95537f7c-e59a-4365-b1e9-7fa2ed49c677",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"retention_policy_type",
"value":"Number of days to retain Snapshots"
},
{
"created_at":"2020-11-17T09:24:01.000000",
"updated_at":"2020-11-17T09:31:45.000000",
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"f635bece-be61-4e72-bce4-bc72a6f549e3",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"policy_field_name":"fullbackup_interval",
"value":"7"
}
],
"metadata":[
],
"policy_assignments":[
{
"created_at":"2020-11-17T09:46:22.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"4794ed95-d8d1-4572-93e8-cebd6d4df48f",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"project_id":"cbad43105e404c86a1cd07c48a737f9c",
"policy_name":"API created",
"project_name":"services"
},
{
"created_at":"2020-11-17T09:46:22.000000",
"updated_at":null,
"deleted_at":null,
"deleted":false,
"version":"4.0.115",
"id":"68f187a6-3526-4a35-8b2d-cb0e9f497dd8",
"policy_id":"23176f20-9e9d-4fc3-9d3d-f10d2b184163",
"project_id":"c76b3355a164498aa95ddbc960adc238",
"policy_name":"API created",
"project_name":"robert"
}
]
},
"failed_ids":[
]
}

Body Format

{
"policy":{
"remove_projects":[
"<project_id>"
],
"add_projects":[
"<project_id>",
]
}
}

delete
Delete Policy

https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy/<policy_id>
Deletes a given Policy
Request
Response
Request
Path Parameters
tvm_address
required
string
IP or FQDN of TrilioVault service
tenant_id
required
string
ID of Tenant/Project
policy_id
required
string
ID of the Policy to delete
Headers
X-Auth-Project-Id
required
string
Project to authenticate against
X-Auth-Token
required
string
Authentication token to use
Accept
required
string
application/json
User-Agent
optional
string
python-workloadmgrclient
Response
202: Accepted
Deletion Request accepted
HTTP/1.1 202 Accepted
Server: nginx/1.16.1
Date: Tue, 17 Nov 2020 09:56:03 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Connection: keep-alive