Exemplo n.º 1
0
        public virtual PSDataFactoryGateway PatchGateway(string resourceGroupName, string dataFactoryName, PSDataFactoryGateway gateway)
        {
            if (gateway == null)
            {
                throw new ArgumentNullException("gateway");
            }

            var response = DataPipelineManagementClient.Gateways.Update(
                resourceGroupName, dataFactoryName, new GatewayCreateOrUpdateParameters {
                Gateway = gateway.ToGatewayDefinition()
            });

            return(new PSDataFactoryGateway(response.Gateway));
        }
Exemplo n.º 2
0
        public virtual PSDataFactoryGateway CreateOrUpdateGateway(string resourceGroupName, string dataFactoryName, PSDataFactoryGateway gateway)
        {
            if (gateway == null)
            {
                throw new ArgumentNullException("gateway");
            }

            var response = DataPipelineManagementClient.Gateways.CreateOrUpdate(
                resourceGroupName, dataFactoryName, new GatewayCreateOrUpdateParameters {
                Gateway = gateway.ToGatewayDefinition()
            });

            Gateway createdGateway = response.Gateway;

            if (createdGateway.Properties != null &&
                !DataFactoryCommonUtilities.IsSucceededProvisioningState(createdGateway.Properties.ProvisioningState))
            {
                // ToDo: service side should set the error message for provisioning failures.
                throw new ProvisioningFailedException(Resources.GatewayProvisioningFailed);
            }

            return(new PSDataFactoryGateway(createdGateway));
        }