|
| 1 | +name: Volumes |
| 2 | +description: > |
| 3 | + Volume endpoints provide a means of managing the Volume objects on your account. |
| 4 | +endpoints: |
| 5 | + /volumes: |
| 6 | + authenticated: true |
| 7 | + description: > |
| 8 | + Manage your Block Storage Volumes. |
| 9 | + methods: |
| 10 | + GET: |
| 11 | + response: volume |
| 12 | + paginationKey: volumes |
| 13 | + oauth: volumes:view |
| 14 | + description: > |
| 15 | + Returns a list of volumes. |
| 16 | + examples: |
| 17 | + curl: | |
| 18 | + curl -H "Authorization: Bearer $TOKEN" \ |
| 19 | + https://$api_root/$version/volumes |
| 20 | + python: | |
| 21 | + volumes = client.linode.get_volumes() |
| 22 | + POST: |
| 23 | + oauth: volumes:create |
| 24 | + description: > |
| 25 | + Create a new Block Storage Volume |
| 26 | + params: |
| 27 | + label: |
| 28 | + description: > |
| 29 | + A unique label to identify your new volume with. |
| 30 | + type: String |
| 31 | + value: a_fancy_new_volume |
| 32 | + region: |
| 33 | + description: > |
| 34 | + Which region the new volume should be created in. |
| 35 | + type: String |
| 36 | + value: us-east-1a |
| 37 | + size: |
| 38 | + optional: true |
| 39 | + description: > |
| 40 | + The size in GiBs that you wish to make your new volume. |
| 41 | + Defaults to 20 GiB, can be as large as 1024 GiB (1 TiB). |
| 42 | + type: Integer |
| 43 | + linode_id: |
| 44 | + optional: true |
| 45 | + description: > |
| 46 | + An id to a Linode you'd like this volume to be attached to after |
| 47 | + creation. Requires an additional scope of `linode:modify` and you |
| 48 | + must have permission to access that given Linode. |
| 49 | + type: Integer |
| 50 | + config_id: |
| 51 | + optional: true |
| 52 | + description: > |
| 53 | + An id to a Linode configuration profile to used when attaching to |
| 54 | + a Linode that has more than one configuration profile. |
| 55 | + type: Integer |
| 56 | + examples: |
| 57 | + curl: | |
| 58 | + curl -H "Content-Type: application/json" \ |
| 59 | + -H "Authorization: token $TOKEN" \ |
| 60 | + -X POST -d '{ |
| 61 | + "label": "a_fancy_new_volume", |
| 62 | + "region": "us-east-1a", |
| 63 | + "size": "100" |
| 64 | + }' |
| 65 | + https://$api_root/$version/volumes |
| 66 | + python: | |
| 67 | + import linode |
| 68 | + TODO |
| 69 | + /volumes/$id: |
| 70 | + type: resource |
| 71 | + authenticated: true |
| 72 | + description: > |
| 73 | + Manage an individual Block Storage Volume. |
| 74 | + methods: |
| 75 | + GET: |
| 76 | + response: volume |
| 77 | + oauth: volumes:view |
| 78 | + description: > |
| 79 | + Returns information about this Volume. |
| 80 | + examples: |
| 81 | + curl: | |
| 82 | + curl -H "Authorization: Bearer $TOKEN" \ |
| 83 | + https://$api_root/$version/volumes/$volume_id |
| 84 | + python: | |
| 85 | + v = linode.Volume(client, 123) |
| 86 | + DELETE: |
| 87 | + oauth: volumes:delete |
| 88 | + description: > |
| 89 | + Removes a volume from your account. |
| 90 | + examples: |
| 91 | + curl: | |
| 92 | + curl -H "Authorization: Bearer $TOKEN" \ |
| 93 | + -X DELETE \ |
| 94 | + https://$api_root/$version/volumes/$volume_id |
| 95 | + python: | |
| 96 | + v = linode.Volume(client, 123) |
| 97 | + v.delete() |
| 98 | + POST: |
| 99 | + oauth: volumes:create |
| 100 | + description: > |
| 101 | + Create a new Block Storage Volume |
| 102 | + params: |
| 103 | + label: |
| 104 | + description: > |
| 105 | + A unique label to identify your new volume with. |
| 106 | + type: String |
| 107 | + value: a_fancy_new_volume |
| 108 | + region: |
| 109 | + description: > |
| 110 | + Which region the new volume should be created in. |
| 111 | + type: String |
| 112 | + value: us-east-1a |
| 113 | + size: |
| 114 | + optional: true |
| 115 | + description: > |
| 116 | + The size in GiBs that you wish to make your new volume. |
| 117 | + Defaults to 20 GiB, can be as large as 1024 GiB (1 TiB). |
| 118 | + type: Integer |
| 119 | + linode_id: |
| 120 | + optional: true |
| 121 | + description: > |
| 122 | + An id to a Linode you'd like this volume to be attached to after |
| 123 | + creation. Requires an additional scope of `linode:modify` and you |
| 124 | + must have permission to access that given Linode. |
| 125 | + type: Integer |
| 126 | + config_id: |
| 127 | + optional: true |
| 128 | + description: > |
| 129 | + An id to a Linode configuration profile to used when attaching to |
| 130 | + a Linode that has more than one configuration profile. |
| 131 | + type: Integer |
| 132 | + examples: |
| 133 | + curl: | |
| 134 | + curl -H "Content-Type: application/json" \ |
| 135 | + -H "Authorization: token $TOKEN" \ |
| 136 | + -X POST -d '{ |
| 137 | + "label": "a_fancy_new_volume", |
| 138 | + "region": "us-east-1a", |
| 139 | + "size": "100" |
| 140 | + }' |
| 141 | + https://$api_root/$version/volumes |
| 142 | + python: | |
| 143 | + import linode |
| 144 | + TODO |
| 145 | + /volumes/$id/clone: |
| 146 | + type: resource |
| 147 | + authenticated: true |
| 148 | + description: > |
| 149 | + Clone a Block Storage Volume. |
| 150 | + methods: |
| 151 | + POST: |
| 152 | + oauth: volumes:create |
| 153 | + description: > |
| 154 | + Clone a volume |
| 155 | + params: |
| 156 | + label: |
| 157 | + description: > |
| 158 | + A unique label to identify your new clone volume. |
| 159 | + type: String |
| 160 | + examples: |
| 161 | + curl: | |
| 162 | + curl -H "Authorization: Bearer $TOKEN" \ |
| 163 | + -X POST -d '{ |
| 164 | + "label": "Clone Label" |
| 165 | + }' \ |
| 166 | + https://$api_root/$version/volumes/$volume_id/clone |
| 167 | + python: | |
| 168 | + import linode |
| 169 | + TODO |
| 170 | + /volumes/$id/attach: |
| 171 | + authenticated: true |
| 172 | + description: > |
| 173 | + Attach a Block Storage Volume to a Linode. |
| 174 | + methods: |
| 175 | + POST: |
| 176 | + oauth: volumes:modify |
| 177 | + description: > |
| 178 | + Attach a Block Storage Volume to a Linode. |
| 179 | + params: |
| 180 | + linode_id: |
| 181 | + description: > |
| 182 | + An id to a Linode you'd like this volume to be attached to. |
| 183 | + Requires an additional scope of `linode:modify` and you |
| 184 | + must have permission to access that given Linode. |
| 185 | + type: Integer |
| 186 | + config_id: |
| 187 | + optional: true |
| 188 | + description: > |
| 189 | + An id to a Linode configuration profile to used when attaching to |
| 190 | + a Linode that has more than one configuration profile. |
| 191 | + type: Integer |
| 192 | + examples: |
| 193 | + curl: | |
| 194 | + curl -H "Content-Type: application/json" \ |
| 195 | + -H "Authorization: token $TOKEN" \ |
| 196 | + -X POST -d '{ |
| 197 | + "linode_id": 1234 |
| 198 | + }' |
| 199 | + https://$api_root/$version/volumes/$volume_id/attach |
| 200 | + python: | |
| 201 | + import linode |
| 202 | + TODO |
| 203 | + /volumes/$id/detach: |
| 204 | + type: resource |
| 205 | + authenticated: true |
| 206 | + description: > |
| 207 | + Detach a Block Storage Volume from a Linode. |
| 208 | + methods: |
| 209 | + POST: |
| 210 | + oauth: volumes:modify,linodes:modify |
| 211 | + description: > |
| 212 | + Detach a Block Storage Volume from a Linode. |
| 213 | + examples: |
| 214 | + curl: | |
| 215 | + curl -H "Authorization: Bearer $TOKEN" \ |
| 216 | + -X POST \ |
| 217 | + https://$api_root/$version/volumes/$volume_id/detach |
| 218 | + python: | |
| 219 | + v = linode.Volume(client, 123) |
| 220 | + v.detach() |
0 commit comments