Skip to main content

Operations and HTTP Methods

The HTTP protocol defines a series of methods that assign semantic meaning to a request. Below you can find the spec to use the methods and when for the Sovereign European Cloud API.

  • PUT - Creates or replaces the resource at the specified URI. The request body specifies the resource to be created or updated.
  • GET - Retrieves a representation of the resource at the specified URI. The response body contains the details of the requested resource.
  • POST - Used to initiate operations that do not actually create resources such as actions.
  • DELETE - Removes the resource at the specified URI.

The effect of a specific request varies depending on the type of resource (collection or a single item). The table below summarizes common conventions adopted by most RESTful implementations. Not all of these requests may be implemented because would depend on the specific scenario.

HTTP MethodCollection URI (e.g: /compute/instances)Element URI (e.g. /compute/instances/my-vm)
PUTNot ApplicableThe Virtual Machine Resource is created or replaced with the representations contained in the body of the request
DELETENot ApplicableRemoves the Virtual Machine Resource and any nested Element Resources.
GETThe List of the Virtual Machines Members is returned in the body of the responseRetrieves the representation of the Virtual Machine Resource, which will be contained in the body of the response.
POSTNot ApplicablePerforms an action on the Element Resource. Therefore the action path should be added at the end like power-on
ResourcePUTDELETEGETPOST
/instances405 Method Not Allowed405 Method Not AllowedRetrieve all virtual machines405 Method Not Allowed
/instances/my-vmCreate or Replace the Virtual Machine my-vmRemove the virtual machine my-vmRetrieve details of my-vm virtual machine405 Method Not Allowed
/instances/my-vm/power-Off405 Method Not Allowed405 Method Not Allowed405 Method Not AllowedStop the virtual machine my-vm if makes sense
/network/vpcs/my-net/subnets/my-sub/network-interfaces405 Method Not Allowed405 Method Not AllowedRetrieve all network interfaces within network my-net in subnet my-sub405 Method Not Allowed
/network/vpcs/my-net/subnets/my-sub/network-interfaces/my-nicCreate or Replace the network Interface my-nicDelete the network interface my-nic in the subnet my-sub of network my-netRetrieve the my-nic network interface detail attached to the subnet my-sub of network my-net405 Method Not Allowed

A PUT request creates a resource or updates an existing one. The client specifies the URI for the resource. The request body contains a complete representation of the resource. If a resource with that URI already exists, it is replaced. Otherwise, a new resource is created, if this operation is supported by the server. PUT requests are applied to individual items, like a specific virtual machine, rather than to collection resources. Requests must be idempotent. If a client sends the same PUT request multiple times, the results must always be the same, meaning the same resource will be updated with the same values.