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

     1  package testing
     2  
     3  const (
     4  	backupEndpoint     = "/checkpoint_items"
     5  	checkpoint_item_id = "7b99acfd-18c3-4f26-9d39-b4ebd2ea3e12"
     6  )
     7  
     8  var getResponse = `
     9  {
    10      "checkpoint_item": {
    11          "status": "available",
    12          "backup_data": {
    13              "eip": "80.158.17.102",
    14              "cloudservicetype": "QEMU",
    15              "ram": 8192,
    16              "vcpus": 4,
    17              "__openstack_region_name": "",
    18              "private_ip": "192.168.0.209",
    19              "disk": 0,
    20              "imagetype": "gold"
    21          },
    22          "name": "backup-c2c",
    23          "resource_id": "f8ddc472-cf00-4384-851e-5f2a68c33762",
    24          "created_at": "2018-08-14T07:53:15.663766",
    25          "checkpoint_id": "2eefe592-8424-4778-8d0d-962c8a5dd6a4",
    26          "updated_at": "2018-08-17T04:33:58.025327",
    27          "tags": [],
    28          "extend_info": {
    29              "auto_trigger": false,
    30              "space_saving_ratio": 2,
    31              "resource_name": "ecs-ggao",
    32              "fail_reason": "",
    33              "resource_az": "eu-de-02",
    34              "image_type": "backup",
    35              "finished_at": "2018-08-14T08:31:08.720800",
    36              "average_speed": 19,
    37              "copy_from": null,
    38              "volume_backups": [
    39                  {
    40                      "status": "available",
    41                      "space_saving_ratio": 1,
    42                      "name": "manualbk_ee6d_ecs-ggao",
    43                      "bootable": true,
    44                      "average_speed": 16,
    45                      "source_volume_size": 24,
    46                      "source_volume_id": "c14856d0-07e8-453b-a442-444086cbad04",
    47                      "incremental": false,
    48                      "snapshot_id": "c18513c3-1ab9-46e3-979b-7cad7c52e516",
    49                      "source_volume_name": "ecs-ggao",
    50                      "image_type": "backup",
    51                      "id": "2422bc5e-4cde-4420-964d-30b7347042a7",
    52                      "size": 47960
    53                  },
    54                  {
    55                      "status": "available",
    56                      "space_saving_ratio": 3,
    57                      "name": "manualbk_ee6d_ggao-repo-disk",
    58                      "bootable": false,
    59                      "average_speed": 22,
    60                      "source_volume_size": 100,
    61                      "source_volume_id": "313b9a39-cdc7-4413-8a1b-1888340bdc03",
    62                      "incremental": false,
    63                      "snapshot_id": "5c9dd5d5-fc70-42a2-8d58-c9e009ccf418",
    64                      "source_volume_name": "ggao-repo-disk",
    65                      "image_type": "backup",
    66                      "id": "533e5e53-4332-48cd-b920-ae4fd9b3ba94",
    67                      "size": 98224
    68                  }
    69              ],
    70              "fail_code": {},
    71              "copy_status": "na",
    72              "incremental": false,
    73              "taskid": "1afcab08-9f97-11e8-9526-286ed488ca8c",
    74              "hypervisor_type": "QEMU",
    75              "supported_restore_mode": "backup",
    76              "progress": 100,
    77              "support_lld": true,
    78              "fail_op": "",
    79              "resource_type": "OS::Nova::Server",
    80              "size": 146184
    81          },
    82          "id": "7b99acfd-18c3-4f26-9d39-b4ebd2ea3e12",
    83          "resource_type": "OS::Nova::Server",
    84          "description": "backup des"
    85      }
    86  }
    87  		`
    88  
    89  var createRequest = `{
    90      "protect" : {
    91      "backup_name" : "c2c-backup",
    92      "description" : "mybackup"
    93    }
    94  }`
    95  
    96  var createResponse = `{
    97      "checkpoint": {
    98          "status": "protecting",
    99          "created_at": "2018-08-17T07:58:56.492307",
   100          "id": "92dba83d-cc6f-4883-a20d-de6934510b7e",
   101          "resource_graph": null,
   102          "project_id": "91d687759aed45d28b5f6084bc2fa8ad",
   103          "protection_plan": {
   104              "id": "fake_b94f8b46-b0a1-485a-ad5b-9f8876b85495",
   105              "resources": [
   106                  {
   107                      "extra_info": "{}",
   108                      "type": "OS::Nova::Server",
   109                      "id": "f8ddc472-cf00-4384-851e-5f2a68c33762",
   110                      "name": "ecs-ggao"
   111                  }
   112              ],
   113              "name": "server protect plan for f8ddc472-cf00-4384-851e-5f2a68c33762"
   114          }
   115      }
   116  }`
   117  
   118  var queryRequest = `{
   119    "check_protectable" : [ {
   120      "resource_id" : "069e678a-f1d1-4a38-880b-459bde82fcc6",
   121      "resource_type" : "OS::Nova::Server"
   122    } ]
   123  }`
   124  
   125  var queryResponse = `{
   126      "protectable": [
   127          {
   128              "result": true,
   129              "resource_type": "OS::Nova::Server",
   130              "resource_id": "069e678a-f1d1-4a38-880b-459bde82fcc6"
   131          }
   132      ]
   133  }`
   134  
   135  var listResponse = `
   136  {
   137      "checkpoint_items": [
   138   {
   139              "status": "available",
   140              "backup_data": {
   141                  "eip": "80.158.17.102",
   142                  "cloudservicetype": "QEMU",
   143                  "ram": 8192,
   144                  "vcpus": 4,
   145                  "__openstack_region_name": "",
   146                  "private_ip": "192.168.0.209",
   147                  "disk": 0,
   148                  "imagetype": "gold"
   149              },
   150              "name": "backup-c2c",
   151              "resource_id": "f8ddc472-cf00-4384-851e-5f2a68c33762",
   152              "checkpoint_id": "2eefe592-8424-4778-8d0d-962c8a5dd6a4",
   153              "extend_info": {
   154                  "auto_trigger": false,
   155                  "space_saving_ratio": 2,
   156                  "resource_name": "ecs-ggao",
   157                  "fail_reason": "",
   158                  "resource_az": "eu-de-02",
   159                  "image_type": "backup",
   160                  "finished_at": "2018-08-14T08:31:08.720800",
   161                  "average_speed": 19,
   162                  "copy_status": "na",
   163                  "incremental": false,
   164                  "taskid": "1afcab08-9f97-11e8-9526-286ed488ca8c",
   165                  "hypervisor_type": "QEMU",
   166                  "supported_restore_mode": "backup",
   167                  "progress": 100,
   168                  "support_lld": true,
   169                  "fail_op": "",
   170                  "resource_type": "OS::Nova::Server",
   171                  "size": 146184
   172              },
   173              "id": "7b99acfd-18c3-4f26-9d39-b4ebd2ea3e12",
   174              "resource_type": "OS::Nova::Server",
   175              "description": "backup des"
   176          }
   177  ]
   178  }
   179  `