Esempio n. 1
0
        /// <summary>
        /// Detach a Block Storage volume to a Droplet by name
        /// </summary>
        public Task <Action> DetachByName(string volumeName, int dropletId, string volumeRegion)
        {
            var body = new Models.Requests.VolumeAction {
                Type       = "detach",
                DropletId  = dropletId,
                VolumeName = volumeName,
                Region     = volumeRegion
            };

            return(_connection.ExecuteRequest <Action>("volumes/actions", null, body, "action", Method.POST));
        }
Esempio n. 2
0
        /// <summary>
        /// Detach a Block Storage volume to a Droplet
        /// </summary>
        public Task <Action> Detach(string volumeId, int dropletId, string volumeRegion)
        {
            var parameters = new List <Parameter> {
                new Parameter("id", volumeId, ParameterType.UrlSegment)
            };
            var body = new Models.Requests.VolumeAction {
                Type      = "detach",
                DropletId = dropletId,
                Region    = volumeRegion
            };

            return(_connection.ExecuteRequest <Action>("volumes/{id}/actions", parameters, body, "action", Method.POST));
        }
Esempio n. 3
0
        /// <summary>
        /// Resize a Block Storage volume
        /// </summary>
        public Task <Action> Resize(string volumeId, int sizeGigabytes, string volumeRegion)
        {
            var parameters = new List <Parameter> {
                new Parameter("id", volumeId, ParameterType.UrlSegment)
            };
            var body = new Models.Requests.VolumeAction {
                Type          = "resize",
                SizeGigabytes = sizeGigabytes,
                Region        = volumeRegion
            };

            return(_connection.ExecuteRequest <Action>("volumes/{id}/actions", parameters, body, "action", Method.POST));
        }