Beispiel #1
0
        protected void ExecuteAvailabilitySetDeleteMethod(object[] invokeMethodInputParameters)
        {
            string resourceGroupName   = (string)ParseParameter(invokeMethodInputParameters[0]);
            string availabilitySetName = (string)ParseParameter(invokeMethodInputParameters[1]);

            AvailabilitySetsClient.Delete(resourceGroupName, availabilitySetName);
        }
Beispiel #2
0
        protected void ExecuteAvailabilitySetListMethod(object[] invokeMethodInputParameters)
        {
            string resourceGroupName = (string)ParseParameter(invokeMethodInputParameters[0]);

            var result = AvailabilitySetsClient.List(resourceGroupName);

            WriteObject(result);
        }
        protected void ExecuteAvailabilitySetUpdateMethod(object[] invokeMethodInputParameters)
        {
            string resourceGroupName         = (string)ParseParameter(invokeMethodInputParameters[0]);
            string availabilitySetName       = (string)ParseParameter(invokeMethodInputParameters[1]);
            AvailabilitySetUpdate parameters = (AvailabilitySetUpdate)ParseParameter(invokeMethodInputParameters[2]);

            var result = AvailabilitySetsClient.Update(resourceGroupName, availabilitySetName, parameters);

            WriteObject(result);
        }
        protected void ExecuteAvailabilitySetGetMethod(object[] invokeMethodInputParameters)
        {
            string resourceGroupName   = (string)ParseParameter(invokeMethodInputParameters[0]);
            string availabilitySetName = (string)ParseParameter(invokeMethodInputParameters[1]);

            if (!string.IsNullOrEmpty(resourceGroupName) && !string.IsNullOrEmpty(availabilitySetName))
            {
                var result = AvailabilitySetsClient.Get(resourceGroupName, availabilitySetName);
                WriteObject(result);
            }
            else if (!string.IsNullOrEmpty(resourceGroupName))
            {
                var result     = AvailabilitySetsClient.List(resourceGroupName);
                var resultList = result.ToList();
                WriteObject(resultList, true);
            }
        }
Beispiel #5
0
        protected void ExecuteAvailabilitySetGetMethod(object[] invokeMethodInputParameters)
        {
            string resourceGroupName   = (string)ParseParameter(invokeMethodInputParameters[0]);
            string availabilitySetName = (string)ParseParameter(invokeMethodInputParameters[1]);

            if (!string.IsNullOrEmpty(resourceGroupName) && !string.IsNullOrEmpty(availabilitySetName))
            {
                var result   = AvailabilitySetsClient.Get(resourceGroupName, availabilitySetName);
                var psObject = new PSAvailabilitySet();
                Mapper.Map <AvailabilitySet, PSAvailabilitySet>(result, psObject);
                WriteObject(psObject);
            }
            else if (!string.IsNullOrEmpty(resourceGroupName))
            {
                var result   = AvailabilitySetsClient.List(resourceGroupName);
                var psObject = new List <PSAvailabilitySetList>();
                foreach (var r in result)
                {
                    psObject.Add(Mapper.Map <AvailabilitySet, PSAvailabilitySetList>(r));
                }
                WriteObject(psObject);
            }
        }