Example #1
0
        /// <summary>
        /// Strategy: create a Patch containing all of the fields in the connectedSystemItem
        /// </summary>
        /// <param name="dataSet"></param>
        /// <param name="connectedSystemItem"></param>
        /// <returns></returns>
        /// <exception cref="NotSupportedException"></exception>
        internal override Task UpdateOutwardsAsync(
            ConnectedSystemDataSet dataSet,
            SyncAction syncAction,
            CancellationToken cancellationToken)
        {
            var endpoint = new SubstitutionString(
                dataSet.QueryConfig.UpdateQuery
                ?? dataSet.QueryConfig.Query
                ?? throw new ConfigurationException($"In {nameof(ConnectedSystemDataSet)} {dataSet.Name}, one of {nameof(dataSet.QueryConfig.UpdateQuery)} or {nameof(dataSet.QueryConfig.Query)} must be set.")
                ).ToString();

            return(_logicMonitorClient.PutAsync(endpoint, syncAction.ConnectedSystemItem, cancellationToken));
        }
Example #2
0
        /// <inheritdoc />
        internal async override Task UpdateOutwardsAsync(
            ConnectedSystemDataSet dataSet,
            SyncAction syncAction,
            CancellationToken cancellationToken
            )
        {
            if (syncAction.ConnectedSystemItem == null)
            {
                throw new InvalidOperationException($"{nameof(syncAction.ConnectedSystemItem)} must not be null when Updating Outwards.");
            }

            // Handle simple update
            await _serviceNowClient
            .UpdateAsync(
                dataSet.QueryConfig?.Type ?? throw new ConfigurationException($"DataSet {dataSet.Name} is missing a type"),
                syncAction.ConnectedSystemItem,
                cancellationToken)
            .ConfigureAwait(false);
        }
Example #3
0
        /// <inheritdoc />
        internal async override Task UpdateOutwardsAsync(
            ConnectedSystemDataSet dataSet,
            SyncAction syncAction,
            CancellationToken cancellationToken
            )
        {
            if (syncAction.ConnectedSystemItem == null)
            {
                throw new InvalidOperationException($"{nameof(syncAction.ConnectedSystemItem)} must not be null when Updating Outwards.");
            }

            throw new NotImplementedException();
            // Handle simple update
            //await _jiraClient
            //	.Issues.UpdateIssueAsync(
            //		new Issue() { Key = syncAction["id"].ToString()},
            //	cancellationToken)
            //	.ConfigureAwait(false);
        }
Example #4
0
 /// <inheritdoc />
 internal override Task UpdateOutwardsAsync(ConnectedSystemDataSet dataSet, SyncAction syncAction, CancellationToken cancellationToken)
 => throw new NotSupportedException();