コード例 #1
0
        public override void ExecuteCmdlet()
        {
            ByResourceId();

            string rawJsonContent = DataFactoryClient.ReadJsonFileContent(this.TryResolvePath(DefinitionFile));

            CreatePSAdfEntityParameters parameters = new CreatePSAdfEntityParameters
            {
                ResourceGroupName = ResourceGroupName,
                DataFactoryName   = DataFactoryName,
                Name           = Name,
                RawJsonContent = rawJsonContent,
                Force          = Force.IsPresent,
                ConfirmAction  = ConfirmAction
            };

            WriteObject(DataFactoryClient.CreatePSDataset(parameters));
        }
コード例 #2
0
        public override void ExecuteCmdlet()
        {
            ByResourceId();

            string rawJsonContent = DataFactoryClient.ReadJsonFileContent(this.TryResolvePath(DefinitionFile));

            CreatePSAdfEntityParameters parameters = new CreatePSAdfEntityParameters
            {
                ResourceGroupName = ResourceGroupName,
                DataFactoryName   = DataFactoryName,
                Name           = Name,
                RawJsonContent = rawJsonContent,
                Force          = Force.IsPresent,
                ConfirmAction  = ConfirmAction
            };

            if (ShouldProcess(Name, string.Format(Constants.HelpDataFlowCreationContext, this.Name, this.ResourceGroupName, this.DataFactoryName)))
            {
                WriteObject(DataFactoryClient.CreatePSDataFlow(parameters));
            }
        }
コード例 #3
0
        public virtual PSPipeline CreatePSPipeline(CreatePSAdfEntityParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            PSPipeline pipeline       = null;
            Action     createPipeline = () =>
            {
                pipeline =
                    new PSPipeline(CreateOrUpdatePipeline(parameters.ResourceGroupName,
                                                          parameters.DataFactoryName,
                                                          parameters.Name,
                                                          parameters.RawJsonContent), parameters.ResourceGroupName,
                                   parameters.DataFactoryName
                                   );
            };


            parameters.ConfirmAction(
                parameters.Force,      // prompt only if the linked service exists
                string.Format(
                    CultureInfo.InvariantCulture,
                    Resources.PipelineExists,
                    parameters.Name,
                    parameters.DataFactoryName),
                string.Format(
                    CultureInfo.InvariantCulture,
                    Resources.PipelineCreating,
                    parameters.Name,
                    parameters.DataFactoryName),
                parameters.Name,
                createPipeline,
                () => CheckPipelineExists(parameters.ResourceGroupName,
                                          parameters.DataFactoryName, parameters.Name));

            return(pipeline);
        }
コード例 #4
0
        public virtual PSDataset CreatePSDataset(CreatePSAdfEntityParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            PSDataset dataset       = null;
            Action    createDataset = () =>
            {
                dataset =
                    new PSDataset(this.CreateOrUpdateDataset(
                                      parameters.ResourceGroupName,
                                      parameters.DataFactoryName,
                                      parameters.Name,
                                      parameters.RawJsonContent), parameters.ResourceGroupName,
                                  parameters.DataFactoryName
                                  );
            };

            parameters.ConfirmAction(
                parameters.Force,  // prompt only if the dataset exists
                string.Format(
                    CultureInfo.InvariantCulture,
                    Resources.DatasetExists,
                    parameters.Name,
                    parameters.DataFactoryName),
                string.Format(
                    CultureInfo.InvariantCulture,
                    Resources.DatasetCreating,
                    parameters.Name,
                    parameters.DataFactoryName),
                parameters.Name,
                createDataset,
                () => this.CheckDatasetExists(parameters.ResourceGroupName, parameters.DataFactoryName,
                                              parameters.Name));

            return(dataset);
        }