Share via


Update (PUT) a VirtualDVDDrive [SPFSDK][VMMREF]

 

Applies To: Windows Azure Pack

Updates a VirtualDVDDrive [SPFSDK][VMMREF] entity by using the HTTP PUT operation.

Here is a list of examples related to this collection operation.

  • Example: Mount an ISO on a Virtual DVD Drive

Request

For more information about the placeholders used in the URI, see URL placeholders.

Method

Request URI

HTTP Version

PUT

https://{server-name}:{auth-port}/{subscription-id}/services/systemcenter/vmm/VirtualDVDDrives(ID=Guid'[value]',StampId=Guid'[value]')

HTTP/1.1

Request URI Parameters

URI Parameter

Description

ID

[Edm.Guid] The identifier of the entity.

StampId

[Edm.Guid] The identifier of the stamp that restricts the query.

Request Headers

This operation does not use any non-standard request headers.

For more information about the common request headers used by this operation, see Common HTTP request information.

Request Body

The request body should contain a single (depending on the request headers) XML or JSON encoded VirtualDVDDrive [SPFSDK][VMMREF] entity that is to be updated. Here is the request body of a single entity.

{
  "odata.type": "VMM.VirtualDVDDrive",
  "Accessibility": "Public",
  "AddedTime": "2014-05-06T16:38:13.013-07:00",
  "Bus": 1,
  "BusType": "IDE",
  "ChildObjectIDs@odata.type": "Collection(Edm.Guid)",
  "ChildObjectIDs": [],
  "Connection": "None",
  "Description": "",
  "Enabled": true,
  "HostDrive": null,
  "ID": "d0a9a0dd-fa0d-4666-aeda-36681761365d",
  "ISOId": "9c776401-cd9b-42be-9cc6-8aab2d8c6a1d",
  "ISOLinked": false,
  "JobGroupId": null,
  "LUN": 0,
  "ModifiedTime": "2014-06-11T09:07:43.8490708-07:00",
  "Name": "Tenent Test Virtual Machine 1",
  "Size": null,
  "StampId": "56ebc6dc-f63c-46e2-8438-2967e0ad83bc",
  "TemplateId": null,
  "VMId": null
}

Response

Response Codes

This operation does not return any non-standard OData response codes. If successful, it will return code 204 No Content.

Response Headers

This operation does not use any non-standard response headers.

For more information about the common response headers used by this operation, see Common HTTP response information.

Response Body

None

Example: Mount an ISO on a Virtual DVD Drive

This example mounts an ISO file from the library on a virtual DVD drive. When an ISO is mounted, it will be cloned first, and then assigned. This is the normal behavior when the ISOLinked property is set to false. When set to true, the ISO will instead be referenced by the DVD drive, and a cloned copy will not be created. The example below references an existing ISO.

For more information about how to get started with using the code examples provided in this programming guide, see Program in Visual Studio with the Windows Azure Pack IaaS Resource Provider [SPFSDK].

Guid stampId = new Guid("56ebc6dc-f63c-46e2-8438-2967e0ad83bc");
Guid isoId = new Guid("9c776401-cd9b-42be-9cc6-8aab2d8c6a1d");
Guid vmId = new Guid("ee9fb3ed-c2f1-4ed5-9597-0a30c69d17f8");

var vm = vmmService.VirtualMachines.Expand("VirtualDVDDrives").Where(v => v.StampId == stampId && v.ID == vmId).First();
var drive = vm.VirtualDVDDrives.First();

drive.ISOId = new Guid("9c776401-cd9b-42be-9cc6-8aab2d8c6a1d");

// If the ISO should be cloned instead of referenced, remove the following line
drive.ISOLinked = true;

vmmService.UpdateObject(drive);
vmmService.SaveChanges();

HTTP Request

MERGE https://contoso.com:30005/86e93b7f-25e3-4c44-8ca1-3ebdbd2dfc06/services/systemcenter/vmm/VirtualDVDDrives(ID=guid'd0a9a0dd-fa0d-4666-aeda-36681761365d',StampId=guid'56ebc6dc-f63c-46e2-8438-2967e0ad83bc') HTTP/1.1
DataServiceVersion: 3.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
Accept: application/json;odata=minimalmetadata
Accept-Charset: UTF-8
DataServiceUrlConventions: KeyAsSegment
User-Agent: Microsoft ADO.NET Data Services
Authorization: Bearer {ENCODED AUTHENTICATION TOKEN}
x-ms-principal-id: tenant@fabrikam.com
Host: contoso.com:30005
Content-Length: 585
Expect: 100-continue

{"odata.type":"VMM.VirtualDVDDrive","Accessibility":"Public","AddedTime":"2014-05-06T16:38:13.013-07:00","Bus":1,"BusType":"IDE","ChildObjectIDs@odata.type":"Collection(Edm.Guid)","ChildObjectIDs":[],"Connection":"None","Description":"","Enabled":true,"HostDrive":null,"ID":"d0a9a0dd-fa0d-4666-aeda-36681761365d","ISOId":"9c776401-cd9b-42be-9cc6-8aab2d8c6a1d","ISOLinked":false,"JobGroupId":null,"LUN":0,"ModifiedTime":"2014-06-11T09:07:43.8490708-07:00","Name":"Tenent Test Virtual Machine 1","Size":null,"StampId":"56ebc6dc-f63c-46e2-8438-2967e0ad83bc","TemplateId":null,"VMId":null}

HTTP Response

HTTP/1.1 204 No Content
Cache-Control: no-cache
Content-Length: 0
Server: Microsoft-IIS/8.5
x-ms-request-id: a63bfb56-5de9-4614-8532-b089dfd64283
X-Content-Type-Options: nosniff
request-id: 5fbd8ef2-63e6-0000-9d7c-c15fe663cf01
DataServiceVersion: 1.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Wed, 11 Jun 2014 23:05:22 GMT

See Also

VirtualDVDDrives Collection [SPFSDK][VMMREF]
VirtualDVDDrive [SPFSDK][VMMREF]
Create (POST) a VirtualDVDDrive [SPFSDK][VMMREF]
Read (GET) a VirtualDVDDrive [SPFSDK][VMMREF]
Delete (DELETE) a VirtualDVDDrive [SPFSDK][VMMREF]