Share via


Read (GET) a VMTemplate [SPFSDK][VMMREF]

 

Applies To: Windows Azure Pack

Gets a VMTemplate [SPFSDK][VMMREF] entity by using the HTTP GET operation.

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

  • Example: Get all VM Templates

  • Example: Get a specific VM Template

Request

For more information about returning multiple entities, see Common GET HTTP Info.

Method

Request URI

HTTP Version

GET

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

HTTP/1.1

GET

https://{server-name}:{auth-port}/{subscription-id}/services/systemcenter/vmm/VMTemplates

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

None

Response

Response Codes

This operation does not return any non-standard OData response codes. If successful, it will return code 200 OK.

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

The response body will contain either (depending on the request headers) an XML or JSON encoded VMTemplate [SPFSDK][VMMREF] entity or entities. Here is the response body of a single entity.

{
  "odata.metadata": "https://contoso.com:30005/ae122d5f-3aab-4d75-ad48-d6593246a49e/services/systemcenter/vmm/$metadata#VMTemplates/@Element",
  "StampId": "d70c1a9b-c241-48f5-880a-b6c36071e653",
  "ID": "34f5a0a7-316b-443c-9859-788a08c02409",
  "AccessedTime": null,
  "AddedTime": "2014-08-26T09:49:37.123-07:00",
  "Admin": null,
  "AdminPasswordHasValue": false,
  "ComputerName": "*",
  "CPUCount": 1,
  "CPUMax": 100,
  "CPUReserve": 0,
  "CPUType": "3.60 GHz Xeon (2 MB L2 cache)",
  "CreationTime": "2014-08-26T09:49:37.123-07:00",
  "DiskIO": 0,
  "DomainAdmin": null,
  "DomainAdminPasswordHasValue": false,
  "ExpectedCPUUtilization": 20,
  "Enabled": true,
  "FullName": null,
  "HasVMAdditions": false,
  "IsHighlyAvailable": false,
  "JoinDomain": null,
  "JoinWorkgroup": "WORKGROUP",
  "LibraryGroup": "",
  "LimitCPUForMigration": false,
  "LimitCPUFunctionality": false,
  "Location": "",
  "Memory": 512,
  "MergeAnswerFile": false,
  "ModifiedTime": "2014-08-26T09:49:59.387-07:00",
  "Name": "Linux CentOS 6 x64",
  "NetworkUtilization": 0,
  "OperatingSystem": "CentOS Linux 6 (64 bit)",
  "OperatingSystemInstance": {
    "Name": "CentOS Linux 6 (64 bit)",
    "Description": "CentOS Linux 6 (64 bit)",
    "Version": null,
    "Architecture": "amd64",
    "Edition": null,
    "OSType": "Linux",
    "ProductType": null
  },
  "OSType": "Linux",
  "OrgName": null,
  "Owner": {
    "UserName": null,
    "RoleName": null,
    "RoleID": null
  },
  "GrantedToList": [
    {
      "UserName": null,
      "RoleName": "tenant@fabrikam.com_ae122d5f-3aab-4d75-ad48-d6593246a49e",
      "RoleID": "ae122d5f-3aab-4d75-ad48-d6593246a49e"
    }
  ],
  "QuotaPoint": 1,
  "ProductKeyHasValue": false,
  "RelativeWeight": 100,
  "ShareSCSIBus": false,
  "Tag": "(none)",
  "TimeZone": 4,
  "TotalVHDCapacity": "42949672960",
  "UndoDisksEnabled": false,
  "UseHardwareAssistedVirtualization": false,
  "Accessibility": "Public",
  "CostCenter": null,
  "Description": null,
  "IsTagEmpty": false,
  "NicCount": 1,
  "NumLockEnabled": false,
  "VMAddition": "Not Detected",
  "IsCustomizable": true,
  "DomainAdminPasswordIsServiceSetting": false,
  "SANCopyCapable": false,
  "IsTemporaryTemplate": false,
  "VMTemplateId": null,
  "VirtualHardDiskId": null,
  "VMId": null,
  "SharePath": null,
  "ApplicationProfileId": null,
  "CloudID": null,
  "DynamicMemoryBufferPercentage": null,
  "DynamicMemoryEnabled": false,
  "DynamicMemoryMaximumMB": null,
  "MemoryWeight": 5000,
  "DynamicMemoryPreferredBufferPercentage": null,
  "SQLProfileId": null,
  "VirtualFloppyDriveId": null,
  "BootOrder": [
    "CD",
    "IdeHardDrive",
    "PxeBoot",
    "Floppy"
  ],
  "CustomProperties": [
    "",
    "",
    "",
    "",
    "",
    "",
    "",
    "",
    "",
    ""
  ],
  "GuiRunOnceCommands": [],
  "ServerFeatures": [],
  "Status": "Normal",
  "VirtualizationPlatform": "Unknown",
  "CapabilityProfile": null,
  "AutoLogonCount": null,
  "DomainJoinOrganizationalUnit": null,
  "SANStatus": [],
  "Generation": 1
}

Example: Get all VM Templates

This example reads all VM templates available to the tenant.

For more information about how to get started with using the code examples provided in this programming guide, see Programming in Visual Studio with Service Provider Foundation Services.

Guid stampId = new Guid("d70c1a9b-c241-48f5-880a-b6c36071e653");

var vmTemplates = vmmService.VMTemplates.ToList();

HTTP Request

GET https://contoso.com:30005/ae122d5f-3aab-4d75-ad48-d6593246a49e/services/systemcenter/vmm/VMTemplates HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
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

HTTP Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 4918
Content-Type: application/json; odata=minimalmetadata; streaming=true; charset=utf-8
Server: Microsoft-IIS/8.5
X-Content-Type-Options: nosniff
request-id: d3df681c-b278-0000-c4bf-e1d378b2cf01
DataServiceVersion: 3.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Wed, 03 Sep 2014 23:44:23 GMT

{"odata.metadata":"https://contoso.com:30005/ae122d5f-3aab-4d75-ad48-d6593246a49e/services/systemcenter/vmm/$metadata#VMTemplates","value":[{"StampId":"d70c1a9b-c241-48f5-880a-b6c36071e653","ID":"34f5a0a7-316b-443c-9859-788a08c02409","AccessedTime":null,"AddedTime":"2014-08-26T09:49:37.123-07:00","Admin":null,"AdminPasswordHasValue":false,"ComputerName":"*","CPUCount":1,"CPUMax":100,"CPUReserve":0,"CPUType":"3.60 GHz Xeon (2 MB L2 cache)","CreationTime":"2014-08-26T09:49:37.123-07:00","DiskIO":0,"DomainAdmin":null,"DomainAdminPasswordHasValue":false,"ExpectedCPUUtilization":20,"Enabled":true,"FullName":null,"HasVMAdditions":false,"IsHighlyAvailable":false,"JoinDomain":null,"JoinWorkgroup":"WORKGROUP","LibraryGroup":"","LimitCPUForMigration":false,"LimitCPUFunctionality":false,"Location":"","Memory":512,"MergeAnswerFile":true,"ModifiedTime":"2014-08-26T09:49:59.6557326-07:00","Name":"Linux CentOS 6 x64","NetworkUtilization":0,"OperatingSystem":"CentOS Linux 6 (64 bit)","OperatingSystemInstance":{"Name":"CentOS Linux 6 (64 bit)","Description":"CentOS Linux 6 (64 bit)","Version":null,"Architecture":"amd64","Edition":null,"OSType":"Linux","ProductType":null},"OSType":"Linux","OrgName":null,"Owner":{"UserName":null,"RoleName":null,"RoleID":null},"GrantedToList":[{"UserName":null,"RoleName":"tenant@fabrikam.com_ae122d5f-3aab-4d75-ad48-d6593246a49e","RoleID":"ae122d5f-3aab-4d75-ad48-d6593246a49e"}],"QuotaPoint":1,"ProductKeyHasValue":false,"RelativeWeight":100,"ShareSCSIBus":false,"Tag":"(none)","TimeZone":4,"TotalVHDCapacity":"42949672960","UndoDisksEnabled":false,"UseHardwareAssistedVirtualization":false,"Accessibility":"Public","CostCenter":null,"Description":null,"IsTagEmpty":false,"NicCount":1,"NumLockEnabled":false,"VMAddition":"Not Detected","IsCustomizable":true,"DomainAdminPasswordIsServiceSetting":false,"SANCopyCapable":false,"IsTemporaryTemplate":false,"VMTemplateId":null,"VirtualHardDiskId":null,"VMId":null,"SharePath":null,"ApplicationProfileId":null,"CloudID":null,"DynamicMemoryBufferPercentage":null,"DynamicMemoryEnabled":false,"DynamicMemoryMaximumMB":null,"MemoryWeight":5000,"DynamicMemoryPreferredBufferPercentage":null,"SQLProfileId":null,"VirtualFloppyDriveId":null,"BootOrder":["CD","IdeHardDrive","PxeBoot","Floppy"],"CustomProperties":["","","","","","","","","",""],"GuiRunOnceCommands":[],"ServerFeatures":[],"Status":"Normal","VirtualizationPlatform":"Unknown","CapabilityProfile":null,"AutoLogonCount":null,"DomainJoinOrganizationalUnit":null,"SANStatus":[],"Generation":1},{"StampId":"d70c1a9b-c241-48f5-880a-b6c36071e653","ID":"36daf92d-7e39-4b51-b439-81a89790b8b4","AccessedTime":null,"AddedTime":"2014-09-03T13:48:20.3344312-07:00","Admin":null,"AdminPasswordHasValue":false,"ComputerName":"*","CPUCount":1,"CPUMax":100,"CPUReserve":0,"CPUType":"3.60 GHz Xeon (2 MB L2 cache)","CreationTime":"2014-09-03T13:48:20.3344312-07:00","DiskIO":0,"DomainAdmin":null,"DomainAdminPasswordHasValue":false,"ExpectedCPUUtilization":20,"Enabled":true,"FullName":null,"HasVMAdditions":false,"IsHighlyAvailable":false,"JoinDomain":null,"JoinWorkgroup":"WORKGROUP","LibraryGroup":"","LimitCPUForMigration":false,"LimitCPUFunctionality":false,"Location":"","Memory":512,"MergeAnswerFile":true,"ModifiedTime":"2014-09-03T13:48:21.6658994-07:00","Name":"Temporary Template80fdd971-e47c-416e-942e-33ee58504812","NetworkUtilization":0,"OperatingSystem":"CentOS Linux 6 (64 bit)","OperatingSystemInstance":{"Name":"CentOS Linux 6 (64 bit)","Description":"CentOS Linux 6 (64 bit)","Version":null,"Architecture":"amd64","Edition":null,"OSType":"Linux","ProductType":null},"OSType":"Linux","OrgName":null,"Owner":{"UserName":null,"RoleName":null,"RoleID":null},"GrantedToList":[{"UserName":null,"RoleName":"tenant@fabrikam.com_ae122d5f-3aab-4d75-ad48-d6593246a49e","RoleID":"ae122d5f-3aab-4d75-ad48-d6593246a49e"}],"QuotaPoint":1,"ProductKeyHasValue":false,"RelativeWeight":100,"ShareSCSIBus":false,"Tag":"(none)","TimeZone":4,"TotalVHDCapacity":"0","UndoDisksEnabled":false,"UseHardwareAssistedVirtualization":false,"Accessibility":"Public","CostCenter":null,"Description":null,"IsTagEmpty":true,"NicCount":0,"NumLockEnabled":null,"VMAddition":"Not Detected","IsCustomizable":true,"DomainAdminPasswordIsServiceSetting":false,"SANCopyCapable":false,"IsTemporaryTemplate":true,"VMTemplateId":null,"VirtualHardDiskId":null,"VMId":null,"SharePath":null,"ApplicationProfileId":null,"CloudID":null,"DynamicMemoryBufferPercentage":null,"DynamicMemoryEnabled":false,"DynamicMemoryMaximumMB":null,"MemoryWeight":null,"DynamicMemoryPreferredBufferPercentage":null,"SQLProfileId":null,"VirtualFloppyDriveId":null,"BootOrder":[],"CustomProperties":["","","","","","","","","",""],"GuiRunOnceCommands":[],"ServerFeatures":[],"Status":"Normal","VirtualizationPlatform":"Unknown","CapabilityProfile":null,"AutoLogonCount":null,"DomainJoinOrganizationalUnit":null,"SANStatus":[],"Generation":1}]}

Example: Get a specific VM Template

This example reads a single VM template.

For more information about how to get started with using the code examples provided in this programming guide, see Programming in Visual Studio with Service Provider Foundation Services.

Guid stampId = new Guid("d70c1a9b-c241-48f5-880a-b6c36071e653");
Guid templateId = new Guid("34f5a0a7-316b-443c-9859-788a08c02409");

var vmTemplate = vmmService.VMTemplates.Where(s => s.StampId == stampId && s.ID == templateId).First();

HTTP Request

GET https://contoso.com:30005/ae122d5f-3aab-4d75-ad48-d6593246a49e/services/systemcenter/vmm/VMTemplates(StampId=guid'd70c1a9b-c241-48f5-880a-b6c36071e653',ID=guid'34f5a0a7-316b-443c-9859-788a08c02409') HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
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

HTTP Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 2530
Content-Type: application/json; odata=minimalmetadata; streaming=true; charset=utf-8
Server: Microsoft-IIS/8.5
X-Content-Type-Options: nosniff
request-id: d3df681c-b278-0000-fbbf-e1d378b2cf01
DataServiceVersion: 3.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Wed, 03 Sep 2014 23:44:24 GMT

{"odata.metadata":"https://contoso.com:30005/ae122d5f-3aab-4d75-ad48-d6593246a49e/services/systemcenter/vmm/$metadata#VMTemplates/@Element","StampId":"d70c1a9b-c241-48f5-880a-b6c36071e653","ID":"34f5a0a7-316b-443c-9859-788a08c02409","AccessedTime":null,"AddedTime":"2014-08-26T09:49:37.123-07:00","Admin":null,"AdminPasswordHasValue":false,"ComputerName":"*","CPUCount":1,"CPUMax":100,"CPUReserve":0,"CPUType":"3.60 GHz Xeon (2 MB L2 cache)","CreationTime":"2014-08-26T09:49:37.123-07:00","DiskIO":0,"DomainAdmin":null,"DomainAdminPasswordHasValue":false,"ExpectedCPUUtilization":20,"Enabled":true,"FullName":null,"HasVMAdditions":false,"IsHighlyAvailable":false,"JoinDomain":null,"JoinWorkgroup":"WORKGROUP","LibraryGroup":"","LimitCPUForMigration":false,"LimitCPUFunctionality":false,"Location":"","Memory":512,"MergeAnswerFile":false,"ModifiedTime":"2014-08-26T09:49:59.387-07:00","Name":"Linux CentOS 6 x64","NetworkUtilization":0,"OperatingSystem":"CentOS Linux 6 (64 bit)","OperatingSystemInstance":{"Name":"CentOS Linux 6 (64 bit)","Description":"CentOS Linux 6 (64 bit)","Version":null,"Architecture":"amd64","Edition":null,"OSType":"Linux","ProductType":null},"OSType":"Linux","OrgName":null,"Owner":{"UserName":null,"RoleName":null,"RoleID":null},"GrantedToList":[{"UserName":null,"RoleName":"tenant@fabrikam.com_ae122d5f-3aab-4d75-ad48-d6593246a49e","RoleID":"ae122d5f-3aab-4d75-ad48-d6593246a49e"}],"QuotaPoint":1,"ProductKeyHasValue":false,"RelativeWeight":100,"ShareSCSIBus":false,"Tag":"(none)","TimeZone":4,"TotalVHDCapacity":"42949672960","UndoDisksEnabled":false,"UseHardwareAssistedVirtualization":false,"Accessibility":"Public","CostCenter":null,"Description":null,"IsTagEmpty":false,"NicCount":1,"NumLockEnabled":false,"VMAddition":"Not Detected","IsCustomizable":true,"DomainAdminPasswordIsServiceSetting":false,"SANCopyCapable":false,"IsTemporaryTemplate":false,"VMTemplateId":null,"VirtualHardDiskId":null,"VMId":null,"SharePath":null,"ApplicationProfileId":null,"CloudID":null,"DynamicMemoryBufferPercentage":null,"DynamicMemoryEnabled":false,"DynamicMemoryMaximumMB":null,"MemoryWeight":5000,"DynamicMemoryPreferredBufferPercentage":null,"SQLProfileId":null,"VirtualFloppyDriveId":null,"BootOrder":["CD","IdeHardDrive","PxeBoot","Floppy"],"CustomProperties":["","","","","","","","","",""],"GuiRunOnceCommands":[],"ServerFeatures":[],"Status":"Normal","VirtualizationPlatform":"Unknown","CapabilityProfile":null,"AutoLogonCount":null,"DomainJoinOrganizationalUnit":null,"SANStatus":[],"Generation":1}

See Also

VMTemplates Collection [SPFSDK][VMMREF]
VMTemplate [SPFSDK][VMMREF]