Reference for GetOrCreateVirtualMachineAndAttach

Url: hypervagent/getOrCreate

HTTP Method: POST

Message direction Format Body
Request XML Example,Schema
Response XML Example,Schema

The following is an example request XML body:

<?xml version="1.0" encoding="utf-16"?>
<hyperVVirtualMachineRequest xmlns="http://apprecovery.com/management/api/2010/05">
  <biosSerialNumber>String content</biosSerialNumber>
  <description>String content</description>
  <extendedParameters>
    <generation>2147483647</generation>
    <hyperVVersion>Unknown</hyperVVersion>
    <preallocate>true</preallocate>
    <secureBoot>true</secureBoot>
    <shutdownRemoteHyperVAgentOnDispose>true</shutdownRemoteHyperVAgentOnDispose>
    <useRandomFolderForAgent>true</useRandomFolderForAgent>
    <useVhdx>true</useVhdx>
    <virtualNetworks>
      <virtualNetwork>String content</virtualNetwork>
      <virtualNetwork>String content</virtualNetwork>
    </virtualNetworks>
  </extendedParameters>
  <location>String content</location>
  <name>String content</name>
  <virtualMachineConfiguration>
    <ConfigurationFiles xmlns="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV">
      <!--Valid elements of type: hyperVConfigurationFile, esxVirtualMachineConfigurationFile-->
      <virtualMachineConfigurationFile i:type="hyperVConfigurationFile" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://apprecovery.com/management/api/2010/05">
        <fileName>String content</fileName>
        <data>QmFzZSA2NCBTdHJlYW0=</data>
        <fileType>None</fileType>
      </virtualMachineConfigurationFile>
      <!--Valid elements of type: hyperVConfigurationFile, esxVirtualMachineConfigurationFile-->
      <virtualMachineConfigurationFile i:type="hyperVConfigurationFile" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://apprecovery.com/management/api/2010/05">
        <fileName>String content</fileName>
        <data>QmFzZSA2NCBTdHJlYW0=</data>
        <fileType>None</fileType>
      </virtualMachineConfigurationFile>
    </ConfigurationFiles>
    <SnapshotsType xmlns="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV">None</SnapshotsType>
  </virtualMachineConfiguration>
</hyperVVirtualMachineRequest>

The following is an example response XML body:

<?xml version="1.0" encoding="utf-16"?>
<hyperVVirtualMachineResponse xmlns="http://apprecovery.com/management/api/2010/05">
  <RemoteVirtualMachineSettings>
    <location>String content</location>
    <name>String content</name>
  </RemoteVirtualMachineSettings>
  <newlyCreated>true</newlyCreated>
  <sessionId>1627aea5-8e0a-4371-9022-9b504344e724</sessionId>
</hyperVVirtualMachineResponse>

The following is the request XML Schema:

<?xml version="1.0" encoding="utf-16"?>
<Schemas>
  <xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="anyType" nillable="true" type="xs:anyType" />
    <xs:element name="anyURI" nillable="true" type="xs:anyURI" />
    <xs:element name="base64Binary" nillable="true" type="xs:base64Binary" />
    <xs:element name="boolean" nillable="true" type="xs:boolean" />
    <xs:element name="byte" nillable="true" type="xs:byte" />
    <xs:element name="dateTime" nillable="true" type="xs:dateTime" />
    <xs:element name="decimal" nillable="true" type="xs:decimal" />
    <xs:element name="double" nillable="true" type="xs:double" />
    <xs:element name="float" nillable="true" type="xs:float" />
    <xs:element name="int" nillable="true" type="xs:int" />
    <xs:element name="long" nillable="true" type="xs:long" />
    <xs:element name="QName" nillable="true" type="xs:QName" />
    <xs:element name="short" nillable="true" type="xs:short" />
    <xs:element name="string" nillable="true" type="xs:string" />
    <xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte" />
    <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt" />
    <xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong" />
    <xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort" />
    <xs:element name="char" nillable="true" type="tns:char" />
    <xs:simpleType name="char">
      <xs:restriction base="xs:int" />
    </xs:simpleType>
    <xs:element name="duration" nillable="true" type="tns:duration" />
    <xs:simpleType name="duration">
      <xs:restriction base="xs:duration">
        <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?" />
        <xs:minInclusive value="-P10675199DT2H48M5.4775808S" />
        <xs:maxInclusive value="P10675199DT2H48M5.4775807S" />
      </xs:restriction>
    </xs:simpleType>
    <xs:element name="guid" nillable="true" type="tns:guid" />
    <xs:simpleType name="guid">
      <xs:restriction base="xs:string">
        <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}" />
      </xs:restriction>
    </xs:simpleType>
    <xs:attribute name="FactoryType" type="xs:QName" />
    <xs:attribute name="Id" type="xs:ID" />
    <xs:attribute name="Ref" type="xs:IDREF" />
  </xs:schema>
  <xs:schema xmlns:tns="http://apprecovery.com/management/api/2010/05" elementFormDefault="qualified" targetNamespace="http://apprecovery.com/management/api/2010/05" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV" />
    <xs:complexType name="hyperVVirtualMachineRequest">
      <xs:sequence>
        <xs:element minOccurs="0" name="biosSerialNumber" nillable="true" type="xs:string" />
        <xs:element minOccurs="0" name="description" nillable="true" type="xs:string" />
        <xs:element minOccurs="0" name="extendedParameters" nillable="true" type="tns:hyperVExtendedParameters" />
        <xs:element minOccurs="0" name="location" nillable="true" type="xs:string" />
        <xs:element minOccurs="0" name="name" nillable="true" type="xs:string" />
        <xs:element minOccurs="0" name="virtualMachineConfiguration" nillable="true" xmlns:q1="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV" type="q1:HyperVVirtualMachineConfiguration" />
      </xs:sequence>
    </xs:complexType>
    <xs:element name="hyperVVirtualMachineRequest" nillable="true" type="tns:hyperVVirtualMachineRequest" />
    <xs:complexType name="hyperVExtendedParameters">
      <xs:sequence>
        <xs:element minOccurs="0" name="generation" type="xs:int" />
        <xs:element minOccurs="0" name="hyperVVersion" xmlns:q2="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV" type="q2:HyperVVersion" />
        <xs:element minOccurs="0" name="preallocate" type="xs:boolean" />
        <xs:element minOccurs="0" name="secureBoot" type="xs:boolean" />
        <xs:element minOccurs="0" name="shutdownRemoteHyperVAgentOnDispose" type="xs:boolean" />
        <xs:element minOccurs="0" name="useRandomFolderForAgent" type="xs:boolean" />
        <xs:element minOccurs="0" name="useVhdx" type="xs:boolean" />
        <xs:element minOccurs="0" name="virtualNetworks" nillable="true" type="tns:virtualNetworks" />
      </xs:sequence>
    </xs:complexType>
    <xs:element name="hyperVExtendedParameters" nillable="true" type="tns:hyperVExtendedParameters" />
    <xs:complexType name="virtualNetworks">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="virtualNetwork" nillable="true" type="xs:string" />
      </xs:sequence>
    </xs:complexType>
    <xs:element name="virtualNetworks" nillable="true" type="tns:virtualNetworks" />
    <xs:complexType name="virtualMachineConfigurationFiles">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="virtualMachineConfigurationFile" nillable="true" type="tns:virtualMachineConfigurationFile" />
      </xs:sequence>
    </xs:complexType>
    <xs:element name="virtualMachineConfigurationFiles" nillable="true" type="tns:virtualMachineConfigurationFiles" />
    <xs:complexType name="virtualMachineConfigurationFile">
      <xs:sequence>
        <xs:element minOccurs="0" name="fileName" nillable="true" type="xs:string" />
        <xs:element minOccurs="0" name="data" nillable="true" type="xs:base64Binary" />
      </xs:sequence>
    </xs:complexType>
    <xs:element name="virtualMachineConfigurationFile" nillable="true" type="tns:virtualMachineConfigurationFile" />
    <xs:complexType name="hyperVConfigurationFile">
      <xs:complexContent mixed="false">
        <xs:extension base="tns:virtualMachineConfigurationFile">
          <xs:sequence>
            <xs:element minOccurs="0" name="fileType" type="tns:hyperVConfigurationFileType" />
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
    <xs:element name="hyperVConfigurationFile" nillable="true" type="tns:hyperVConfigurationFile" />
    <xs:simpleType name="hyperVConfigurationFileType">
      <xs:restriction base="xs:string">
        <xs:enumeration value="None" />
        <xs:enumeration value="Vmcx" />
        <xs:enumeration value="Vmrs" />
        <xs:enumeration value="Xml" />
      </xs:restriction>
    </xs:simpleType>
    <xs:element name="hyperVConfigurationFileType" nillable="true" type="tns:hyperVConfigurationFileType" />
    <xs:complexType name="esxVirtualMachineConfigurationFile">
      <xs:complexContent mixed="false">
        <xs:extension base="tns:virtualMachineConfigurationFile">
          <xs:sequence>
            <xs:element minOccurs="0" name="fileType" type="tns:esxConfigurationFileType" />
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
    <xs:element name="esxVirtualMachineConfigurationFile" nillable="true" type="tns:esxVirtualMachineConfigurationFile" />
    <xs:simpleType name="esxConfigurationFileType">
      <xs:restriction base="xs:string">
        <xs:enumeration value="None" />
        <xs:enumeration value="Vmx" />
        <xs:enumeration value="Nvram" />
      </xs:restriction>
    </xs:simpleType>
    <xs:element name="esxConfigurationFileType" nillable="true" type="tns:esxConfigurationFileType" />
  </xs:schema>
  <xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://apprecovery.com/management/api/2010/05" />
    <xs:import namespace="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV.Protection" />
    <xs:simpleType name="HyperVVersion">
      <xs:restriction base="xs:string">
        <xs:enumeration value="Unknown" />
        <xs:enumeration value="Version1" />
        <xs:enumeration value="Version2" />
        <xs:enumeration value="Version3" />
        <xs:enumeration value="Version4" />
      </xs:restriction>
    </xs:simpleType>
    <xs:element name="HyperVVersion" nillable="true" type="tns:HyperVVersion" />
    <xs:complexType name="HyperVVirtualMachineConfiguration">
      <xs:sequence>
        <xs:element minOccurs="0" name="ConfigurationFiles" nillable="true" xmlns:q1="http://apprecovery.com/management/api/2010/05" type="q1:virtualMachineConfigurationFiles" />
        <xs:element minOccurs="0" name="SnapshotsType" xmlns:q2="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV.Protection" type="q2:UserSnapshotType" />
      </xs:sequence>
    </xs:complexType>
    <xs:element name="HyperVVirtualMachineConfiguration" nillable="true" type="tns:HyperVVirtualMachineConfiguration" />
  </xs:schema>
  <xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV.Protection" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/Replay.Common.Contracts.Virtualization.HyperV.Protection" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
    <xs:simpleType name="UserSnapshotType">
      <xs:annotation>
        <xs:appinfo>
          <ActualType Name="unsignedShort" Namespace="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/2003/10/Serialization/" />
        </xs:appinfo>
      </xs:annotation>
      <xs:restriction base="xs:string">
        <xs:enumeration value="None" />
        <xs:enumeration value="Disable">
          <xs:annotation>
            <xs:appinfo>
              <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">2</EnumerationValue>
            </xs:appinfo>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="ProductionFallbackToTest">
          <xs:annotation>
            <xs:appinfo>
              <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">3</EnumerationValue>
            </xs:appinfo>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="ProductionNoFallback">
          <xs:annotation>
            <xs:appinfo>
              <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">4</EnumerationValue>
            </xs:appinfo>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="Test">
          <xs:annotation>
            <xs:appinfo>
              <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">5</EnumerationValue>
            </xs:appinfo>
          </xs:annotation>
        </xs:enumeration>
      </xs:restriction>
    </xs:simpleType>
    <xs:element name="UserSnapshotType" nillable="true" type="tns:UserSnapshotType" />
  </xs:schema>
</Schemas>

The following is the response XML Schema:

<?xml version="1.0" encoding="utf-16"?>
<Schemas>
  <xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="anyType" nillable="true" type="xs:anyType" />
    <xs:element name="anyURI" nillable="true" type="xs:anyURI" />
    <xs:element name="base64Binary" nillable="true" type="xs:base64Binary" />
    <xs:element name="boolean" nillable="true" type="xs:boolean" />
    <xs:element name="byte" nillable="true" type="xs:byte" />
    <xs:element name="dateTime" nillable="true" type="xs:dateTime" />
    <xs:element name="decimal" nillable="true" type="xs:decimal" />
    <xs:element name="double" nillable="true" type="xs:double" />
    <xs:element name="float" nillable="true" type="xs:float" />
    <xs:element name="int" nillable="true" type="xs:int" />
    <xs:element name="long" nillable="true" type="xs:long" />
    <xs:element name="QName" nillable="true" type="xs:QName" />
    <xs:element name="short" nillable="true" type="xs:short" />
    <xs:element name="string" nillable="true" type="xs:string" />
    <xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte" />
    <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt" />
    <xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong" />
    <xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort" />
    <xs:element name="char" nillable="true" type="tns:char" />
    <xs:simpleType name="char">
      <xs:restriction base="xs:int" />
    </xs:simpleType>
    <xs:element name="duration" nillable="true" type="tns:duration" />
    <xs:simpleType name="duration">
      <xs:restriction base="xs:duration">
        <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?" />
        <xs:minInclusive value="-P10675199DT2H48M5.4775808S" />
        <xs:maxInclusive value="P10675199DT2H48M5.4775807S" />
      </xs:restriction>
    </xs:simpleType>
    <xs:element name="guid" nillable="true" type="tns:guid" />
    <xs:simpleType name="guid">
      <xs:restriction base="xs:string">
        <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}" />
      </xs:restriction>
    </xs:simpleType>
    <xs:attribute name="FactoryType" type="xs:QName" />
    <xs:attribute name="Id" type="xs:ID" />
    <xs:attribute name="Ref" type="xs:IDREF" />
  </xs:schema>
  <xs:schema xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:tns="http://apprecovery.com/management/api/2010/05" elementFormDefault="qualified" targetNamespace="http://apprecovery.com/management/api/2010/05" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
    <xs:complexType name="hyperVVirtualMachineResponse">
      <xs:sequence>
        <xs:element minOccurs="0" name="RemoteVirtualMachineSettings" nillable="true" type="tns:hyperVRemoteVirtualMachineSettings" />
        <xs:element minOccurs="0" name="newlyCreated" type="xs:boolean" />
        <xs:element minOccurs="0" name="sessionId" type="ser:guid" />
      </xs:sequence>
    </xs:complexType>
    <xs:element name="hyperVVirtualMachineResponse" nillable="true" type="tns:hyperVVirtualMachineResponse" />
    <xs:complexType name="hyperVRemoteVirtualMachineSettings">
      <xs:sequence>
        <xs:element minOccurs="0" name="location" nillable="true" type="xs:string" />
        <xs:element minOccurs="0" name="name" nillable="true" type="xs:string" />
      </xs:sequence>
    </xs:complexType>
    <xs:element name="hyperVRemoteVirtualMachineSettings" nillable="true" type="tns:hyperVRemoteVirtualMachineSettings" />
  </xs:schema>
</Schemas>