URL Cheat Sheet for VM Roles [SPFSDK][VMROLE]

 

Applies To: Windows Azure Pack

The Service Management API is an HTTP REST-based service. To use the features related to VM roles you work with a specific URL structure. This topic provides a guide to all of the URLs that are available when working with VM roles. It describes the types of objects each URL works with, and if any, the actions available to those objects through the URL.

Important

Anytime you use a URL with the gallery and cloud services, you must append the api-version=2013-03 query string. The query string always starts with the ? character after the URL. For example, to access the cloud service named TestService, you would use this URL: https://server-name:server-port/subscription-id/CloudServices/TestService?api-version=2013-03.

Common URL placeholders

Throughout this programming guide URLs will be used that need information about your infrastructure, such as server names or names of objects that have been previously created. The following list describes all of the placeholders used.

Placeholder Name

Description

server-name

The server name of the Service Management API server.

server-port

The authentication port of the Service Management API server.

subscription-id

The name of the cloud service hosting the VM role.

cloudservice-name

The name of the cloud service hosting the VM role.

vmrole-name

The name of the VM role.

vm-id

The identifier of a virtual machine.

disk-id

The identifier of a virtual hard disk.

nic-id

The identifier of a virtual network adapter.

  • subscription-id/Gallery/GalleryItems
    HTTP operations supported: GET.

    Provides access to the gallery items available to the specified subscription. The items returned are not limited to VM roles, but are all gallery items regardless of type.

  • subscription-id/Gallery/GalleryItems(publisher,name,version)
    HTTP operations supported: GET.

    Provides access to a specific gallery item available to the specified subscription.

  • subscription-id/Gallery/GalleryItems/$/MicrosoftCompute.VMRoleGalleryItem
    HTTP operations supported: GET.

    Provides access to the VM role gallery items available to the specified subscription.

    For examples using this URL, see:

  • subscription-id/Gallery/GalleryItems/$/MicrosoftCompute.VMRoleGalleryItem(publisher,name,version)
    HTTP operations supported: GET.

    Provides access to a specific VM role gallery item available to the specified subscription.

    For examples using this URL, see:

Cloud services

  • subscription-id/CloudServices
    HTTP operations supported: GET, POST.

    Provides access to the cloud services that have been created for the specified subscription. A cloud service can be created by using the POST operation.

    For examples using this URL, see:

  • subscription-id/CloudServices/cloudservice-name
    HTTP operations supported: GET, PUT, PATCH, DELETE.

    Provides access to a specific cloud service created by the specified subscription. The cloud service identified by the URL can be updated and deleted.

  • subscription-id/CloudServices/cloudservice-name/Resources
    HTTP operations supported: GET.

    Provides access to the resource providers available to the specified cloud service.

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute
    HTTP operations supported: GET.

    Provides access to the MicrosoftCompute resource provider which hosts VM roles.

VM roles

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles
    HTTP operations supported: GET, POST.

    Provides access to the VM role instances that have been created. This URL is also used to submit a new VM role instance to the server.

    For examples using this URL, see:

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name
    HTTP operations supported: GET, PUT, PATCH, DELETE.

    Provides access to a specific VM role by name. This URL is used to delete and update a VM role.

    For examples using this URL, see:

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/Scale
    HTTP operations supported: POST.

    Initiates the Scale action on the specified VM role.

    For examples using this URL, see:

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/Repair
    HTTP operations supported: POST.

    Initiates the Repair action on the specified VM role.

    For examples using this URL, see:

Virtual machines

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/VMs
    HTTP operations supported: GET.

    Provides access to the virtual machines hosted in a specific VM role.

    For examples using this URL, see:

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/VMs/vm-id
    HTTP operations supported: GET, DELETE.

    Provides access to the virtual machine by identifier that is hosted in a specific VM role. This URL can be used to delete a specific virtual machine from a VM role.

    For examples using this URL, see:

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/VMs/vm-id/Stop
    HTTP operations supported: POST.

    Stops the identified virtual machine.

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/VMs/vm-id/Start
    HTTP operations supported: POST.

    Starts the identified virtual machine.

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/VMs/vm-id/Restart
    HTTP operations supported: POST.

    Restarts the identified virtual machine.

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/VMs/vm-id/Shutdown
    HTTP operations supported: POST.

    Shuts down the identified virtual machine.

Virtual disks and virtual network adapters

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/VMs/vm-id/Disks
    HTTP operations supported: GET, POST.

    Provides access to the virtual disks of the identified virtual machine. This URL can also be used to attach a virtual disk to the virtual machine by using the POST operation.

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/VMs/vm-id/Disks/disk-id
    HTTP operations supported: GET, PUT, PATCH, DELETE.

    Provides access to the specified virtual disks.

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/VMs/vm-id/Nics
    HTTP operations supported: GET.

    Provides access to the virtual network adapters of the identified virtual machine.

  • subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles/vmrole-name/VMs/vm-id/Nics/nic-id
    HTTP operations supported: GET.

    Provides access to the specified virtual network adapter.