// 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 createNewsReportDetails = {
name: "EXAMPLE-name-Value",
newsFrequency: opsi.models.NewsFrequency.Weekly,
description: "EXAMPLE-description-Value",
onsTopicId: "ocid1.test.oc1..<unique_ID>EXAMPLE-onsTopicId-Value",
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
freeformTags: {
EXAMPLE_KEY_ook98 :"EXAMPLE_VALUE_KW7fyEW8k4HoXUnDIDz0"
},
definedTags: {
EXAMPLE_KEY_9nzsE :{
EXAMPLE_KEY_Z0i3R :"EXAMPLE--Value"
}
},
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 ],
}
,
locale: opsi.models.NewsLocale.En,
status: opsi.models.ResourceStatus.Terminated,
dayOfWeek: opsi.models.DayOfWeek.Sunday,
areChildCompartmentsIncluded: true,
tagFilters: ["EXAMPLE--Value" ],
matchRule: opsi.models.MatchRule.MatchNone,
}
const createNewsReportRequest: opsi.requests.CreateNewsReportRequest = {
createNewsReportDetails: createNewsReportDetails,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
opcRequestId: "PFU91MBEPBD4XE9O7JD5<unique_ID>",
};
// Send request to the Client.
const createNewsReportResponse = await client.createNewsReport(createNewsReportRequest);
}
catch (error) {
console.log("createNewsReport Failed with error " + error);
}
})();