github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/csbs/v1/policies/testing/fixtures.go (about)

     1  package testing
     2  
     3  const (
     4  	policiesEndpoint = "/policies"
     5  	policies_id      = "5af626d2-19b9-4dc4-8e95-ddba008318b3"
     6  )
     7  
     8  var getResponse = `
     9  	{
    10      "policy": {
    11          "status": "suspended",
    12          "provider_id": "fc4d5750-22e7-4798-8a46-f48f62c4c1da",
    13          "description": "My plan",
    14          "tags": [],
    15          "scheduled_operations": [
    16              {
    17                  "description": "My backup policy",
    18                  "enabled": true,
    19                  "trigger_id": "30411091-f206-48e9-8ef9-62be070ea217",
    20                  "trigger": {
    21                      "properties": {
    22                          "pattern": "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n",
    23                          "start_time": "2018-08-20 07:31:32"
    24                      },
    25                      "type": "time",
    26                      "id": "30411091-f206-48e9-8ef9-62be070ea217",
    27                      "name": "default"
    28                  },
    29                  "operation_definition": {
    30                      "max_backups": 20,
    31                      "provider_id": "fc4d5750-22e7-4798-8a46-f48f62c4c1da",
    32                      "plan_id": "5af626d2-19b9-4dc4-8e95-ddba008318b3"
    33                  },
    34                  "operation_type": "backup",
    35                  "id": "b70c712d-f48b-43f7-9a0f-3bab86d59149",
    36                  "name": "my-backup-policy"
    37              }
    38          ],
    39          "id": "5af626d2-19b9-4dc4-8e95-ddba008318b3",
    40          "name": "c2c-policy",
    41          "parameters": {
    42              "common": {}
    43          },
    44          "created_at": "2018-08-20T07:31:32.718435",
    45          "project_id": "91d687759aed45d28b5f6084bc2fa8ad",
    46          "resources": [
    47              {
    48                  "type": "OS::Nova::Server",
    49                  "id": "cd5955b4-44c0-4f0a-ac57-2401b89cb347",
    50                  "name": "resource1"
    51              }
    52          ]
    53      }
    54  }
    55  `
    56  var createRequest = `
    57  {
    58    "policy" : {
    59      "name" : "c2c-policy",
    60      "description" : "My plan",
    61      "provider_id" : "fc4d5750-22e7-4798-8a46-f48f62c4c1da",
    62     "parameters": {
    63              "common": {}
    64          },
    65      "scheduled_operations" : [ {
    66        "name" : "my-backup-policy",
    67        "description" : "My backup policy",
    68        "enabled" : true,
    69        "operation_definition" : {
    70          "max_backups" : 20,
    71  		"permanent" : false
    72        },
    73        "trigger" : {
    74          "properties" : {
    75            "pattern" : "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"
    76          }
    77        },
    78        "operation_type" : "backup"
    79      }],
    80      "resources" : [ {
    81        "id" : "cd5955b4-44c0-4f0a-ac57-2401b89cb347",			
    82        "type" : "OS::Nova::Server",
    83        "name" : "resource1"
    84       
    85      }]
    86    }
    87  }
    88  
    89  `
    90  
    91  var createResponse = `
    92  {
    93      "policy": {
    94          "status": "suspended",
    95          "provider_id": "fc4d5750-22e7-4798-8a46-f48f62c4c1da",
    96          "description": "My plan",
    97          "tags": [],
    98          "scheduled_operations": [
    99              {
   100                  "description": "My backup policy",
   101                  "enabled": true,
   102                  "trigger_id": "30411091-f206-48e9-8ef9-62be070ea217",
   103                  "trigger": {
   104                      "properties": {
   105                          "pattern": "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n",
   106                          "start_time": "2018-08-20 07:31:32"
   107                      },
   108                      "type": "time",
   109                      "id": "30411091-f206-48e9-8ef9-62be070ea217",
   110                      "name": "default"
   111                  },
   112                  "operation_definition": {
   113                      "max_backups": "20",
   114                      "provider_id": "fc4d5750-22e7-4798-8a46-f48f62c4c1da",
   115                      "plan_id": "5af626d2-19b9-4dc4-8e95-ddba008318b3"
   116                  },
   117                  "operation_type": "backup",
   118                  "id": "b70c712d-f48b-43f7-9a0f-3bab86d59149",
   119                  "name": "my-backup-policy"
   120              }
   121          ],
   122          "id": "5af626d2-19b9-4dc4-8e95-ddba008318b3",
   123          "name": "c2c-policy",
   124          "parameters": {
   125              "common": {}
   126          },
   127          "created_at": "2018-08-20T07:31:32.718435",
   128          "project_id": "91d687759aed45d28b5f6084bc2fa8ad",
   129          "resources": [
   130              {
   131                  "type": "OS::Nova::Server",
   132                  "id": "cd5955b4-44c0-4f0a-ac57-2401b89cb347",
   133                  "name": "resource1"
   134              }
   135          ]
   136      }
   137  }
   138  `
   139  
   140  var updateRequest = `
   141  {
   142    "policy" : {
   143      "name" : "c2c-policy-update",
   144      "parameters" : {
   145        "common" : {
   146        }
   147      },
   148      "scheduled_operations" : [ {
   149        "id" : "b70c712d-f48b-43f7-9a0f-3bab86d59149",
   150        "name" : "my-backup-policy",
   151        "description" : "My backup policy",
   152        "enabled" : true,
   153        "operation_definition" : {
   154          "retention_duration_days" : -1,
   155          "max_backups" : 20,
   156  		"permanent" : false
   157        },
   158        "trigger" : {
   159          "properties" : {
   160            "pattern" : "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"
   161          }
   162        }
   163      }
   164    ]
   165  }
   166  }
   167  `
   168  
   169  var updateResponse = `
   170  {
   171      "policy": {
   172          "status": "suspended",
   173          "provider_id": "fc4d5750-22e7-4798-8a46-f48f62c4c1da",
   174          "description": "My plan",
   175          "tags": [],
   176          "scheduled_operations": [
   177              {
   178                  "description": "My backup policy",
   179                  "enabled": true,
   180                  "trigger": {
   181                      "properties": {
   182                          "pattern": "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n",
   183                          "start_time": "2018-08-20 07:31:32"
   184                      }
   185                  },
   186                  "operation_definition": {
   187                      "max_backups": "20",
   188                      "provider_id": "fc4d5750-22e7-4798-8a46-f48f62c4c1da",
   189                      "plan_id": "5af626d2-19b9-4dc4-8e95-ddba008318b3",
   190                      "retention_duration_days": "-1"
   191                  },
   192                  "operation_type": "backup",
   193                  "id": "b70c712d-f48b-43f7-9a0f-3bab86d59149",
   194                  "name": "my-backup-policy"
   195              }
   196          ],
   197          "id": "5af626d2-19b9-4dc4-8e95-ddba008318b3",
   198          "user_id": null,
   199          "name": "c2c-policy-update",
   200          "parameters": {
   201              "common": {}
   202          },
   203          "created_at": "2018-08-20T07:31:32.718435",
   204          "project_id": "91d687759aed45d28b5f6084bc2fa8ad",
   205          "resources": [
   206              {
   207                  "type": "OS::Nova::Server",
   208                  "id": "cd5955b4-44c0-4f0a-ac57-2401b89cb347",
   209                  "name": "resource1"
   210              }
   211          ]
   212      }
   213  }
   214  `
   215  var listResponse = `
   216  {
   217      "policies": [
   218          {
   219              "status": "suspended",
   220              "provider_id": "fc4d5750-22e7-4798-8a46-f48f62c4c1da",
   221              "description": "My plann",
   222              "scheduled_operations": [
   223                  {
   224                      "description": "My backup policy",
   225                      "enabled": true,
   226                      "trigger_id": "831b5e69-0b75-420c-918e-9cbcb32d97f1",
   227                      "trigger": {
   228                          "properties": {
   229                              "pattern": "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"
   230                          },
   231                          "type": "time",
   232                          "id": "831b5e69-0b75-420c-918e-9cbcb32d97f1",
   233                          "name": "default"
   234                      },
   235                      "operation_definition": {
   236                          "max_backups": 5,
   237                          "provider_id": "fc4d5750-22e7-4798-8a46-f48f62c4c1da",
   238                          "plan_id": "4d1ce19b-d681-4e44-a87e-c44eb9bfc4c7"
   239                      },
   240                      "operation_type": "backup",
   241                      "id": "e7d50d4c-2f38-40a4-9f9b-c9c355a52417",
   242                      "name": "my-backupp"
   243                  }
   244              ],
   245              "id": "4d1ce19b-d681-4e44-a87e-c44eb9bfc4c7",
   246              "name": "my-plan-test1",
   247              "parameters": {
   248              "common": {}
   249          },
   250              "created_at": "2018-08-20T10:43:56.246383",
   251              "project_id": "91d687759aed45d28b5f6084bc2fa8ad",
   252              "resources": [
   253                  {
   254                      "type": "OS::Nova::Server",
   255                      "id": "9422f270-6fcf-4ba2-9319-a007f2f63a8e",
   256                      "name": "resource4"
   257                  }
   258              ]
   259          }
   260   	]
   261  }
   262  `