github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/vbs/v2/policies/testing/fixtures.go (about) 1 package testing 2 3 import "github.com/huaweicloud/golangsdk/openstack/vbs/v2/policies" 4 5 const Output = ` 6 { 7 "backup_policy_name": "Test_Policy", 8 "scheduled_policy": { 9 "frequency": 1, 10 "remain_first_backup_of_curMonth": "Y", 11 "rentention_num": 10, 12 "start_time": "12:00", 13 "status": "ON" 14 }, 15 "tags": [ 16 { 17 "key": "key", 18 "value": "value" 19 } 20 ] 21 }` 22 23 const UpdateOutput = ` 24 { 25 "backup_policy_name": "Test_02", 26 "scheduled_policy" : { 27 "remain_first_backup_of_curMonth" : "Y", 28 "rentention_num" : 10, 29 "frequency" : 1, 30 "start_time" : "10:00", 31 "status" : "ON" 32 } 33 }` 34 35 const ListOutput = `{ 36 "backup_policies" : [ 37 { 38 "backup_policy_id" : "ed8b9f73-4415-494d-a54e-5f3373bc353d", 39 "backup_policy_name": "plan01", 40 "scheduled_policy" : { 41 "remain_first_backup_of_curMonth" : "Y", 42 "rentention_num" : 10, 43 "frequency" : 1, 44 "start_time" : "12:00", 45 "status" : "ON" 46 }, 47 "policy_resource_count": 0 48 }, 49 { 50 "backup_policy_id" : "8dd473c9-5a80-4ad5-862e-492c9af2b6bd", 51 "backup_policy_name": "plan02", 52 "scheduled_policy" : { 53 "remain_first_backup_of_curMonth" : "Y", 54 "rentention_num" : 10, 55 "frequency" : 1, 56 "start_time" : "14:00", 57 "status" : "ON" 58 }, 59 "policy_resource_count": 10 60 }] 61 }` 62 63 const AssociateOutput = ` 64 { 65 "success_resources": [ 66 { 67 "resource_id": "0f187b65-8d0e-4fc0-9096-3b55d330531e", 68 "os_vol_host_attr": "pod01.eu-de-01", 69 "availability_zone": "eu-de-01", 70 "resource_type": "volume" 71 } 72 ], 73 "fail_resources": [ ] 74 }` 75 76 const DisssociateOutput = ` 77 { 78 "success_resources": [ 79 { 80 "resource_id": "0f187b65-8d0e-4fc0-9096-3b55d330531e" 81 } 82 ], 83 "fail_resources": [ ] 84 }` 85 86 var ListPolicies = []policies.Policy{ 87 {ID: "ed8b9f73-4415-494d-a54e-5f3373bc353d", 88 Name: "plan01", 89 ScheduledPolicy: policies.ScheduledPolicy{ 90 Frequency: 1, 91 RemainFirstBackup: "Y", 92 RententionNum: 10, 93 StartTime: "12:00", 94 Status: "ON", 95 }, 96 ResourceCount: 0, 97 }, 98 {ID: "8dd473c9-5a80-4ad5-862e-492c9af2b6bd", 99 Name: "plan02", 100 ScheduledPolicy: policies.ScheduledPolicy{ 101 Frequency: 1, 102 RemainFirstBackup: "Y", 103 RententionNum: 10, 104 StartTime: "14:00", 105 Status: "ON", 106 }, 107 ResourceCount: 10, 108 }, 109 } 110 111 var Update = &policies.Policy{ 112 Name: "Test_02", 113 ScheduledPolicy: policies.ScheduledPolicy{ 114 Frequency: 1, 115 RemainFirstBackup: "Y", 116 RententionNum: 10, 117 StartTime: "10:00", 118 Status: "ON", 119 }, 120 } 121 122 var Expected = &policies.Policy{ 123 Name: "Test_Policy", 124 ScheduledPolicy: policies.ScheduledPolicy{ 125 Frequency: 1, 126 RemainFirstBackup: "Y", 127 RententionNum: 10, 128 StartTime: "12:00", 129 Status: "ON", 130 }, 131 } 132 133 var Associate = &policies.ResultResources{ 134 SuccessResources: []policies.Resource{ 135 {ResourceID: "0f187b65-8d0e-4fc0-9096-3b55d330531e", 136 ResourceType: "volume", 137 Pod: "pod01.eu-de-01", 138 AvailabilityZone: "eu-de-01", 139 }, 140 }, 141 FailResources: []policies.Resource{}, 142 } 143 144 var Disassociate = &policies.ResultResources{ 145 SuccessResources: []policies.Resource{ 146 {ResourceID: "0f187b65-8d0e-4fc0-9096-3b55d330531e"}, 147 }, 148 FailResources: []policies.Resource{}, 149 }