Пример #1
0
        public async Task <bool> UpdateProjectLogInStorage(TableStorageConfiguration tableStorageConfig, ProjectLog log)
        {
            AzureStorageTableModel newItem = new AzureStorageTableModel(log.PartitionKey, log.RowKey, log.Json);
            TableStorageCommonDA   tableDA = new TableStorageCommonDA(tableStorageConfig, tableStorageConfig.TableLog);

            return(await tableDA.SaveItem(newItem));
        }
Пример #2
0
        public async Task <bool> UpdateGitHubSettingInStorage(TableStorageConfiguration tableStorageConfig, string settingsTable,
                                                              string owner, string repo, string branch, string workflowName, string workflowId, string resourceGroupName,
                                                              int itemOrder, bool showSetting)
        {
            string         partitionKey = "GitHubSettings";
            string         rowKey       = PartitionKeys.CreateGitHubSettingsPartitionKey(owner, repo);
            GitHubSettings settings     = new GitHubSettings
            {
                RowKey                  = rowKey,
                Owner                   = owner,
                Repo                    = repo,
                Branch                  = branch,
                WorkflowName            = workflowName,
                WorkflowId              = workflowId,
                ProductionResourceGroup = resourceGroupName,
                ItemOrder               = itemOrder,
                ShowSetting             = showSetting
            };

            string json = JsonConvert.SerializeObject(settings);
            AzureStorageTableModel newItem = new AzureStorageTableModel(partitionKey, rowKey, json);
            TableStorageCommonDA   tableDA = new TableStorageCommonDA(tableStorageConfig, settingsTable);

            return(await tableDA.SaveItem(newItem));
        }
Пример #3
0
        public async Task <bool> UpdateAzureDevOpsSettingInStorage(TableStorageConfiguration tableStorageConfig, string settingsTable,
                                                                   string organization, string project, string repository, string branch, string buildName, string buildId, string resourceGroupName,
                                                                   int itemOrder, bool showSetting)
        {
            string partitionKey = "AzureDevOpsSettings";
            string rowKey       = PartitionKeys.CreateAzureDevOpsSettingsPartitionKey(organization, project, repository);

            AzureDevOpsSettings settings = new AzureDevOpsSettings
            {
                RowKey                  = rowKey,
                Organization            = organization,
                Project                 = project,
                Repository              = repository,
                Branch                  = branch,
                BuildName               = buildName,
                BuildId                 = buildId,
                ProductionResourceGroup = resourceGroupName,
                ItemOrder               = itemOrder,
                ShowSetting             = showSetting
            };

            string json = JsonConvert.SerializeObject(settings);
            AzureStorageTableModel newItem = new AzureStorageTableModel(partitionKey, rowKey, json);
            TableStorageCommonDA   tableDA = new TableStorageCommonDA(tableStorageConfig, settingsTable);

            return(await tableDA.SaveItem(newItem));
        }
Пример #4
0
        public async Task <bool> UpdateDevOpsMonitoringEventInStorage(TableStorageConfiguration tableStorageConfig, MonitoringEvent monitoringEvent)
        {
            string partitionKey            = monitoringEvent.PartitionKey;
            string rowKey                  = monitoringEvent.RowKey;
            string json                    = monitoringEvent.RequestBody;
            AzureStorageTableModel newItem = new AzureStorageTableModel(partitionKey, rowKey, json);
            TableStorageCommonDA   tableDA = new TableStorageCommonDA(tableStorageConfig, tableStorageConfig.TableMTTR);

            return(await tableDA.SaveItem(newItem));
        }