예제 #1
0
 public AdminOrgVdcNetwork CreateOrgVdcNetwork(
     OrgVdcNetworkType orgVdcNetworkParams)
 {
     try
     {
         return(new AdminOrgVdcNetwork(this.VcloudClient, SdkUtil.Post <OrgVdcNetworkType>(this.VcloudClient, this.Resource.href + "/networks", SerializationUtil.SerializeObject <OrgVdcNetworkType>(orgVdcNetworkParams, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.vcloud.orgVdcNetwork+xml", 201)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
예제 #2
0
        public OrgVdcNetwork CreateOrgVdcNetwork(OrgVdcNetworkType orgVdcNetworkParams)
        {
            string requestString = SerializationUtil.SerializeObject <OrgVdcNetworkType>(orgVdcNetworkParams, "com.vmware.vcloud.api.rest.schema");

            foreach (LinkType linkType in this.Resource.Link)
            {
                if (linkType.rel.Equals("orgVdcNetworks"))
                {
                    return(new OrgVdcNetwork(this.VcloudClient, SdkUtil.Post <OrgVdcNetworkType>(this.VcloudClient, linkType.href, requestString, "application/vnd.vmware.vcloud.orgVdcNetwork+xml", 201)));
                }
            }
            throw new VCloudException(SdkUtil.GetI18nString(SdkMessage.LINK_NOT_FOUND_MSG));
        }