// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).
import * as opsi from "oci-opsi";
import common = require("oci-common");
// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();
(async () => {
try {
// Create a service client
const client = new opsi.OperationsInsightsClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const updateNewsReportDetails = {
status: opsi.models.ResourceStatus.Disabled,
newsFrequency: opsi.models.NewsFrequency.Weekly,
locale: opsi.models.NewsLocale.En,
contentTypes: {
capacityPlanningResources: [opsi.models.NewsContentTypesResource.Host,opsi.models.NewsContentTypesResource.Database,opsi.models.NewsContentTypesResource.Exadata ],
sqlInsightsFleetAnalysisResources: [opsi.models.NewsSqlInsightsContentTypesResource.Database,opsi.models.NewsSqlInsightsContentTypesResource.Exadata ],
sqlInsightsPlanChangesResources: [opsi.models.NewsSqlInsightsContentTypesResource.Database,opsi.models.NewsSqlInsightsContentTypesResource.Exadata ],
sqlInsightsTopDatabasesResources: [opsi.models.NewsSqlInsightsContentTypesResource.Database,opsi.models.NewsSqlInsightsContentTypesResource.Exadata ],
sqlInsightsTopSqlByInsightsResources: [opsi.models.NewsSqlInsightsContentTypesResource.Database,opsi.models.NewsSqlInsightsContentTypesResource.Exadata ],
sqlInsightsTopSqlResources: [opsi.models.NewsSqlInsightsContentTypesResource.Database,opsi.models.NewsSqlInsightsContentTypesResource.Exadata ],
sqlInsightsPerformanceDegradationResources: [opsi.models.NewsSqlInsightsContentTypesResource.Database,opsi.models.NewsSqlInsightsContentTypesResource.Exadata ],
actionableInsightsResources: [opsi.models.ActionableInsightsContentTypesResource.NewHighs,opsi.models.ActionableInsightsContentTypesResource.BigChanges,opsi.models.ActionableInsightsContentTypesResource.CurrentInventory,opsi.models.ActionableInsightsContentTypesResource.InventoryChanges,opsi.models.ActionableInsightsContentTypesResource.FleetStatistics,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisSummaryDbCount,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisSummarySqlAnalyzedCount,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisSummaryNewSqlCount,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisSummaryBusiestDb,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisDegradingSqlCount,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisDegradingSqlByDb,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisDegradingSqlBySqlId,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisPlanChangesCount,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisPlanChangesDbMostChanges,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisPlanChangesBySqlIdImproved,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisPlanChangesBySqlIdDegraded,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisInvalidationStormsCount,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisInvalidationStormsHighest,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisCursorSharingIssuesCount,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisCursorSharingIssuesByDb,opsi.models.ActionableInsightsContentTypesResource.FleetAnalysisCursorSharingIssuesBySql,opsi.models.ActionableInsightsContentTypesResource.PerformanceDegradationSummaryDbCount,opsi.models.ActionableInsightsContentTypesResource.PerformanceDegradationSummarySqlAnalyzedCount,opsi.models.ActionableInsightsContentTypesResource.PerformanceDegradationSummarySqlPerformanceTrendsCount,opsi.models.ActionableInsightsContentTypesResource.PerformanceDegradationSummaryDegradedSqlCount,opsi.models.ActionableInsightsContentTypesResource.PerformanceDegradationSummaryImprovedSqlCount,opsi.models.ActionableInsightsContentTypesResource.PerformanceDegradationDbDegradedCount,opsi.models.ActionableInsightsContentTypesResource.PerformanceDegradationSqlDegradedTable,opsi.models.ActionableInsightsContentTypesResource.PlanChangesSummaryDbCount,opsi.models.ActionableInsightsContentTypesResource.PlanChangesSummarySqlAnalyzedCount,opsi.models.ActionableInsightsContentTypesResource.PlanChangesSummaryPlanChangesCount,opsi.models.ActionableInsightsContentTypesResource.PlanChangesSummaryImprovementsCount,opsi.models.ActionableInsightsContentTypesResource.PlanChangesSummaryDegradationCount,opsi.models.ActionableInsightsContentTypesResource.PlanChangesTopPlanChangesTable,opsi.models.ActionableInsightsContentTypesResource.TopDbSummaryDbCount,opsi.models.ActionableInsightsContentTypesResource.TopDbSummarySqlAnalyzedCount,opsi.models.ActionableInsightsContentTypesResource.TopDbSummaryBusiestDb,opsi.models.ActionableInsightsContentTypesResource.TopTable,opsi.models.ActionableInsightsContentTypesResource.CollectionDelayCount,opsi.models.ActionableInsightsContentTypesResource.CollectionDelayPreviousWeekCount ],
}
,
onsTopicId: "ocid1.test.oc1..<unique_ID>EXAMPLE-onsTopicId-Value",
freeformTags: {
EXAMPLE_KEY_4lI20 :"EXAMPLE_VALUE_9eixDIALweNRptUAP93r"
},
definedTags: {
EXAMPLE_KEY_KMHrl :{
EXAMPLE_KEY_bsbfi :"EXAMPLE--Value"
}
},
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value",
dayOfWeek: opsi.models.DayOfWeek.Thursday,
areChildCompartmentsIncluded: true,
tagFilters: ["EXAMPLE--Value" ],
matchRule: opsi.models.MatchRule.MatchNone,
}
const updateNewsReportRequest: opsi.requests.UpdateNewsReportRequest = {
newsReportId: "ocid1.test.oc1..<unique_ID>EXAMPLE-newsReportId-Value",
updateNewsReportDetails: updateNewsReportDetails,
ifMatch: "EXAMPLE-ifMatch-Value",
opcRequestId: "CQQFBXF6YRRXXAMQTC3I<unique_ID>",
};
// Send request to the Client.
const updateNewsReportResponse = await client.updateNewsReport(updateNewsReportRequest);
}
catch (error) {
console.log("updateNewsReport Failed with error " + error);
}
})();