public override void ExecuteCmdlet()
        {
            PSDataSource dataSource = OperationalInsightsClient.GetSingletonDataSource(
                this.ResourceGroupName,
                this.WorkspaceName,
                PSDataSourceKinds.LinuxSyslogCollection);

            if (null == dataSource)
            {
                var dsProperties = new PSLinuxSyslogCollectionDataSourceProperties
                {
                    State = CollectionState.Disabled
                };

                CreatePSDataSourceWithProperties(dsProperties, Resources.SingletonDataSourceLinuxSyslogCollectionDefaultName);
            }
            else
            {
                PSLinuxSyslogCollectionDataSourceProperties dsProperties = dataSource.Properties as PSLinuxSyslogCollectionDataSourceProperties;
                dsProperties.State = CollectionState.Disabled;
                UpdatePSDataSourceParameters parameters = new UpdatePSDataSourceParameters
                {
                    ResourceGroupName = dataSource.ResourceGroupName,
                    WorkspaceName     = dataSource.WorkspaceName,
                    Name       = dataSource.Name,
                    Properties = dsProperties
                };
                WriteObject(OperationalInsightsClient.UpdatePSDataSource(parameters));
            }
        }
Beispiel #2
0
        public override void ExecuteCmdlet()
        {
            UpdatePSDataSourceParameters parameters = new UpdatePSDataSourceParameters
            {
                ResourceGroupName = DataSource.ResourceGroupName,
                WorkspaceName     = DataSource.WorkspaceName,
                Name       = DataSource.Name,
                Properties = DataSource.Properties
            };

            WriteObject(OperationalInsightsClient.UpdatePSDataSource(parameters));
        }