InstanceHref() public static method

Helper method returns properly formatted instance_href
public static InstanceHref ( string cloudID, string objectID ) : string
cloudID string Cloud ID where Instance can be found
objectID string Instance ID
return string
コード例 #1
0
        /// <summary>
        /// Private method for centralizing all logic for VolumeAttachment Create clals
        /// </summary>
        /// <param name="postHref">Href fragment for calling RSAPI</param>
        /// <param name="cloudID">ID of Cloud</param>
        /// <param name="device">The device location where the volume will be mounted. Value must be of format /dev/xvd[bcefghij]. This is not reliable and will be deprecated</param>
        /// <param name="instanceID">The ID of the instance to which the volume will be attached to</param>
        /// <param name="volumeID">The ID of the volume to be attached</param>
        /// <returns>ID of newly created VolumeAttachment</returns>
        private static string createPost(string postHref, string cloudID, string device, string instanceID, string volumeID)
        {
            List <KeyValuePair <string, string> > postParams = new List <KeyValuePair <string, string> >();

            Utility.addParameter(Utility.InstanceHref(cloudID, instanceID), "volume_attachment[instance_href]", postParams);
            Utility.addParameter(Utility.VolumeHref(cloudID, volumeID), "volume_attachment[volume_href]", postParams);
            Utility.addParameter(device, "volume_attachment[device]", postParams);
            string outString = string.Empty;

            List <string> retVal = Core.APIClient.Instance.Post(postHref, postParams, "location", out outString);

            return(retVal.Last <string>().Split('/').Last <string>());
        }