Microsoft.Azure.Commands.DataFactories.DataFactoryClient.ListGateways C# (CSharp) Method

ListGateways() public method

public ListGateways ( string resourceGroupName, string dataFactoryName ) : List
resourceGroupName string
dataFactoryName string
return List
        public virtual List<PSDataFactoryGateway> ListGateways(string resourceGroupName, string dataFactoryName)
        {
            var response = DataPipelineManagementClient.Gateways.List(resourceGroupName, dataFactoryName);

            return response.Gateways.Select(gateway => new PSDataFactoryGateway(gateway)).ToList();
        }

Usage Example

Exemplo n.º 1
0
        public override void ExecuteCmdlet()
        {
            if (ParameterSetName == ByFactoryObject)
            {
                if (DataFactory == null)
                {
                    throw new PSArgumentNullException(string.Format(CultureInfo.InvariantCulture, Resources.DataFactoryArgumentInvalid));
                }

                DataFactoryName   = DataFactory.DataFactoryName;
                ResourceGroupName = DataFactory.ResourceGroupName;
            }

            if (String.IsNullOrWhiteSpace(Name))
            {
                IEnumerable <PSDataFactoryGateway> gateways = DataFactoryClient.ListGateways(ResourceGroupName, DataFactoryName);
                WriteObject(gateways, true);
            }
            else
            {
                PSDataFactoryGateway gateway = DataFactoryClient.GetGateway(ResourceGroupName, DataFactoryName, Name);
                WriteObject(gateway);
            }
        }