Workload Policies

List Policies

GET https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy

Requests the list of available Workload Policies

Path Parameters

NameTypeDescription

tvm_address

string

IP or FQDN of Trilio service

tenant_id

string

ID of Tenant/Project

Headers

NameTypeDescription

X-Auth-Project-Id

string

Project to authenticate against

X-Auth-Token

string

Authentication token to use

Accept

string

application/json

User-Agent

string

python-workloadmgrclient

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"
            }
         ]
      }
   ]
}

Show Policy

GET https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy/<policy_id>

Requests the details of a given policy

Path Parameters

NameTypeDescription

tvm_address

string

IP or FQDN of Trilio service

tenant_id

string

ID of Tenant/Project

policy_id

string

ID of the Policy to show

Headers

NameTypeDescription

X-Auth-Project-Id

string

Project to authenticate against

X-Auth-Token

string

Authentication token to use

Accept

string

application/json

User-Agent

string

python-workloadmgrclient

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"
         }
      ]
   }
}

list assigned Policies

GET https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy/assigned/<project_id>

Requests the lists of Policies assigned to a Project.

Path Parameters

NameTypeDescription

tvm_address

string

IP or FQDN of Trilio service

tenant_id

string

ID of Tenant/Project

project_id

string

ID of the Project to fetch assigned Policies from

Headers

NameTypeDescription

X-Auth-Project-Id

string

Project to authenticate against

X-Auth-Token

string

Authentication token to use

Accept

string

application/json

User-Agent

string

python-workloadmgrclient

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"
      }
   ]
}

Create Policy

POST https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy

Creates a Policy with the given parameters

Path Parameters

NameTypeDescription

tvm_address

string

IP or FQDN of Trilio service

tenant_id

string

ID of the Tenant/Project to do the restore in

Headers

NameTypeDescription

X-Auth-Project-Id

string

Project to authenticate against

X-Auth-Token

string

Authentication token to use

Content-Type

string

application/json

Accept

string

application/json

User-Agent

string

python-workloadmgrclient

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>
      }
   }
}

Update Policy

PUT https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy/<policy-id>

Updates a Policy with the given information

Path Parameters

NameTypeDescription

tvm_address

string

IP or FQDN of Trilio service

tenant_id

string

ID of the Tenant/Project to do the restore in

policy_id

string

ID of the Policy to update

Headers

NameTypeDescription

X-Auth-Project-Id

string

Project to authenticate against

X-Auth-Token

string

Authentication token to use

Content-Type

string

application/json

Accept

string

application/json

User-Agent

string

python-workloadmgrclient

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>
      }
   }
}

Assign Policy

POST https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy/<policy-id>

Updates a Policy with the given information

Path Parameters

NameTypeDescription

tvm_address

string

IP or FQDN of Trilio service

tenant_id

string

ID of the Tenant/Project to do the restore in

policy_id

string

ID of the Policy to assign

Headers

NameTypeDescription

X-Auth-Project-Id

string

Project to authenticate against

X-Auth-Token

string

Authentication token to use

Content-Type

string

application/json

Accept

string

application/json

User-Agent

string

python-workloadmgrclient

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 Policy

DELETE https://$(tvm_address):8780/v1/$(tenant_id)/workload_policy/<policy_id>

Deletes a given Policy

Path Parameters

NameTypeDescription

tvm_address

string

IP or FQDN of Trilio service

tenant_id

string

ID of Tenant/Project

policy_id

string

ID of the Policy to delete

Headers

NameTypeDescription

X-Auth-Project-Id

string

Project to authenticate against

X-Auth-Token

string

Authentication token to use

Accept

string

application/json

User-Agent

string

python-workloadmgrclient

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

Last updated