ECS
The SDK interfaces based on the ECS v1 API are as follows. For details about the invoking methods, see the sample codes.
| Interface | Method | API |
|---|---|---|
| CloudServers | GetJobResult(client *gophercloud.ServiceClient, id string) | GET /v1/{project_id}/jobs/{job_id} |
| GetServerRecoveryStatus(client *gophercloud.ServiceClient, serverID string) | GET /v1/{project_id}/cloudservers/{server_id}/autorecovery | |
| ConfigServerRecovery(client *gophercloud.ServiceClient, serverID string, opts string) | PUT /v1/{project_id}/cloudservers/{server_id}/autorecovery | |
| Get(client *gophercloud.ServiceClient, serverID string) | GET /v1/{project_id}/cloudservers/{server_id} | |
| ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) | GET /v1/{project_id}/cloudservers/detail{?flavor,name,status,limit,offset,not-tags,reservation_id,enterprise_project_id,tags} | |
| BatchStart(client *gophercloud.ServiceClient, opts BatchStartOpts) | POST /v1/{project_id}/cloudservers/action | |
| BatchReboot(client *gophercloud.ServiceClient, opts BatchRebootOpts) | POST /v1/{project_id}/cloudservers/action | |
| BatchStop(client *gophercloud.ServiceClient, opts BatchStopOpts) | POST /v1/{project_id}/cloudservers/action | |
| BatchUpdate(client *gophercloud.ServiceClient, opts BatchUpdateOpts) | PUT /v1/{project_id}/cloudservers/server-name | |
| Tags | BatchCreateServerTags(client *gophercloud.ServiceClient, serverID string, opts BatchTagCreateOptsBuilder) | POST /v1/{project_id}/cloudservers/{server_id}/tags/action |
| BatchDeleteServerTags(client *gophercloud.ServiceClient, serverID string, opts BatchTagDeleteOptsBuilder) | POST /v1/{project_id}/cloudservers/{server_id}/tags/action | |
| ListProjectTags(client *gophercloud.ServiceClient) | GET /v1/{project_id}/cloudservers/tags | |
| ListServerTags(client *gophercloud.ServiceClient, serverID string) | GET /v1/{project_id}/cloudservers/{server_id}/tags |
The SDK interfaces based on the ECS v2 API are as follows. For details about the invoking methods, see the sample codes.
| Interface | Method | API |
|---|---|---|
| CloudServers | ReinstallOS(client *gophercloud.ServiceClient, serverID string, opts ReinstallOptsBuilder) | POST /v2/{project_id}/cloudservers/{server_id}/reinstallos |
The SDK interfaces based on the Nova v2 API are as follows. For details about the invoking methods, see the sample codes.
| Interface | Method | API |
|---|---|---|
| Servers | Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) | POST /v2/{project_id}/servers |
| List(client *gophercloud.ServiceClient, opts ListOptsBuilder) | GET /v2/{project_id}/servers/detail | |
| Get(client *gophercloud.ServiceClient, id string) | GET /v2/{project_id}/servers/{server_id} | |
| Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) | PUT /v2/{project_id}/servers/{server_id} | |
| Delete(client *gophercloud.ServiceClient, id string) | DELETE /v2/{project_id}/servers/{server_id} | |
| Resize(client *gophercloud.ServiceClient, id string, opts ResizeOptsBuilder) | POST /v2/{project_id}/servers/{server_id}/action | |
| ConfirmResize(client *gophercloud.ServiceClient, id string) | POST /v2/{project_id}/servers/{server_id}/action | |
| RevertResize(client *gophercloud.ServiceClient, id string) | POST /v2/{project_id}/servers/{server_id}/action | |
| Start(client *gophercloud.ServiceClient, id string) | POST /v2/{project_id}/servers/{server_id}/action | |
| Stop(client *gophercloud.ServiceClient, id string) | POST /v2/{project_id}/servers/{server_id}/action | |
| Create(client *gophercloud.ServiceClient, opts servers.CreateOptsBuilder) | POST /v2/{project_id}/os-volumes_boot | |
| Reboot(client *gophercloud.ServiceClient, id string, opts RebootOptsBuilder) | POST /v2/{project_id}/servers/{server_id}/action | |
| ResetMetadata(client *gophercloud.ServiceClient, id string, opts ResetMetadataOptsBuilder) | PUT /v2/{project_id}/servers/{server_id}/metadata | |
| Metadata(client *gophercloud.ServiceClient, id string) | GET /v2/{project_id}/servers/{server_id}/metadata | |
| UpdateMetadata(client *gophercloud.ServiceClient, id string, opts UpdateMetadataOptsBuilder) | POST /v2/{project_id}/servers/{server_id}/metadata | |
| Metadatum(client *gophercloud.ServiceClient, id, key string) | GET /v2/{project_id}/servers/{server_id}/metadata/{key} | |
| DeleteMetadatum(client *gophercloud.ServiceClient, id, key string) | DELETE /v2/{project_id}/servers/{server_id}/metadata/{key} | |
| ListInstanceActions(client *gophercloud.ServiceClient, serverID string) | GET /v2/{project_id}/servers/{server_id}/os-instance-actions | |
| GetInstanceActions(client *gophercloud.ServiceClient, serverID string, RequestID string) | GET /v2/{project_id}/servers/{server_id}/os-instance-actions/{request_id} | |
| GetConsoleLog(client *gophercloud.ServiceClient, id string, length string) | POST /v2/{project_id}/servers/{server_id}/action | |
| Interface | List(client *gophercloud.ServiceClient, serverID string) | GET /v2/{project_id}/servers/{server_id}/os-interface |
| Get(client *gophercloud.ServiceClient, serverID, portID string) | GET /v2/{project_id}/servers/{server_id}/os-interface/{id} | |
| Create(client *gophercloud.ServiceClient, serverID string, opts CreateOptsBuilder) | POST /v2/{project_id}/servers/{server_id}/os-interface | |
| Delete(client *gophercloud.ServiceClient, serverID, portID string) | DELETE /v2/{project_id}/servers/{server_id}/os-interface/{id} | |
| Flavors | ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) | GET /v2/{project_id}/flavors/detail |
| Get(client *gophercloud.ServiceClient, id string) | GET /v2/{project_id}/flavors/{flavor_id} | |
| Images | ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) | GET /v2/{project_id}/images/detail |
| Delete(client *gophercloud.ServiceClient, id string) | DELETE /v2/{project_id}/images/{image_id} | |
| Get(client *gophercloud.ServiceClient, id string) | GET /v2/{project_id}/images/{image_id} | |
| Key Pairs | Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) | POST /v2/{project_id}/os-keypairs |
| Get(client *gophercloud.ServiceClient, name string) | GET /v2/{project_id}/os-keypairs/{keypair_name} | |
| Delete(client *gophercloud.ServiceClient, name string) | DELETE /v2/{project_id}/os-keypairs/{keypair_name} | |
| List(client *gophercloud.ServiceClient) | GET /v2/{project_id}/os-keypairs | |
| Quotas | GetLimits(client *gophercloud.ServiceClient) | GET /v2/{project_id}/limits |
| Get(client *gophercloud.ServiceClient, tenantID string) | GET /v2/{project_id}/os-quota-sets/{project_id} | |
| GetDefault(client *gophercloud.ServiceClient, ProjectID string) | GET /v2/{project_id}/os-quota-sets/{project_id}/defaults | |
| Volumeattach | List(client *gophercloud.ServiceClient, serverID string) | GET /v2/{project_id}/servers/{server_id}/os-volume_attachments |
| Create(client *gophercloud.ServiceClient, serverID string, opts CreateOptsBuilder) | POST /v2/{project_id}/servers/{server_id}/os-volume_attachments | |
| Get(client *gophercloud.ServiceClient, serverID, attachmentID string) | GET /v2/{project_id}/servers/{server_id}/os-volume_attachments/{volume_id} | |
| Delete(client *gophercloud.ServiceClient, serverID, attachmentID string) | DELETE /v2/{project_id}/servers/{server_id}/os-volume_attachments/{volume_id} | |
| DeleteWithFlag(client *gophercloud.ServiceClient, serverID, volumeID string, deleteFlag int) | DELETE /v2/{project_id}/servers/{server_id}/os-volume_attachments/{volume_id}?delete_flag={delete_flag} |
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.