1.0.1
This commit is contained in:
231
README.md
231
README.md
@@ -19,6 +19,7 @@
|
||||
- [Способы авторизации](#способы-авторизации)
|
||||
- [Функции API](#функции-api)
|
||||
- [Cloudapi](#cloudapi)
|
||||
- [Cloudbroker](#cloudbroker)
|
||||
- [System](#system)
|
||||
|
||||
## Описание
|
||||
@@ -203,14 +204,14 @@ from dynamix_sdk import Dynamix, types
|
||||
|
||||
dx = Dynamix(...)
|
||||
|
||||
data_disk_1 = types.DiskAPIParamsNM(name='data_disk_1', size=10)
|
||||
data_disk_1 = types.DiskAPIParamsNM(name='data_disk_1', size_gb=10)
|
||||
|
||||
# /cloudapi/kvmx86/create
|
||||
new_vm_id = dx.api.cloudapi.kvmx86.create(
|
||||
rg_id=123,
|
||||
name='new_vm',
|
||||
cpu=1,
|
||||
ram=1024,
|
||||
cpu_count=1,
|
||||
ram_size_mb=1024,
|
||||
image_id=456,
|
||||
data_disks=[data_disk_1],
|
||||
)
|
||||
@@ -230,8 +231,8 @@ dx = Dynamix(...)
|
||||
new_vm_id = dx.api.cloudapi.kvmx86.create(
|
||||
rg_id=123,
|
||||
name='new_vm',
|
||||
cpu=1,
|
||||
ram=1024,
|
||||
cpu_count=1,
|
||||
ram_size_mb=1024,
|
||||
image_id=456,
|
||||
chipset=types.Chipset.Q35, # enum
|
||||
numa_affinity=types.NumaAffinity.none, # enum
|
||||
@@ -257,7 +258,7 @@ from dynamix_sdk import Dynamix
|
||||
dx = Dynamix(...)
|
||||
|
||||
# /cloudapi/compute/get
|
||||
get_result = dx.api.cloudapi.compute.get(compute_id=1)
|
||||
get_result = dx.api.cloudapi.compute.get(vm_id=1)
|
||||
|
||||
print(type(get_result)) # <class '....CloudapiComputeGetResultModel'>
|
||||
|
||||
@@ -276,7 +277,7 @@ from dynamix_sdk import Dynamix
|
||||
dx = Dynamix(...)
|
||||
|
||||
# /cloudapi/compute/get
|
||||
vm_name = dx.api.cloudapi.compute.get(compute_id=1).name
|
||||
vm_name = dx.api.cloudapi.compute.get(vm_id=1).name
|
||||
|
||||
```
|
||||
|
||||
@@ -294,7 +295,7 @@ from dynamix_sdk import Dynamix
|
||||
dx = Dynamix(...)
|
||||
|
||||
# /cloudapi/compute/get
|
||||
vm_disk1 = dx.api.cloudapi.compute.get(compute_id=1).disks[0]
|
||||
vm_disk1 = dx.api.cloudapi.compute.get(vm_id=1).disks[0]
|
||||
|
||||
print(type(vm_disk1)) # <class '....DiskAPIResultNM'>
|
||||
|
||||
@@ -313,7 +314,7 @@ from dynamix_sdk import Dynamix
|
||||
dx = Dynamix(...)
|
||||
|
||||
# /cloudapi/compute/get
|
||||
vm_disk1_id = dx.api.cloudapi.compute.get(compute_id=1).disks[0].id
|
||||
vm_disk1_id = dx.api.cloudapi.compute.get(vm_id=1).disks[0].id
|
||||
|
||||
```
|
||||
|
||||
@@ -331,7 +332,7 @@ from dynamix_sdk import Dynamix
|
||||
dx = Dynamix(...)
|
||||
|
||||
# /cloudapi/compute/get
|
||||
get_result = dx.api.cloudapi.compute.get(compute_id=1)
|
||||
get_result = dx.api.cloudapi.compute.get(vm_id=1)
|
||||
|
||||
# Поле, возвращаемое платформой
|
||||
print(type(get_result.created_timestamp)) # <class 'int'>
|
||||
@@ -375,7 +376,7 @@ from dynamix_sdk import Dynamix
|
||||
dx = Dynamix(...)
|
||||
|
||||
# /cloudapi/compute/delete
|
||||
delete_result = dx.api.cloudapi.compute.delete(compute_id=1)
|
||||
delete_result = dx.api.cloudapi.compute.delete(vm_id=1)
|
||||
|
||||
print(type(delete_result)) # <class '....CloudapiComputeDeleteResultBool'>
|
||||
print(type(delete_result.value)) # <class 'bool'>
|
||||
@@ -391,7 +392,7 @@ from dynamix_sdk import Dynamix
|
||||
dx = Dynamix(...)
|
||||
|
||||
# /cloudapi/compute/delete
|
||||
if dx.api.cloudapi.compute.delete(compute_id=1):
|
||||
if dx.api.cloudapi.compute.delete(vm_id=1):
|
||||
print('The VM has been deleted.')
|
||||
|
||||
```
|
||||
@@ -458,7 +459,7 @@ dx = Dynamix(...)
|
||||
vm_id = 1
|
||||
|
||||
try:
|
||||
get_result = dx.api.cloudapi.compute.get(compute_id=vm_id)
|
||||
get_result = dx.api.cloudapi.compute.get(vm_id=vm_id)
|
||||
except HTTPError as e:
|
||||
resp = e.response
|
||||
if resp.status_code == 404:
|
||||
@@ -491,33 +492,209 @@ except RequestException as e:
|
||||
<details><summary>account</summary>
|
||||
|
||||
- /cloudapi/account/addUser
|
||||
- /cloudapi/account/delete
|
||||
- /cloudapi/account/deleteUser
|
||||
- /cloudapi/account/disable
|
||||
- /cloudapi/account/enable
|
||||
- /cloudapi/account/get
|
||||
- /cloudapi/account/list
|
||||
- /cloudapi/account/listDeleted
|
||||
- /cloudapi/account/restore
|
||||
- /cloudapi/account/update
|
||||
- /cloudapi/account/updateUser
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>bservice</summary>
|
||||
|
||||
- /cloudapi/bservice/create
|
||||
- /cloudapi/bservice/delete
|
||||
- /cloudapi/bservice/disable
|
||||
- /cloudapi/bservice/enable
|
||||
- /cloudapi/bservice/get
|
||||
- /cloudapi/bservice/groupAdd
|
||||
- /cloudapi/bservice/groupComputeRemove
|
||||
- /cloudapi/bservice/groupGet
|
||||
- /cloudapi/bservice/groupParentAdd
|
||||
- /cloudapi/bservice/groupParentRemove
|
||||
- /cloudapi/bservice/groupRemove
|
||||
- /cloudapi/bservice/groupResize
|
||||
- /cloudapi/bservice/groupStart
|
||||
- /cloudapi/bservice/groupStop
|
||||
- /cloudapi/bservice/groupUpdate
|
||||
- /cloudapi/bservice/groupUpdateExtnet
|
||||
- /cloudapi/bservice/groupUpdateVins
|
||||
- /cloudapi/bservice/list
|
||||
- /cloudapi/bservice/listDeleted
|
||||
- /cloudapi/bservice/restore
|
||||
- /cloudapi/bservice/start
|
||||
- /cloudapi/bservice/stop
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>compute</summary>
|
||||
|
||||
- /cloudapi/compute/affinityLabelRemove
|
||||
- /cloudapi/compute/affinityLabelSet
|
||||
- /cloudapi/compute/affinityRelations
|
||||
- /cloudapi/compute/affinityRuleAdd
|
||||
- /cloudapi/compute/affinityRuleRemove
|
||||
- /cloudapi/compute/affinityRulesClear
|
||||
- /cloudapi/compute/antiAffinityRuleAdd
|
||||
- /cloudapi/compute/antiAffinityRuleRemove
|
||||
- /cloudapi/compute/antiAffinityRulesClear
|
||||
- /cloudapi/compute/cdEject
|
||||
- /cloudapi/compute/cdInsert
|
||||
- /cloudapi/compute/changeIp
|
||||
- /cloudapi/compute/clone
|
||||
- /cloudapi/compute/delete
|
||||
- /cloudapi/compute/deleteCustomFields
|
||||
- /cloudapi/compute/diskAdd
|
||||
- /cloudapi/compute/diskAttach
|
||||
- /cloudapi/compute/diskDel
|
||||
- /cloudapi/compute/diskDetach
|
||||
- /cloudapi/compute/diskResize
|
||||
- /cloudapi/compute/get
|
||||
- /cloudapi/compute/list
|
||||
- /cloudapi/compute/netAttach
|
||||
- /cloudapi/compute/netDetach
|
||||
- /cloudapi/compute/pause
|
||||
- /cloudapi/compute/pfwAdd
|
||||
- /cloudapi/compute/pfwDel
|
||||
- /cloudapi/compute/pfwList
|
||||
- /cloudapi/compute/pinToStack
|
||||
- /cloudapi/compute/reboot
|
||||
- /cloudapi/compute/redeploy
|
||||
- /cloudapi/compute/resize
|
||||
- /cloudapi/compute/resume
|
||||
- /cloudapi/compute/setCustomFields
|
||||
- /cloudapi/compute/snapshotCreate
|
||||
- /cloudapi/compute/snapshotList
|
||||
- /cloudapi/compute/snapshotRollback
|
||||
- /cloudapi/compute/start
|
||||
- /cloudapi/compute/stop
|
||||
- /cloudapi/compute/tagAdd
|
||||
- /cloudapi/compute/tagRemove
|
||||
- /cloudapi/compute/unpinFromStack
|
||||
- /cloudapi/compute/update
|
||||
- /cloudapi/compute/userGrant
|
||||
- /cloudapi/compute/userList
|
||||
- /cloudapi/compute/userRevoke
|
||||
- /cloudapi/compute/userUpdate
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>disks</summary>
|
||||
|
||||
- /cloudapi/disks/create
|
||||
- /cloudapi/disks/delete
|
||||
- /cloudapi/disks/deleteDisks
|
||||
- /cloudapi/disks/get
|
||||
- /cloudapi/disks/limitIO
|
||||
- /cloudapi/disks/list
|
||||
- /cloudapi/disks/listDeleted
|
||||
- /cloudapi/disks/listTypes
|
||||
- /cloudapi/disks/listUnattached
|
||||
- /cloudapi/disks/rename
|
||||
- /cloudapi/disks/resize2
|
||||
- /cloudapi/disks/restore
|
||||
- /cloudapi/disks/share
|
||||
- /cloudapi/disks/snapshotDelete
|
||||
- /cloudapi/disks/snapshotRollback
|
||||
- /cloudapi/disks/unshare
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>extnet</summary>
|
||||
|
||||
- /cloudapi/extnet/get
|
||||
- /cloudapi/extnet/getDefault
|
||||
- /cloudapi/extnet/list
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>flipgroup</summary>
|
||||
|
||||
- /cloudapi/flipgroup/computeAdd
|
||||
- /cloudapi/flipgroup/computeRemove
|
||||
- /cloudapi/flipgroup/create
|
||||
- /cloudapi/flipgroup/delete
|
||||
- /cloudapi/flipgroup/edit
|
||||
- /cloudapi/flipgroup/get
|
||||
- /cloudapi/flipgroup/list
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>image</summary>
|
||||
|
||||
- /cloudapi/image/create
|
||||
- /cloudapi/image/createVirtual
|
||||
- /cloudapi/image/delete
|
||||
- /cloudapi/image/get
|
||||
- /cloudapi/image/link
|
||||
- /cloudapi/image/list
|
||||
- /cloudapi/image/rename
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>kvmx86</summary>
|
||||
|
||||
- /cloudapi/kvmx86/create
|
||||
- /cloudapi/kvmx86/createBlank
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>lb</summary>
|
||||
|
||||
- /cloudapi/lb/backendCreate
|
||||
- /cloudapi/lb/backendDelete
|
||||
- /cloudapi/lb/backendServerAdd
|
||||
- /cloudapi/lb/backendServerDelete
|
||||
- /cloudapi/lb/backendServerUpdate
|
||||
- /cloudapi/lb/backendUpdate
|
||||
- /cloudapi/lb/create
|
||||
- /cloudapi/lb/delete
|
||||
- /cloudapi/lb/get
|
||||
- /cloudapi/lb/list
|
||||
- /cloudapi/lb/listDeleted
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>locations</summary>
|
||||
|
||||
- /cloudapi/locations/getUrl
|
||||
- /cloudapi/locations/list
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>rg</summary>
|
||||
|
||||
- /cloudapi/rg/accessGrant
|
||||
- /cloudapi/rg/accessRevoke
|
||||
- /cloudapi/rg/create
|
||||
- /cloudapi/rg/delete
|
||||
- /cloudapi/rg/disable
|
||||
- /cloudapi/rg/enable
|
||||
- /cloudapi/rg/get
|
||||
- /cloudapi/rg/list
|
||||
- /cloudapi/rg/removeDefNet
|
||||
- /cloudapi/rg/restore
|
||||
- /cloudapi/rg/setDefNet
|
||||
- /cloudapi/rg/update
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>stack</summary>
|
||||
|
||||
- /cloudapi/stack/get
|
||||
- /cloudapi/stack/list
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>tasks</summary>
|
||||
|
||||
- /cloudapi/tasks/get
|
||||
- /cloudapi/tasks/list
|
||||
|
||||
</details>
|
||||
|
||||
@@ -527,6 +704,34 @@ except RequestException as e:
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>vins</summary>
|
||||
|
||||
- /cloudapi/vins/createInAccount
|
||||
- /cloudapi/vins/createInRG
|
||||
- /cloudapi/vins/delete
|
||||
- /cloudapi/vins/get
|
||||
- /cloudapi/vins/ipList
|
||||
- /cloudapi/vins/ipRelease
|
||||
- /cloudapi/vins/ipReserve
|
||||
- /cloudapi/vins/list
|
||||
- /cloudapi/vins/listDeleted
|
||||
- /cloudapi/vins/restore
|
||||
- /cloudapi/vins/staticRouteAdd
|
||||
- /cloudapi/vins/staticRouteDel
|
||||
- /cloudapi/vins/staticRouteList
|
||||
- /cloudapi/vins/vnfdevRedeploy
|
||||
- /cloudapi/vins/vnfdevRestart
|
||||
|
||||
</details>
|
||||
|
||||
#### Cloudbroker
|
||||
|
||||
<details><summary>account</summary>
|
||||
|
||||
- /cloudbroker/account/create
|
||||
|
||||
</details>
|
||||
|
||||
#### System
|
||||
|
||||
<details><summary>usermanager</summary>
|
||||
|
||||
Reference in New Issue
Block a user