/// <summary>
        /// Allows updating properties of a host object
        /// </summary>
        /// <param name="hostGuid">
        /// The unique identifier of the host to update
        /// </param>
        /// <param name="input">
        /// An input object to update host properties
        /// </param>
        /// <returns>Updated host</returns>
        public Host UpdateHost(
            Guid hostGuid,
            UpdateHostInput input)
        {
            // setup parameter
            GraphQLParameters parameters = new GraphQLParameters();

            parameters.Add(@"uuid", hostGuid, false);
            parameters.Add(@"input", input, false);

            return(RunMutation <Host>(@"updateHost", parameters));
        }
예제 #2
0
        /// <summary>
        /// Performs execution of the command
        /// </summary>
        protected override void ProcessRecord()
        {
            // build input object for the NebSharp call
            UpdateHostInput input = new UpdateHostInput();

            if (ParameterPresent("Name"))
            {
                input.Name = Name;
            }

            if (ParameterPresent("RackGuid"))
            {
                input.RackGuid = RackGuid;
            }

            if (ParameterPresent("Note"))
            {
                input.Note = Note;
            }

            Host updatedNebHost = Connection.UpdateHost(Guid, input);

            WriteObject(updatedNebHost);
        }