public static AmqpSettingsType GetAmqpSettings(vCloudClient client) { string url = client.VCloudApiURL + "/admin/extension/settings/amqp"; return(SdkUtil.Get <AmqpSettingsType>(client, url, 200)); }
private ContainerType GetReferencesContainerType(vCloudClient client, string query) { ContainerType containerType = (ContainerType)null; if (query.Contains("format=references")) { if (query.Contains("type=organization&") || query.Contains("/admin/orgs/query")) { containerType = (ContainerType)SdkUtil.Get <QueryOrgReferencesType>(client, query, 200); } else if (query.Contains("type=orgVdc&") || query.Contains("/admin/vdcs/query")) { containerType = (ContainerType)SdkUtil.Get <QueryOrgVdcReferencesType>(client, query, 200); } else if (query.Contains("type=media&") || query.Contains("/mediaList/query")) { containerType = (ContainerType)SdkUtil.Get <QueryMediaReferencesType>(client, query, 200); } else if (query.Contains("type=vAppNetwork&")) { containerType = (ContainerType)SdkUtil.Get <QueryVAppNetworkReferencesType>(client, query, 200); } else if (query.Contains("type=vAppTemplate&") || query.Contains("/vAppTemplates/query")) { containerType = (ContainerType)SdkUtil.Get <QueryVAppTemplateReferencesType>(client, query, 200); } else if (query.Contains("type=vApp&") || query.Contains("/vApps/query")) { containerType = (ContainerType)SdkUtil.Get <QueryVAppReferencesType>(client, query, 200); } else if (query.Contains("type=vm&") || query.Contains("/vms/query")) { containerType = (ContainerType)SdkUtil.Get <QueryVMReferencesType>(client, query, 200); } else if (query.Contains("type=orgNetwork&")) { containerType = (ContainerType)SdkUtil.Get <QueryOrgNetworkReferencesType>(client, query, 200); } else if (query.Contains("type=adminOrgNetwork&") || query.Contains("/admin/extension/orgNetworks/query")) { containerType = (ContainerType)SdkUtil.Get <QueryOrgNetworkReferencesType>(client, query, 200); } else if (query.Contains("type=catalog&") || query.Contains("/catalogs/query")) { containerType = (ContainerType)SdkUtil.Get <QueryCatalogReferencesType>(client, query, 200); } else if (query.Contains("type=adminOrgVdc&") || query.Contains("/admin/extension/orgVdcs/query")) { containerType = (ContainerType)SdkUtil.Get <QueryAdminVdcReferencesType>(client, query, 200); } else if (query.Contains("type=providerVdc&") || query.Contains("/admin/extension/providerVdcReferences/query")) { containerType = (ContainerType)SdkUtil.Get <QueryVMWProviderVdcReferencesType>(client, query, 200); } else if (query.Contains("type=externalNetwork&") || query.Contains("/admin/extension/externalNetworkReferences/query")) { containerType = (ContainerType)SdkUtil.Get <QueryNetworkReferencesType>(client, query, 200); } else if (query.Contains("type=group&") || query.Contains("/admin/groups/query")) { containerType = (ContainerType)SdkUtil.Get <QueryGroupReferencesType>(client, query, 200); } else if (query.Contains("type=user&") || query.Contains("/admin/users/query")) { containerType = (ContainerType)SdkUtil.Get <QueryUserReferencesType>(client, query, 200); } else if (query.Contains("type=strandedUser&") || query.Contains("/admin/strandedUsers/query")) { containerType = (ContainerType)SdkUtil.Get <QueryUserReferencesType>(client, query, 200); } else if (query.Contains("type=strandedItems&") || query.Contains("/admin/extension/strandedItems/query")) { containerType = (ContainerType)SdkUtil.Get <QueryStrandedItemReferencesType>(client, query, 200); } else if (query.Contains("type=role&") || query.Contains("/admin/roles/query")) { containerType = (ContainerType)SdkUtil.Get <QueryRoleReferencesType>(client, query, 200); } else if (query.Contains("type=datastore&") || query.Contains("/admin/extension/datastores/query")) { containerType = (ContainerType)SdkUtil.Get <QueryDatastoreReferencesType>(client, query, 200); } else if (query.Contains("type=networkPool&") || query.Contains("/admin/extension/networkPoolReferences/query")) { containerType = (ContainerType)SdkUtil.Get <QueryNetworkPoolReferencesType>(client, query, 200); } else if (query.Contains("type=virtualCenter&") || query.Contains("/admin/extension/vimServerReferences/query")) { containerType = (ContainerType)SdkUtil.Get <QueryVirtualCenterReferencesType>(client, query, 200); } else if (query.Contains("type=host&") || query.Contains("/admin/extension/hostReferences/query")) { containerType = (ContainerType)SdkUtil.Get <QueryHostReferencesType>(client, query, 200); } else if (query.Contains("type=adminVApp&") || query.Contains("/admin/extension/vapps/query")) { containerType = (ContainerType)SdkUtil.Get <QueryVAppReferencesType>(client, query, 200); } else if (query.Contains("type=adminVM&")) { containerType = (ContainerType)SdkUtil.Get <QueryVMReferencesType>(client, query, 200); } else if (query.Contains("type=vAppOrgNetworkRelation&")) { containerType = (ContainerType)SdkUtil.Get <QueryVAppOrgNetworkRelationReferencesType>(client, query, 200); } else if (query.Contains("type=adminUser&")) { containerType = (ContainerType)SdkUtil.Get <QueryUserReferencesType>(client, query, 200); } else if (query.Contains("type=adminGroup&")) { containerType = (ContainerType)SdkUtil.Get <QueryGroupReferencesType>(client, query, 200); } else if (query.Contains("type=adminVAppNetwork&")) { containerType = (ContainerType)SdkUtil.Get <QueryVAppNetworkReferencesType>(client, query, 200); } else if (query.Contains("type=adminCatalog&")) { containerType = (ContainerType)SdkUtil.Get <QueryCatalogReferencesType>(client, query, 200); } else if (query.Contains("type=adminCatalogItem&")) { containerType = (ContainerType)SdkUtil.Get <QueryCatalogItemReferencesType>(client, query, 200); } else if (query.Contains("type=catalogItem&")) { containerType = (ContainerType)SdkUtil.Get <QueryCatalogItemReferencesType>(client, query, 200); } else if (query.Contains("type=adminMedia&")) { containerType = (ContainerType)SdkUtil.Get <QueryMediaReferencesType>(client, query, 200); } else if (query.Contains("type=adminVAppTemplate&")) { containerType = (ContainerType)SdkUtil.Get <QueryVAppTemplateReferencesType>(client, query, 200); } else if (query.Contains("type=adminShadowVM&")) { containerType = (ContainerType)SdkUtil.Get <QueryVMReferencesType>(client, query, 200); } else if (query.Contains("type=task&")) { containerType = (ContainerType)SdkUtil.Get <QueryTaskReferencesType>(client, query, 200); } else if (query.Contains("type=adminTask&")) { containerType = (ContainerType)SdkUtil.Get <QueryTaskReferencesType>(client, query, 200); } else if (query.Contains("type=blockingTask&")) { containerType = (ContainerType)SdkUtil.Get <QueryBlockingTaskReferencesType>(client, query, 200); } else if (query.Contains("type=right&") || query.Contains("/admin/rights/query")) { containerType = (ContainerType)SdkUtil.Get <QueryRightReferencesType>(client, query, 200); } else if (query.Contains("type=disk&") || query.Contains("/disks/query")) { containerType = (ContainerType)SdkUtil.Get <QueryDiskReferencesType>(client, query, 200); } else if (query.Contains("type=service&")) { containerType = (ContainerType)SdkUtil.Get <QueryServiceReferencesType>(client, query, 200); } else if (query.Contains("type=serviceLink&")) { containerType = (ContainerType)SdkUtil.Get <QueryServiceLinkReferencesType>(client, query, 200); } else if (query.Contains("type=apiDefinition&")) { containerType = (ContainerType)SdkUtil.Get <QueryApiDefinitionReferencesType>(client, query, 200); } else if (query.Contains("type=fileDescriptor&")) { containerType = (ContainerType)SdkUtil.Get <QueryFileDescriptorReferencesType>(client, query, 200); } else if (query.Contains("type=resourceClassAction&")) { containerType = (ContainerType)SdkUtil.Get <QueryResourceClassActionReferencesType>(client, query, 200); } else if (query.Contains("type=resourceClass&")) { containerType = (ContainerType)SdkUtil.Get <QueryResourceClassReferencesType>(client, query, 200); } else if (query.Contains("type=aclRule&")) { containerType = (ContainerType)SdkUtil.Get <QueryAclRuleReferencesType>(client, query, 200); } else if (query.Contains("type=serviceResource&")) { containerType = (ContainerType)SdkUtil.Get <QueryServiceResourceResourceReferencesType>(client, query, 200); } else if (query.Contains("type=orgVdcNetwork&")) { containerType = (ContainerType)SdkUtil.Get <QueryOrgVdcNetworkReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/service") && query.Contains("/links")) { containerType = (ContainerType)SdkUtil.Get <QueryServiceLinkReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/service") && query.Contains("/apidefinitions")) { containerType = (ContainerType)SdkUtil.Get <QueryAdminApiDefinitionReferencesType>(client, query, 200); } else if (query.Contains("api/service?")) { containerType = (ContainerType)SdkUtil.Get <QueryServiceReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/service") && query.Contains("/files")) { containerType = (ContainerType)SdkUtil.Get <QueryAdminFileDescriptorReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/service") && query.Contains("/resourceclasses")) { containerType = (ContainerType)SdkUtil.Get <QueryResourceClassReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/service") && query.Contains("/resourceclassactions")) { containerType = (ContainerType)SdkUtil.Get <QueryResourceClassActionReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/service") && query.Contains("/aclrules")) { containerType = (ContainerType)SdkUtil.Get <QueryAclRuleReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/service") && query.Contains("/serviceresources")) { containerType = (ContainerType)SdkUtil.Get <QueryServiceResourceResourceReferencesType>(client, query, 200); } else if (query.Contains("api/service") && query.Contains("/apidefinitions")) { containerType = (ContainerType)SdkUtil.Get <QueryApiDefinitionReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/extServices")) { containerType = (ContainerType)SdkUtil.Get <QueryAdminServiceReferencesType>(client, query, 200); } else if (query.Contains("api/admin/vdc") && query.Contains("/edgeGateways")) { containerType = (ContainerType)SdkUtil.Get <QueryEdgeGatewayReferencesType>(client, query, 200); } else if (query.Contains("type=orgVdcGateway&")) { containerType = (ContainerType)SdkUtil.Get <QueryOrgVdcGatewayReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/service") && query.Contains("/apifilters")) { containerType = (ContainerType)SdkUtil.Get <QueryApiFilterReferencesType>(client, query, 200); } else if (query.Contains("type=adminDisk&")) { containerType = (ContainerType)SdkUtil.Get <QueryAdminDiskReferencesType>(client, query, 200); } else if (query.Contains("api/admin/vdc") && query.Contains("/networks")) { containerType = (ContainerType)SdkUtil.Get <QueryOrgVdcNetworkReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/service")) { containerType = (ContainerType)SdkUtil.Get <QueryAdminServiceReferencesType>(client, query, 200); } else if (query.Contains("api/admin/extension/resourcePool") && query.Contains("/vmList")) { containerType = (ContainerType)SdkUtil.Get <QueryVMReferencesType>(client, query, 200); } else if (query.Contains("type=edgeGateway&")) { containerType = (ContainerType)SdkUtil.Get <QueryEdgeGatewayReferencesType>(client, query, 200); } else if (query.Contains("type=strandedItem&") || query.Contains("/admin/extension/strandedItem/query")) { containerType = (ContainerType)SdkUtil.Get <QueryStrandedItemReferencesType>(client, query, 200); } } else { containerType = (ContainerType)SdkUtil.Get <QueryResultRecordsType>(client, query, 200); } return(containerType); }
public VMWProviderVdcStorageProfile UpdateVMWProviderVdcStorageProfile( VMWProviderVdcStorageProfileType vmwProviderVdcStorageProfileResource) { return(new VMWProviderVdcStorageProfile(this.VcloudClient, SdkUtil.Put <VMWProviderVdcStorageProfileType>(this.VcloudClient, this.Reference.href, SerializationUtil.SerializeObject <VMWProviderVdcStorageProfileType>(vmwProviderVdcStorageProfileResource, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.vmwPvdcStorageProfile+xml", 200))); }
public static BlockingTask GetBlockingTaskById(vCloudClient client, string vCloudId) { Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_VCLOUD_ID_MSG) + " - " + vCloudId); return(new BlockingTask(client, VcloudEntity <BlockingTaskType> .GetEntityById(client, vCloudId, "application/vnd.vmware.admin.blockingTask+xml"))); }
public OrgLdapSettingsType UpdateLdapSettings( OrgLdapSettingsType orgLdapSettingsType) { return(SdkUtil.Put <OrgLdapSettingsType>(this.VcloudClient, this.Reference.href + "/settings/ldap", SerializationUtil.SerializeObject <OrgLdapSettingsType>(orgLdapSettingsType, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.organizationLdapSettings+xml", 200)); }
public Signature() { Timestamp = SdkUtil.GetCurrentTimeSeconds(); }
public AdminVdc CreateAdminVdc(CreateVdcParamsType vdcParams) { return(new AdminVdc(this.VcloudClient, SdkUtil.Post <AdminVdcType>(this.VcloudClient, this.Reference.href + "/vdcsparams", SerializationUtil.SerializeObject <CreateVdcParamsType>(vdcParams, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.createVdcParams+xml", 201))); }
public Task Sync() { return(new Task(this.VcloudClient, SdkUtil.Post <TaskType>(this.VcloudClient, this.Reference.href + "/action/sync", (string)null, (string)null, 201))); }
private void SortEntityRefs_v1_5() { this._vappTemplateRefs = new List <ReferenceType>(); this._mediaRefs = new List <ReferenceType>(); this._vappRefsByName = new Dictionary <string, ReferenceType>(); this._availableNetworkRefsByName = new Dictionary <string, ReferenceType>(); this._storageProfileRefs = new List <ReferenceType>(); this._diskRefs = new List <ReferenceType>(); if (this.Resource.ResourceEntities != null) { ResourceEntitiesType resourceEntities = this.Resource.ResourceEntities; if (resourceEntities.ResourceEntity != null) { foreach (ResourceReferenceType resourceReferenceType in ((IEnumerable <ResourceReferenceType>)resourceEntities.ResourceEntity).ToList <ResourceReferenceType>()) { if (resourceReferenceType.type.Equals("application/vnd.vmware.vcloud.vAppTemplate+xml")) { this._vappTemplateRefs.Add((ReferenceType)resourceReferenceType); } else if (resourceReferenceType.type.Equals("application/vnd.vmware.vcloud.media+xml")) { this._mediaRefs.Add((ReferenceType)resourceReferenceType); } else if (resourceReferenceType.type.Equals("application/vnd.vmware.vcloud.vApp+xml")) { this._vappRefsByName.Add(resourceReferenceType.name, (ReferenceType)resourceReferenceType); } else if (resourceReferenceType.type.Equals("application/vnd.vmware.vcloud.disk+xml")) { this._diskRefs.Add((ReferenceType)resourceReferenceType); } else { Logger.Log(TraceLevel.Warning, SdkUtil.GetI18nString(SdkMessage.UNKNOWN_REF_TYPE_MSG) + " - ", resourceReferenceType.type); } } } } if (this.Resource.AvailableNetworks != null) { AvailableNetworksType availableNetworks = this.Resource.AvailableNetworks; if (availableNetworks.Network != null) { foreach (ReferenceType referenceType in availableNetworks.Network) { if (!this._availableNetworkRefsByName.ContainsKey(referenceType.name)) { this._availableNetworkRefsByName.Add(referenceType.name, referenceType); } } } } foreach (LinkType linkType in this.Resource.Link) { if (linkType.rel.Equals("up") && linkType.type.Equals("application/vnd.vmware.vcloud.org+xml")) { this._orgReference = (ReferenceType)linkType; } } if (this.Resource.VdcStorageProfiles == null) { return; } foreach (ReferenceType referenceType in this.Resource.VdcStorageProfiles.VdcStorageProfile) { this._storageProfileRefs.Add(referenceType); } }
public Vapp InstantiateOvf(InstantiateOvfParamsType instantiateOvfParams) { return(new Vapp(this.VcloudClient, SdkUtil.Post <VAppType>(this.VcloudClient, this.Reference.href + "/action/instantiateOvf", SerializationUtil.SerializeObject <InstantiateOvfParamsType>(instantiateOvfParams, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.vcloud.instantiateOvfParams+xml", 201))); }
public void Delete() { SdkUtil.Delete <ServiceResourceType>(this.VcloudClient, this.Reference.href, 204); }