diff --git a/CHANGELOG.md b/CHANGELOG.md index 807c567d0b..84d5054c45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.63.1 - 2024-04-09 +### Added +- Support for calling Oracle Cloud Infrastructure services in the ap-dcc-gazipur-1 region +- Support for the DNS-based backend health check in the Network Load Balancer service +- Support for Fail Open in the Network Load Balancer service +- Support for adding and updating Instant failover in the Network Load Balancer service +- Support for adding and updating source type and resource category for resource types in the Stack Monitoring service +- Support for searching resources based on resource category, source type, multiple compartments, multiple lifecycle states in the Stack Monitoring service +- Support for filtering listed resources based on lifecycle status in the Stack Monitoring service +- Support for creating tasks with new config parameters in the Stack Monitoring service +- Support for Composite Resource Principal integration in the Data Flow service + + ## 65.63.0 - 2024-04-02 ### Added - Support for assigned private IP and single stack IPV6 feature for Network Load Balancer Service diff --git a/applicationmigration/applicationmigration_client.go b/applicationmigration/applicationmigration_client.go index bceb352d20..d2ad98a632 100644 --- a/applicationmigration/applicationmigration_client.go +++ b/applicationmigration/applicationmigration_client.go @@ -144,7 +144,7 @@ func (client ApplicationMigrationClient) cancelWorkRequest(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/WorkRequest/CancelWorkRequest" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "CancelWorkRequest", apiReferenceLink) return response, err } @@ -207,7 +207,7 @@ func (client ApplicationMigrationClient) changeMigrationCompartment(ctx context. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/Migration/ChangeMigrationCompartment" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "ChangeMigrationCompartment", apiReferenceLink) return response, err } @@ -270,7 +270,7 @@ func (client ApplicationMigrationClient) changeSourceCompartment(ctx context.Con defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/Source/ChangeSourceCompartment" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "ChangeSourceCompartment", apiReferenceLink) return response, err } @@ -482,7 +482,7 @@ func (client ApplicationMigrationClient) deleteMigration(ctx context.Context, re defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/Migration/DeleteMigration" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "DeleteMigration", apiReferenceLink) return response, err } @@ -542,7 +542,7 @@ func (client ApplicationMigrationClient) deleteSource(ctx context.Context, reque defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/Source/DeleteSource" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "DeleteSource", apiReferenceLink) return response, err } @@ -599,7 +599,7 @@ func (client ApplicationMigrationClient) getMigration(ctx context.Context, reque defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/Migration/GetMigration" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "GetMigration", apiReferenceLink) return response, err } @@ -656,7 +656,7 @@ func (client ApplicationMigrationClient) getSource(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/Source/GetSource" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "GetSource", apiReferenceLink) return response, err } @@ -713,7 +713,7 @@ func (client ApplicationMigrationClient) getWorkRequest(ctx context.Context, req defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/WorkRequest/GetWorkRequest" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "GetWorkRequest", apiReferenceLink) return response, err } @@ -770,7 +770,7 @@ func (client ApplicationMigrationClient) listMigrations(ctx context.Context, req defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/MigrationSummary/ListMigrations" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "ListMigrations", apiReferenceLink) return response, err } @@ -829,7 +829,7 @@ func (client ApplicationMigrationClient) listSourceApplications(ctx context.Cont defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/SourceApplicationSummary/ListSourceApplications" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "ListSourceApplications", apiReferenceLink) return response, err } @@ -889,7 +889,7 @@ func (client ApplicationMigrationClient) listSources(ctx context.Context, reques defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/SourceSummary/ListSources" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "ListSources", apiReferenceLink) return response, err } @@ -946,7 +946,7 @@ func (client ApplicationMigrationClient) listWorkRequestErrors(ctx context.Conte defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/WorkRequestError/ListWorkRequestErrors" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "ListWorkRequestErrors", apiReferenceLink) return response, err } @@ -1003,7 +1003,7 @@ func (client ApplicationMigrationClient) listWorkRequestLogs(ctx context.Context defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/WorkRequestLogEntry/ListWorkRequestLogs" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "ListWorkRequestLogs", apiReferenceLink) return response, err } @@ -1060,7 +1060,7 @@ func (client ApplicationMigrationClient) listWorkRequests(ctx context.Context, r defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/WorkRequestSummary/ListWorkRequests" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "ListWorkRequests", apiReferenceLink) return response, err } @@ -1129,7 +1129,7 @@ func (client ApplicationMigrationClient) migrateApplication(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/Migration/MigrateApplication" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "MigrateApplication", apiReferenceLink) return response, err } @@ -1213,7 +1213,7 @@ func (client ApplicationMigrationClient) updateMigration(ctx context.Context, re defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/Migration/UpdateMigration" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "UpdateMigration", apiReferenceLink) return response, err } @@ -1272,7 +1272,7 @@ func (client ApplicationMigrationClient) updateSource(ctx context.Context, reque defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/applicationmigration/20191031/Source/UpdateSource" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "ApplicationMigration", "UpdateSource", apiReferenceLink) return response, err } diff --git a/common/regions.go b/common/regions.go index 9e507f4c5c..274c44d5c9 100644 --- a/common/regions.go +++ b/common/regions.go @@ -114,6 +114,8 @@ const ( RegionEUDccRating1 Region = "eu-dcc-rating-1" //RegionEUDccDublin1 region Dublin RegionEUDccDublin1 Region = "eu-dcc-dublin-1" + //RegionAPDccGazipur1 region Gazipur + RegionAPDccGazipur1 Region = "ap-dcc-gazipur-1" //RegionEUMadrid2 region Madrid RegionEUMadrid2 Region = "eu-madrid-2" //RegionEUFrankfurt2 region Frankfurt @@ -184,6 +186,7 @@ var shortNameRegion = map[string]Region{ "dtm": RegionEUDccRating2, "dus": RegionEUDccRating1, "ork": RegionEUDccDublin1, + "dac": RegionAPDccGazipur1, "vll": RegionEUMadrid2, "str": RegionEUFrankfurt2, "beg": RegionEUJovanovac1, @@ -201,6 +204,7 @@ var realm = map[string]string{ "oc9": "oraclecloud9.com", "oc10": "oraclecloud10.com", "oc14": "oraclecloud14.com", + "oc15": "oraclecloud15.com", "oc19": "oraclecloud.eu", "oc20": "oraclecloud20.com", "oc21": "oraclecloud21.com", @@ -272,6 +276,8 @@ var regionRealm = map[Region]string{ RegionEUDccRating1: "oc14", RegionEUDccDublin1: "oc14", + RegionAPDccGazipur1: "oc15", + RegionEUMadrid2: "oc19", RegionEUFrankfurt2: "oc19", diff --git a/common/regions.json b/common/regions.json index 1fd384971f..6bb858e393 100644 --- a/common/regions.json +++ b/common/regions.json @@ -364,5 +364,11 @@ "realmKey": "oc26", "regionIdentifier": "me-abudhabi-3", "realmDomainComponent": "oraclecloud26.com" + }, + { + "regionKey": "dac", + "realmKey": "oc15", + "regionIdentifier": "ap-dcc-gazipur-1", + "realmDomainComponent": "oraclecloud15.com" } ] \ No newline at end of file diff --git a/common/version.go b/common/version.go index 0a721a5d8f..a367efe07e 100644 --- a/common/version.go +++ b/common/version.go @@ -13,7 +13,7 @@ import ( const ( major = "65" minor = "63" - patch = "0" + patch = "1" tag = "" ) diff --git a/dataflow/create_run_request_response.go b/dataflow/create_run_request_response.go index 6f13f28733..e6924ab362 100644 --- a/dataflow/create_run_request_response.go +++ b/dataflow/create_run_request_response.go @@ -31,6 +31,10 @@ type CreateRunRequest struct { // Otherwise, a random request ID will be generated by the service. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // (Optional header param, required for Resource Principal version 3.0+) + // Parent resource control plane endpoint used to exchange for upper level resource principal token. + OpcParentRptUrl *string `mandatory:"false" contributesTo:"header" name:"opc-parent-rpt-url"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/dataflow/list_sql_endpoints_request_response.go b/dataflow/list_sql_endpoints_request_response.go index 8d4f703851..c214a20593 100644 --- a/dataflow/list_sql_endpoints_request_response.go +++ b/dataflow/list_sql_endpoints_request_response.go @@ -129,27 +129,33 @@ type ListSqlEndpointsLifecycleStateEnum string // Set of constants representing the allowable values for ListSqlEndpointsLifecycleStateEnum const ( - ListSqlEndpointsLifecycleStateCreating ListSqlEndpointsLifecycleStateEnum = "CREATING" - ListSqlEndpointsLifecycleStateActive ListSqlEndpointsLifecycleStateEnum = "ACTIVE" - ListSqlEndpointsLifecycleStateDeleting ListSqlEndpointsLifecycleStateEnum = "DELETING" - ListSqlEndpointsLifecycleStateDeleted ListSqlEndpointsLifecycleStateEnum = "DELETED" - ListSqlEndpointsLifecycleStateFailed ListSqlEndpointsLifecycleStateEnum = "FAILED" + ListSqlEndpointsLifecycleStateCreating ListSqlEndpointsLifecycleStateEnum = "CREATING" + ListSqlEndpointsLifecycleStateActive ListSqlEndpointsLifecycleStateEnum = "ACTIVE" + ListSqlEndpointsLifecycleStateDeleting ListSqlEndpointsLifecycleStateEnum = "DELETING" + ListSqlEndpointsLifecycleStateDeleted ListSqlEndpointsLifecycleStateEnum = "DELETED" + ListSqlEndpointsLifecycleStateFailed ListSqlEndpointsLifecycleStateEnum = "FAILED" + ListSqlEndpointsLifecycleStateUpdating ListSqlEndpointsLifecycleStateEnum = "UPDATING" + ListSqlEndpointsLifecycleStateNeedsAttention ListSqlEndpointsLifecycleStateEnum = "NEEDS_ATTENTION" ) var mappingListSqlEndpointsLifecycleStateEnum = map[string]ListSqlEndpointsLifecycleStateEnum{ - "CREATING": ListSqlEndpointsLifecycleStateCreating, - "ACTIVE": ListSqlEndpointsLifecycleStateActive, - "DELETING": ListSqlEndpointsLifecycleStateDeleting, - "DELETED": ListSqlEndpointsLifecycleStateDeleted, - "FAILED": ListSqlEndpointsLifecycleStateFailed, + "CREATING": ListSqlEndpointsLifecycleStateCreating, + "ACTIVE": ListSqlEndpointsLifecycleStateActive, + "DELETING": ListSqlEndpointsLifecycleStateDeleting, + "DELETED": ListSqlEndpointsLifecycleStateDeleted, + "FAILED": ListSqlEndpointsLifecycleStateFailed, + "UPDATING": ListSqlEndpointsLifecycleStateUpdating, + "NEEDS_ATTENTION": ListSqlEndpointsLifecycleStateNeedsAttention, } var mappingListSqlEndpointsLifecycleStateEnumLowerCase = map[string]ListSqlEndpointsLifecycleStateEnum{ - "creating": ListSqlEndpointsLifecycleStateCreating, - "active": ListSqlEndpointsLifecycleStateActive, - "deleting": ListSqlEndpointsLifecycleStateDeleting, - "deleted": ListSqlEndpointsLifecycleStateDeleted, - "failed": ListSqlEndpointsLifecycleStateFailed, + "creating": ListSqlEndpointsLifecycleStateCreating, + "active": ListSqlEndpointsLifecycleStateActive, + "deleting": ListSqlEndpointsLifecycleStateDeleting, + "deleted": ListSqlEndpointsLifecycleStateDeleted, + "failed": ListSqlEndpointsLifecycleStateFailed, + "updating": ListSqlEndpointsLifecycleStateUpdating, + "needs_attention": ListSqlEndpointsLifecycleStateNeedsAttention, } // GetListSqlEndpointsLifecycleStateEnumValues Enumerates the set of values for ListSqlEndpointsLifecycleStateEnum @@ -169,6 +175,8 @@ func GetListSqlEndpointsLifecycleStateEnumStringValues() []string { "DELETING", "DELETED", "FAILED", + "UPDATING", + "NEEDS_ATTENTION", } } diff --git a/dataflow/sql_endpoint.go b/dataflow/sql_endpoint.go index 6fdd22df17..747a75940c 100644 --- a/dataflow/sql_endpoint.go +++ b/dataflow/sql_endpoint.go @@ -98,6 +98,9 @@ type SqlEndpoint struct { // not allowed to be overwritten will cause a 400 status to be returned. SparkAdvancedConfigurations map[string]string `mandatory:"false" json:"sparkAdvancedConfigurations"` + // The SQL Endpoint message displayed as a banner to provide user with any action items required on the resource. + BannerMessage *string `mandatory:"false" json:"bannerMessage"` + NetworkConfiguration SqlEndpointNetworkConfiguration `mandatory:"false" json:"networkConfiguration"` } @@ -135,6 +138,7 @@ func (m *SqlEndpoint) UnmarshalJSON(data []byte) (e error) { DefinedTags map[string]map[string]interface{} `json:"definedTags"` SystemTags map[string]map[string]interface{} `json:"systemTags"` SparkAdvancedConfigurations map[string]string `json:"sparkAdvancedConfigurations"` + BannerMessage *string `json:"bannerMessage"` NetworkConfiguration sqlendpointnetworkconfiguration `json:"networkConfiguration"` Id *string `json:"id"` DisplayName *string `json:"displayName"` @@ -179,6 +183,8 @@ func (m *SqlEndpoint) UnmarshalJSON(data []byte) (e error) { m.SparkAdvancedConfigurations = model.SparkAdvancedConfigurations + m.BannerMessage = model.BannerMessage + nn, e = model.NetworkConfiguration.UnmarshalPolymorphicJSON(model.NetworkConfiguration.JsonData) if e != nil { return diff --git a/dataflow/sql_endpoint_lifecycle_state.go b/dataflow/sql_endpoint_lifecycle_state.go index 75aac7b2d9..4a03047f3a 100644 --- a/dataflow/sql_endpoint_lifecycle_state.go +++ b/dataflow/sql_endpoint_lifecycle_state.go @@ -18,27 +18,33 @@ type SqlEndpointLifecycleStateEnum string // Set of constants representing the allowable values for SqlEndpointLifecycleStateEnum const ( - SqlEndpointLifecycleStateCreating SqlEndpointLifecycleStateEnum = "CREATING" - SqlEndpointLifecycleStateActive SqlEndpointLifecycleStateEnum = "ACTIVE" - SqlEndpointLifecycleStateDeleting SqlEndpointLifecycleStateEnum = "DELETING" - SqlEndpointLifecycleStateDeleted SqlEndpointLifecycleStateEnum = "DELETED" - SqlEndpointLifecycleStateFailed SqlEndpointLifecycleStateEnum = "FAILED" + SqlEndpointLifecycleStateCreating SqlEndpointLifecycleStateEnum = "CREATING" + SqlEndpointLifecycleStateActive SqlEndpointLifecycleStateEnum = "ACTIVE" + SqlEndpointLifecycleStateDeleting SqlEndpointLifecycleStateEnum = "DELETING" + SqlEndpointLifecycleStateDeleted SqlEndpointLifecycleStateEnum = "DELETED" + SqlEndpointLifecycleStateFailed SqlEndpointLifecycleStateEnum = "FAILED" + SqlEndpointLifecycleStateUpdating SqlEndpointLifecycleStateEnum = "UPDATING" + SqlEndpointLifecycleStateNeedsAttention SqlEndpointLifecycleStateEnum = "NEEDS_ATTENTION" ) var mappingSqlEndpointLifecycleStateEnum = map[string]SqlEndpointLifecycleStateEnum{ - "CREATING": SqlEndpointLifecycleStateCreating, - "ACTIVE": SqlEndpointLifecycleStateActive, - "DELETING": SqlEndpointLifecycleStateDeleting, - "DELETED": SqlEndpointLifecycleStateDeleted, - "FAILED": SqlEndpointLifecycleStateFailed, + "CREATING": SqlEndpointLifecycleStateCreating, + "ACTIVE": SqlEndpointLifecycleStateActive, + "DELETING": SqlEndpointLifecycleStateDeleting, + "DELETED": SqlEndpointLifecycleStateDeleted, + "FAILED": SqlEndpointLifecycleStateFailed, + "UPDATING": SqlEndpointLifecycleStateUpdating, + "NEEDS_ATTENTION": SqlEndpointLifecycleStateNeedsAttention, } var mappingSqlEndpointLifecycleStateEnumLowerCase = map[string]SqlEndpointLifecycleStateEnum{ - "creating": SqlEndpointLifecycleStateCreating, - "active": SqlEndpointLifecycleStateActive, - "deleting": SqlEndpointLifecycleStateDeleting, - "deleted": SqlEndpointLifecycleStateDeleted, - "failed": SqlEndpointLifecycleStateFailed, + "creating": SqlEndpointLifecycleStateCreating, + "active": SqlEndpointLifecycleStateActive, + "deleting": SqlEndpointLifecycleStateDeleting, + "deleted": SqlEndpointLifecycleStateDeleted, + "failed": SqlEndpointLifecycleStateFailed, + "updating": SqlEndpointLifecycleStateUpdating, + "needs_attention": SqlEndpointLifecycleStateNeedsAttention, } // GetSqlEndpointLifecycleStateEnumValues Enumerates the set of values for SqlEndpointLifecycleStateEnum @@ -58,6 +64,8 @@ func GetSqlEndpointLifecycleStateEnumStringValues() []string { "DELETING", "DELETED", "FAILED", + "UPDATING", + "NEEDS_ATTENTION", } } diff --git a/emaildataplane/emaildataplane_emaildp_client.go b/emaildataplane/emaildataplane_emaildp_client.go index 689616c9ae..813e48e445 100644 --- a/emaildataplane/emaildataplane_emaildp_client.go +++ b/emaildataplane/emaildataplane_emaildp_client.go @@ -141,7 +141,7 @@ func (client EmailDPClient) submitEmail(ctx context.Context, request common.OCIR defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/emaildeliverysubmission/20220926/EmailSubmittedResponse/SubmitEmail" err = common.PostProcessServiceError(err, "EmailDP", "SubmitEmail", apiReferenceLink) return response, err } diff --git a/networkloadbalancer/backend_set.go b/networkloadbalancer/backend_set.go index ec6e3aa27c..15002d63e9 100644 --- a/networkloadbalancer/backend_set.go +++ b/networkloadbalancer/backend_set.go @@ -38,6 +38,13 @@ type BackendSet struct { // The value is true by default. IsPreserveSource *bool `mandatory:"false" json:"isPreserveSource"` + // If enabled, the network load balancer will continue to distribute traffic in the configured distribution in the event all backends are unhealthy. + // The value is false by default. + IsFailOpen *bool `mandatory:"false" json:"isFailOpen"` + + // If enabled existing connections will be forwarded to an alternative healthy backend as soon as current backend becomes unhealthy. + IsInstantFailoverEnabled *bool `mandatory:"false" json:"isInstantFailoverEnabled"` + // IP version associated with the backend set. IpVersion IpVersionEnum `mandatory:"false" json:"ipVersion,omitempty"` diff --git a/networkloadbalancer/backend_set_details.go b/networkloadbalancer/backend_set_details.go index cb89b0921c..79bd185ba9 100644 --- a/networkloadbalancer/backend_set_details.go +++ b/networkloadbalancer/backend_set_details.go @@ -34,6 +34,13 @@ type BackendSetDetails struct { // The value is true by default. IsPreserveSource *bool `mandatory:"false" json:"isPreserveSource"` + // If enabled, the network load balancer will continue to distribute traffic in the configured distribution in the event all backends are unhealthy. + // The value is false by default. + IsFailOpen *bool `mandatory:"false" json:"isFailOpen"` + + // If enabled existing connections will be forwarded to an alternative healthy backend as soon as current backend becomes unhealthy. + IsInstantFailoverEnabled *bool `mandatory:"false" json:"isInstantFailoverEnabled"` + // An array of backends. Backends []Backend `mandatory:"false" json:"backends"` } diff --git a/networkloadbalancer/backend_set_summary.go b/networkloadbalancer/backend_set_summary.go index 67b419ee6c..452155cd8b 100644 --- a/networkloadbalancer/backend_set_summary.go +++ b/networkloadbalancer/backend_set_summary.go @@ -41,6 +41,13 @@ type BackendSetSummary struct { // The value is true by default. IsPreserveSource *bool `mandatory:"false" json:"isPreserveSource"` + // If enabled, the network load balancer will continue to distribute traffic in the configured distribution in the event all backends are unhealthy. + // The value is false by default. + IsFailOpen *bool `mandatory:"false" json:"isFailOpen"` + + // If enabled existing connections will be forwarded to an alternative healthy backend as soon as current backend becomes unhealthy. + IsInstantFailoverEnabled *bool `mandatory:"false" json:"isInstantFailoverEnabled"` + // IP version associated with the backend set. IpVersion IpVersionEnum `mandatory:"false" json:"ipVersion,omitempty"` } diff --git a/networkloadbalancer/create_backend_set_details.go b/networkloadbalancer/create_backend_set_details.go index 510d6e232f..13ff2069c3 100644 --- a/networkloadbalancer/create_backend_set_details.go +++ b/networkloadbalancer/create_backend_set_details.go @@ -38,6 +38,13 @@ type CreateBackendSetDetails struct { // The value is true by default. IsPreserveSource *bool `mandatory:"false" json:"isPreserveSource"` + // If enabled, the network load balancer will continue to distribute traffic in the configured distribution in the event all backends are unhealthy. + // The value is false by default. + IsFailOpen *bool `mandatory:"false" json:"isFailOpen"` + + // If enabled existing connections will be forwarded to an alternative healthy backend as soon as current backend becomes unhealthy. + IsInstantFailoverEnabled *bool `mandatory:"false" json:"isInstantFailoverEnabled"` + // IP version associated with the backend set. IpVersion IpVersionEnum `mandatory:"false" json:"ipVersion,omitempty"` diff --git a/networkloadbalancer/dns_health_check_query_classes.go b/networkloadbalancer/dns_health_check_query_classes.go new file mode 100644 index 0000000000..646318a7e7 --- /dev/null +++ b/networkloadbalancer/dns_health_check_query_classes.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// NetworkLoadBalancer API +// +// This describes the network load balancer API. +// + +package networkloadbalancer + +import ( + "strings" +) + +// DnsHealthCheckQueryClassesEnum Enum with underlying type: string +type DnsHealthCheckQueryClassesEnum string + +// Set of constants representing the allowable values for DnsHealthCheckQueryClassesEnum +const ( + DnsHealthCheckQueryClassesIn DnsHealthCheckQueryClassesEnum = "IN" + DnsHealthCheckQueryClassesCh DnsHealthCheckQueryClassesEnum = "CH" +) + +var mappingDnsHealthCheckQueryClassesEnum = map[string]DnsHealthCheckQueryClassesEnum{ + "IN": DnsHealthCheckQueryClassesIn, + "CH": DnsHealthCheckQueryClassesCh, +} + +var mappingDnsHealthCheckQueryClassesEnumLowerCase = map[string]DnsHealthCheckQueryClassesEnum{ + "in": DnsHealthCheckQueryClassesIn, + "ch": DnsHealthCheckQueryClassesCh, +} + +// GetDnsHealthCheckQueryClassesEnumValues Enumerates the set of values for DnsHealthCheckQueryClassesEnum +func GetDnsHealthCheckQueryClassesEnumValues() []DnsHealthCheckQueryClassesEnum { + values := make([]DnsHealthCheckQueryClassesEnum, 0) + for _, v := range mappingDnsHealthCheckQueryClassesEnum { + values = append(values, v) + } + return values +} + +// GetDnsHealthCheckQueryClassesEnumStringValues Enumerates the set of values in String for DnsHealthCheckQueryClassesEnum +func GetDnsHealthCheckQueryClassesEnumStringValues() []string { + return []string{ + "IN", + "CH", + } +} + +// GetMappingDnsHealthCheckQueryClassesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDnsHealthCheckQueryClassesEnum(val string) (DnsHealthCheckQueryClassesEnum, bool) { + enum, ok := mappingDnsHealthCheckQueryClassesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkloadbalancer/dns_health_check_query_types.go b/networkloadbalancer/dns_health_check_query_types.go new file mode 100644 index 0000000000..8c591f1411 --- /dev/null +++ b/networkloadbalancer/dns_health_check_query_types.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// NetworkLoadBalancer API +// +// This describes the network load balancer API. +// + +package networkloadbalancer + +import ( + "strings" +) + +// DnsHealthCheckQueryTypesEnum Enum with underlying type: string +type DnsHealthCheckQueryTypesEnum string + +// Set of constants representing the allowable values for DnsHealthCheckQueryTypesEnum +const ( + DnsHealthCheckQueryTypesA DnsHealthCheckQueryTypesEnum = "A" + DnsHealthCheckQueryTypesTxt DnsHealthCheckQueryTypesEnum = "TXT" + DnsHealthCheckQueryTypesAaaa DnsHealthCheckQueryTypesEnum = "AAAA" +) + +var mappingDnsHealthCheckQueryTypesEnum = map[string]DnsHealthCheckQueryTypesEnum{ + "A": DnsHealthCheckQueryTypesA, + "TXT": DnsHealthCheckQueryTypesTxt, + "AAAA": DnsHealthCheckQueryTypesAaaa, +} + +var mappingDnsHealthCheckQueryTypesEnumLowerCase = map[string]DnsHealthCheckQueryTypesEnum{ + "a": DnsHealthCheckQueryTypesA, + "txt": DnsHealthCheckQueryTypesTxt, + "aaaa": DnsHealthCheckQueryTypesAaaa, +} + +// GetDnsHealthCheckQueryTypesEnumValues Enumerates the set of values for DnsHealthCheckQueryTypesEnum +func GetDnsHealthCheckQueryTypesEnumValues() []DnsHealthCheckQueryTypesEnum { + values := make([]DnsHealthCheckQueryTypesEnum, 0) + for _, v := range mappingDnsHealthCheckQueryTypesEnum { + values = append(values, v) + } + return values +} + +// GetDnsHealthCheckQueryTypesEnumStringValues Enumerates the set of values in String for DnsHealthCheckQueryTypesEnum +func GetDnsHealthCheckQueryTypesEnumStringValues() []string { + return []string{ + "A", + "TXT", + "AAAA", + } +} + +// GetMappingDnsHealthCheckQueryTypesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDnsHealthCheckQueryTypesEnum(val string) (DnsHealthCheckQueryTypesEnum, bool) { + enum, ok := mappingDnsHealthCheckQueryTypesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkloadbalancer/dns_health_check_r_codes.go b/networkloadbalancer/dns_health_check_r_codes.go new file mode 100644 index 0000000000..d5a1702f1d --- /dev/null +++ b/networkloadbalancer/dns_health_check_r_codes.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// NetworkLoadBalancer API +// +// This describes the network load balancer API. +// + +package networkloadbalancer + +import ( + "strings" +) + +// DnsHealthCheckRCodesEnum Enum with underlying type: string +type DnsHealthCheckRCodesEnum string + +// Set of constants representing the allowable values for DnsHealthCheckRCodesEnum +const ( + DnsHealthCheckRCodesNoerror DnsHealthCheckRCodesEnum = "NOERROR" + DnsHealthCheckRCodesServfail DnsHealthCheckRCodesEnum = "SERVFAIL" + DnsHealthCheckRCodesNxdomain DnsHealthCheckRCodesEnum = "NXDOMAIN" + DnsHealthCheckRCodesRefused DnsHealthCheckRCodesEnum = "REFUSED" +) + +var mappingDnsHealthCheckRCodesEnum = map[string]DnsHealthCheckRCodesEnum{ + "NOERROR": DnsHealthCheckRCodesNoerror, + "SERVFAIL": DnsHealthCheckRCodesServfail, + "NXDOMAIN": DnsHealthCheckRCodesNxdomain, + "REFUSED": DnsHealthCheckRCodesRefused, +} + +var mappingDnsHealthCheckRCodesEnumLowerCase = map[string]DnsHealthCheckRCodesEnum{ + "noerror": DnsHealthCheckRCodesNoerror, + "servfail": DnsHealthCheckRCodesServfail, + "nxdomain": DnsHealthCheckRCodesNxdomain, + "refused": DnsHealthCheckRCodesRefused, +} + +// GetDnsHealthCheckRCodesEnumValues Enumerates the set of values for DnsHealthCheckRCodesEnum +func GetDnsHealthCheckRCodesEnumValues() []DnsHealthCheckRCodesEnum { + values := make([]DnsHealthCheckRCodesEnum, 0) + for _, v := range mappingDnsHealthCheckRCodesEnum { + values = append(values, v) + } + return values +} + +// GetDnsHealthCheckRCodesEnumStringValues Enumerates the set of values in String for DnsHealthCheckRCodesEnum +func GetDnsHealthCheckRCodesEnumStringValues() []string { + return []string{ + "NOERROR", + "SERVFAIL", + "NXDOMAIN", + "REFUSED", + } +} + +// GetMappingDnsHealthCheckRCodesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDnsHealthCheckRCodesEnum(val string) (DnsHealthCheckRCodesEnum, bool) { + enum, ok := mappingDnsHealthCheckRCodesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkloadbalancer/dns_health_check_transport_protocols.go b/networkloadbalancer/dns_health_check_transport_protocols.go new file mode 100644 index 0000000000..b3ee721586 --- /dev/null +++ b/networkloadbalancer/dns_health_check_transport_protocols.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// NetworkLoadBalancer API +// +// This describes the network load balancer API. +// + +package networkloadbalancer + +import ( + "strings" +) + +// DnsHealthCheckTransportProtocolsEnum Enum with underlying type: string +type DnsHealthCheckTransportProtocolsEnum string + +// Set of constants representing the allowable values for DnsHealthCheckTransportProtocolsEnum +const ( + DnsHealthCheckTransportProtocolsUdp DnsHealthCheckTransportProtocolsEnum = "UDP" + DnsHealthCheckTransportProtocolsTcp DnsHealthCheckTransportProtocolsEnum = "TCP" +) + +var mappingDnsHealthCheckTransportProtocolsEnum = map[string]DnsHealthCheckTransportProtocolsEnum{ + "UDP": DnsHealthCheckTransportProtocolsUdp, + "TCP": DnsHealthCheckTransportProtocolsTcp, +} + +var mappingDnsHealthCheckTransportProtocolsEnumLowerCase = map[string]DnsHealthCheckTransportProtocolsEnum{ + "udp": DnsHealthCheckTransportProtocolsUdp, + "tcp": DnsHealthCheckTransportProtocolsTcp, +} + +// GetDnsHealthCheckTransportProtocolsEnumValues Enumerates the set of values for DnsHealthCheckTransportProtocolsEnum +func GetDnsHealthCheckTransportProtocolsEnumValues() []DnsHealthCheckTransportProtocolsEnum { + values := make([]DnsHealthCheckTransportProtocolsEnum, 0) + for _, v := range mappingDnsHealthCheckTransportProtocolsEnum { + values = append(values, v) + } + return values +} + +// GetDnsHealthCheckTransportProtocolsEnumStringValues Enumerates the set of values in String for DnsHealthCheckTransportProtocolsEnum +func GetDnsHealthCheckTransportProtocolsEnumStringValues() []string { + return []string{ + "UDP", + "TCP", + } +} + +// GetMappingDnsHealthCheckTransportProtocolsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDnsHealthCheckTransportProtocolsEnum(val string) (DnsHealthCheckTransportProtocolsEnum, bool) { + enum, ok := mappingDnsHealthCheckTransportProtocolsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/networkloadbalancer/dns_health_checker_details.go b/networkloadbalancer/dns_health_checker_details.go new file mode 100644 index 0000000000..b7bae47b61 --- /dev/null +++ b/networkloadbalancer/dns_health_checker_details.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// NetworkLoadBalancer API +// +// This describes the network load balancer API. +// + +package networkloadbalancer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DnsHealthCheckerDetails DNS healthcheck configurations. +type DnsHealthCheckerDetails struct { + + // The absolute fully-qualified domain name to perform periodic DNS queries. + // If not provided, an extra dot will be added at the end of a domain name during the query. + DomainName *string `mandatory:"true" json:"domainName"` + + // DNS transport protocol; either UDP or TCP. + // Example: `UDP` + TransportProtocol DnsHealthCheckTransportProtocolsEnum `mandatory:"false" json:"transportProtocol,omitempty"` + + // The class the dns health check query to use; either IN or CH. + // Example: `IN` + QueryClass DnsHealthCheckQueryClassesEnum `mandatory:"false" json:"queryClass,omitempty"` + + // The type the dns health check query to use; A, AAAA, TXT. + // Example: `A` + QueryType DnsHealthCheckQueryTypesEnum `mandatory:"false" json:"queryType,omitempty"` + + // An array that represents accepetable RCODE values for DNS query response. + // Example: ["NOERROR", "NXDOMAIN"] + Rcodes []DnsHealthCheckRCodesEnum `mandatory:"false" json:"rcodes"` +} + +func (m DnsHealthCheckerDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DnsHealthCheckerDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDnsHealthCheckTransportProtocolsEnum(string(m.TransportProtocol)); !ok && m.TransportProtocol != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TransportProtocol: %s. Supported values are: %s.", m.TransportProtocol, strings.Join(GetDnsHealthCheckTransportProtocolsEnumStringValues(), ","))) + } + if _, ok := GetMappingDnsHealthCheckQueryClassesEnum(string(m.QueryClass)); !ok && m.QueryClass != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for QueryClass: %s. Supported values are: %s.", m.QueryClass, strings.Join(GetDnsHealthCheckQueryClassesEnumStringValues(), ","))) + } + if _, ok := GetMappingDnsHealthCheckQueryTypesEnum(string(m.QueryType)); !ok && m.QueryType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for QueryType: %s. Supported values are: %s.", m.QueryType, strings.Join(GetDnsHealthCheckQueryTypesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/networkloadbalancer/health_check_protocols.go b/networkloadbalancer/health_check_protocols.go index ce611ab45e..f89410881f 100644 --- a/networkloadbalancer/health_check_protocols.go +++ b/networkloadbalancer/health_check_protocols.go @@ -22,6 +22,7 @@ const ( HealthCheckProtocolsHttps HealthCheckProtocolsEnum = "HTTPS" HealthCheckProtocolsTcp HealthCheckProtocolsEnum = "TCP" HealthCheckProtocolsUdp HealthCheckProtocolsEnum = "UDP" + HealthCheckProtocolsDns HealthCheckProtocolsEnum = "DNS" ) var mappingHealthCheckProtocolsEnum = map[string]HealthCheckProtocolsEnum{ @@ -29,6 +30,7 @@ var mappingHealthCheckProtocolsEnum = map[string]HealthCheckProtocolsEnum{ "HTTPS": HealthCheckProtocolsHttps, "TCP": HealthCheckProtocolsTcp, "UDP": HealthCheckProtocolsUdp, + "DNS": HealthCheckProtocolsDns, } var mappingHealthCheckProtocolsEnumLowerCase = map[string]HealthCheckProtocolsEnum{ @@ -36,6 +38,7 @@ var mappingHealthCheckProtocolsEnumLowerCase = map[string]HealthCheckProtocolsEn "https": HealthCheckProtocolsHttps, "tcp": HealthCheckProtocolsTcp, "udp": HealthCheckProtocolsUdp, + "dns": HealthCheckProtocolsDns, } // GetHealthCheckProtocolsEnumValues Enumerates the set of values for HealthCheckProtocolsEnum @@ -54,6 +57,7 @@ func GetHealthCheckProtocolsEnumStringValues() []string { "HTTPS", "TCP", "UDP", + "DNS", } } diff --git a/networkloadbalancer/health_checker.go b/networkloadbalancer/health_checker.go index 9f8dd3f559..14c78460a8 100644 --- a/networkloadbalancer/health_checker.go +++ b/networkloadbalancer/health_checker.go @@ -60,6 +60,8 @@ type HealthChecker struct { // Base64 encoded pattern to be validated as UDP or TCP health check probe response. ResponseData []byte `mandatory:"false" json:"responseData"` + + Dns *DnsHealthCheckerDetails `mandatory:"false" json:"dns"` } func (m HealthChecker) String() string { diff --git a/networkloadbalancer/health_checker_details.go b/networkloadbalancer/health_checker_details.go index fdf217f120..198573f956 100644 --- a/networkloadbalancer/health_checker_details.go +++ b/networkloadbalancer/health_checker_details.go @@ -60,6 +60,8 @@ type HealthCheckerDetails struct { // Base64 encoded pattern to be validated as UDP or TCP health check probe response. ResponseData []byte `mandatory:"false" json:"responseData"` + + Dns *DnsHealthCheckerDetails `mandatory:"false" json:"dns"` } func (m HealthCheckerDetails) String() string { diff --git a/networkloadbalancer/update_backend_set_details.go b/networkloadbalancer/update_backend_set_details.go index 265a19d956..4488916e64 100644 --- a/networkloadbalancer/update_backend_set_details.go +++ b/networkloadbalancer/update_backend_set_details.go @@ -31,6 +31,13 @@ type UpdateBackendSetDetails struct { // The value is true by default. IsPreserveSource *bool `mandatory:"false" json:"isPreserveSource"` + // If enabled, the network load balancer will continue to distribute traffic in the configured distribution in the event all backends are unhealthy. + // The value is false by default. + IsFailOpen *bool `mandatory:"false" json:"isFailOpen"` + + // If enabled existing connections will be forwarded to an alternative healthy backend as soon as current backend becomes unhealthy. + IsInstantFailoverEnabled *bool `mandatory:"false" json:"isInstantFailoverEnabled"` + // The IP version associated with the backend set. IpVersion IpVersionEnum `mandatory:"false" json:"ipVersion,omitempty"` diff --git a/networkloadbalancer/update_health_checker_details.go b/networkloadbalancer/update_health_checker_details.go index a728abe6ea..7c2e780513 100644 --- a/networkloadbalancer/update_health_checker_details.go +++ b/networkloadbalancer/update_health_checker_details.go @@ -58,6 +58,8 @@ type UpdateHealthCheckerDetails struct { // Base64 encoded pattern to be validated as UDP or TCP health check probe response. ResponseData []byte `mandatory:"false" json:"responseData"` + + Dns *DnsHealthCheckerDetails `mandatory:"false" json:"dns"` } func (m UpdateHealthCheckerDetails) String() string { diff --git a/stackmonitoring/associated_monitored_resource.go b/stackmonitoring/associated_monitored_resource.go index 35c1b79765..ae79b57a63 100644 --- a/stackmonitoring/associated_monitored_resource.go +++ b/stackmonitoring/associated_monitored_resource.go @@ -51,6 +51,12 @@ type AssociatedMonitoredResource struct { // License edition of the monitored resource. License LicenseTypeEnum `mandatory:"false" json:"license,omitempty"` + // Source type to indicate if the resource is stack monitoring discovered, OCI native resource, etc. + SourceType SourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // Resource Category to indicate the kind of resource type. + ResourceCategory ResourceCategoryEnum `mandatory:"false" json:"resourceCategory,omitempty"` + // Association details of the resource. Association *interface{} `mandatory:"false" json:"association"` } @@ -71,6 +77,12 @@ func (m AssociatedMonitoredResource) ValidateEnumValue() (bool, error) { if _, ok := GetMappingLicenseTypeEnum(string(m.License)); !ok && m.License != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for License: %s. Supported values are: %s.", m.License, strings.Join(GetLicenseTypeEnumStringValues(), ","))) } + if _, ok := GetMappingSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceCategoryEnum(string(m.ResourceCategory)); !ok && m.ResourceCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceCategory: %s. Supported values are: %s.", m.ResourceCategory, strings.Join(GetResourceCategoryEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/stackmonitoring/associated_resources_summary.go b/stackmonitoring/associated_resources_summary.go index fb8e84cf98..2c571eaee6 100644 --- a/stackmonitoring/associated_resources_summary.go +++ b/stackmonitoring/associated_resources_summary.go @@ -51,6 +51,12 @@ type AssociatedResourcesSummary struct { // License edition of the monitored resource. License LicenseTypeEnum `mandatory:"false" json:"license,omitempty"` + // Source type to indicate if the resource is stack monitoring discovered, OCI native resource, etc. + SourceType SourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // Resource Category to indicate the kind of resource type. + ResourceCategory ResourceCategoryEnum `mandatory:"false" json:"resourceCategory,omitempty"` + // List of associated monitored resources. AssociatedResources []AssociatedMonitoredResource `mandatory:"false" json:"associatedResources"` } @@ -71,6 +77,12 @@ func (m AssociatedResourcesSummary) ValidateEnumValue() (bool, error) { if _, ok := GetMappingLicenseTypeEnum(string(m.License)); !ok && m.License != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for License: %s. Supported values are: %s.", m.License, strings.Join(GetLicenseTypeEnumStringValues(), ","))) } + if _, ok := GetMappingSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceCategoryEnum(string(m.ResourceCategory)); !ok && m.ResourceCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceCategory: %s. Supported values are: %s.", m.ResourceCategory, strings.Join(GetResourceCategoryEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/stackmonitoring/create_monitored_resource_type_details.go b/stackmonitoring/create_monitored_resource_type_details.go index fe15c8a16b..c1133a1046 100644 --- a/stackmonitoring/create_monitored_resource_type_details.go +++ b/stackmonitoring/create_monitored_resource_type_details.go @@ -37,6 +37,12 @@ type CreateMonitoredResourceTypeDetails struct { // Metric namespace for resource type. MetricNamespace *string `mandatory:"false" json:"metricNamespace"` + // Source type to indicate if the resource is stack monitoring discovered, OCI native resource, etc. + SourceType SourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // Resource Category to indicate the kind of resource type. + ResourceCategory ResourceCategoryEnum `mandatory:"false" json:"resourceCategory,omitempty"` + Metadata ResourceTypeMetadataDetails `mandatory:"false" json:"metadata"` // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. @@ -58,6 +64,12 @@ func (m CreateMonitoredResourceTypeDetails) String() string { func (m CreateMonitoredResourceTypeDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceCategoryEnum(string(m.ResourceCategory)); !ok && m.ResourceCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceCategory: %s. Supported values are: %s.", m.ResourceCategory, strings.Join(GetResourceCategoryEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -67,14 +79,16 @@ func (m CreateMonitoredResourceTypeDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *CreateMonitoredResourceTypeDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - DisplayName *string `json:"displayName"` - Description *string `json:"description"` - MetricNamespace *string `json:"metricNamespace"` - Metadata resourcetypemetadatadetails `json:"metadata"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - Name *string `json:"name"` - CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + MetricNamespace *string `json:"metricNamespace"` + SourceType SourceTypeEnum `json:"sourceType"` + ResourceCategory ResourceCategoryEnum `json:"resourceCategory"` + Metadata resourcetypemetadatadetails `json:"metadata"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Name *string `json:"name"` + CompartmentId *string `json:"compartmentId"` }{} e = json.Unmarshal(data, &model) @@ -88,6 +102,10 @@ func (m *CreateMonitoredResourceTypeDetails) UnmarshalJSON(data []byte) (e error m.MetricNamespace = model.MetricNamespace + m.SourceType = model.SourceType + + m.ResourceCategory = model.ResourceCategory + nn, e = model.Metadata.UnmarshalPolymorphicJSON(model.Metadata.JsonData) if e != nil { return diff --git a/stackmonitoring/discovery_job_log_summary.go b/stackmonitoring/discovery_job_log_summary.go index 67e9203c34..4764ed4286 100644 --- a/stackmonitoring/discovery_job_log_summary.go +++ b/stackmonitoring/discovery_job_log_summary.go @@ -29,6 +29,10 @@ type DiscoveryJobLogSummary struct { // Time the Job log was created TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m DiscoveryJobLogSummary) String() string { diff --git a/stackmonitoring/import_oci_telemetry_resources_task_details.go b/stackmonitoring/import_oci_telemetry_resources_task_details.go index 03b25c9533..1a16cdd39e 100644 --- a/stackmonitoring/import_oci_telemetry_resources_task_details.go +++ b/stackmonitoring/import_oci_telemetry_resources_task_details.go @@ -26,6 +26,44 @@ type ImportOciTelemetryResourcesTaskDetails struct { // If not specified, resource group will be skipped in the list metrics request. ResourceGroup *string `mandatory:"false" json:"resourceGroup"` + // Flag to indicate whether status is calculated using metrics or + // LifeCycleState attribute of the resource in OCI service. + ShouldUseMetricsFlowForStatus *bool `mandatory:"false" json:"shouldUseMetricsFlowForStatus"` + + // The base URL of the OCI service to which the resource belongs to. + // Also this property is applicable only when source is OCI_TELEMETRY_NATIVE. + ServiceBaseUrl *string `mandatory:"false" json:"serviceBaseUrl"` + + // The console path prefix to use for providing service home url page navigation. + // For example if the prefix provided is 'security/bastion/bastions', the URL used for navigation will be + // https:///security/bastion/bastions/. If not provided, service home page link + // will not be shown in the stack monitoring home page. + ConsolePathPrefix *string `mandatory:"false" json:"consolePathPrefix"` + + // Lifecycle states of the external resource which reflects the status of the resource being up. + LifecycleStatusMappingsForUpStatus []string `mandatory:"false" json:"lifecycleStatusMappingsForUpStatus"` + + // The resource name property in the metric dimensions. + // Resources imported will be using this property value for resource name. + ResourceNameMapping *string `mandatory:"false" json:"resourceNameMapping"` + + // The external resource identifier property in the metric dimensions. + // Resources imported will be using this property value for external id. + ExternalIdMapping *string `mandatory:"false" json:"externalIdMapping"` + + // The resource type property in the metric dimensions. + // Resources imported will be using this property value for resource type. + // If not specified, namespace will be used for resource type. + ResourceTypeMapping *string `mandatory:"false" json:"resourceTypeMapping"` + + // The resource name filter. Resources matching with the resource name filter will be imported. + // Regular expressions will be accepted. + ResourceNameFilter *string `mandatory:"false" json:"resourceNameFilter"` + + // The resource type filter. Resources matching with the resource type filter will be imported. + // Regular expressions will be accepted. + ResourceTypeFilter *string `mandatory:"false" json:"resourceTypeFilter"` + // List of metrics to be used to calculate the availability of the resource. // Resource is considered to be up if at least one of the specified metrics is available for // the resource during the specified interval using the property diff --git a/stackmonitoring/list_monitored_resources_request_response.go b/stackmonitoring/list_monitored_resources_request_response.go index 31674e9860..72f857d848 100644 --- a/stackmonitoring/list_monitored_resources_request_response.go +++ b/stackmonitoring/list_monitored_resources_request_response.go @@ -27,6 +27,9 @@ type ListMonitoredResourcesRequest struct { // A filter to return resources which were impacted as part of this work request identifier. WorkRequestId *string `mandatory:"false" contributesTo:"query" name:"workRequestId"` + // A filter to return only resources with matching lifecycleState. + Status ListMonitoredResourcesStatusEnum `mandatory:"false" contributesTo:"query" name:"status" omitEmpty:"true"` + // The field to sort by. Only one sort order may be provided. // Default order for timeCreated is descending. Default order for resources is ascending. SortBy ListMonitoredResourcesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` @@ -84,6 +87,9 @@ func (request ListMonitoredResourcesRequest) RetryPolicy() *common.RetryPolicy { // Not recommended for calling this function directly func (request ListMonitoredResourcesRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingListMonitoredResourcesStatusEnum(string(request.Status)); !ok && request.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", request.Status, strings.Join(GetListMonitoredResourcesStatusEnumStringValues(), ","))) + } if _, ok := GetMappingListMonitoredResourcesSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListMonitoredResourcesSortByEnumStringValues(), ","))) } @@ -127,6 +133,64 @@ func (response ListMonitoredResourcesResponse) HTTPResponse() *http.Response { return response.RawResponse } +// ListMonitoredResourcesStatusEnum Enum with underlying type: string +type ListMonitoredResourcesStatusEnum string + +// Set of constants representing the allowable values for ListMonitoredResourcesStatusEnum +const ( + ListMonitoredResourcesStatusCreating ListMonitoredResourcesStatusEnum = "CREATING" + ListMonitoredResourcesStatusUpdating ListMonitoredResourcesStatusEnum = "UPDATING" + ListMonitoredResourcesStatusActive ListMonitoredResourcesStatusEnum = "ACTIVE" + ListMonitoredResourcesStatusDeleting ListMonitoredResourcesStatusEnum = "DELETING" + ListMonitoredResourcesStatusDeleted ListMonitoredResourcesStatusEnum = "DELETED" + ListMonitoredResourcesStatusFailed ListMonitoredResourcesStatusEnum = "FAILED" +) + +var mappingListMonitoredResourcesStatusEnum = map[string]ListMonitoredResourcesStatusEnum{ + "CREATING": ListMonitoredResourcesStatusCreating, + "UPDATING": ListMonitoredResourcesStatusUpdating, + "ACTIVE": ListMonitoredResourcesStatusActive, + "DELETING": ListMonitoredResourcesStatusDeleting, + "DELETED": ListMonitoredResourcesStatusDeleted, + "FAILED": ListMonitoredResourcesStatusFailed, +} + +var mappingListMonitoredResourcesStatusEnumLowerCase = map[string]ListMonitoredResourcesStatusEnum{ + "creating": ListMonitoredResourcesStatusCreating, + "updating": ListMonitoredResourcesStatusUpdating, + "active": ListMonitoredResourcesStatusActive, + "deleting": ListMonitoredResourcesStatusDeleting, + "deleted": ListMonitoredResourcesStatusDeleted, + "failed": ListMonitoredResourcesStatusFailed, +} + +// GetListMonitoredResourcesStatusEnumValues Enumerates the set of values for ListMonitoredResourcesStatusEnum +func GetListMonitoredResourcesStatusEnumValues() []ListMonitoredResourcesStatusEnum { + values := make([]ListMonitoredResourcesStatusEnum, 0) + for _, v := range mappingListMonitoredResourcesStatusEnum { + values = append(values, v) + } + return values +} + +// GetListMonitoredResourcesStatusEnumStringValues Enumerates the set of values in String for ListMonitoredResourcesStatusEnum +func GetListMonitoredResourcesStatusEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingListMonitoredResourcesStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMonitoredResourcesStatusEnum(val string) (ListMonitoredResourcesStatusEnum, bool) { + enum, ok := mappingListMonitoredResourcesStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + // ListMonitoredResourcesSortByEnum Enum with underlying type: string type ListMonitoredResourcesSortByEnum string diff --git a/stackmonitoring/monitored_resource.go b/stackmonitoring/monitored_resource.go index 65ac01e2f1..dc54834094 100644 --- a/stackmonitoring/monitored_resource.go +++ b/stackmonitoring/monitored_resource.go @@ -68,6 +68,12 @@ type MonitoredResource struct { // License edition of the monitored resource. License LicenseTypeEnum `mandatory:"false" json:"license,omitempty"` + // Source type to indicate if the resource is stack monitoring discovered, OCI native resource, etc. + SourceType SourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // Resource Category to indicate the kind of resource type. + ResourceCategory ResourceCategoryEnum `mandatory:"false" json:"resourceCategory,omitempty"` + // List of monitored resource properties. Properties []MonitoredResourceProperty `mandatory:"false" json:"properties"` @@ -106,6 +112,12 @@ func (m MonitoredResource) ValidateEnumValue() (bool, error) { if _, ok := GetMappingLicenseTypeEnum(string(m.License)); !ok && m.License != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for License: %s. Supported values are: %s.", m.License, strings.Join(GetLicenseTypeEnumStringValues(), ","))) } + if _, ok := GetMappingSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceCategoryEnum(string(m.ResourceCategory)); !ok && m.ResourceCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceCategory: %s. Supported values are: %s.", m.ResourceCategory, strings.Join(GetResourceCategoryEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -124,6 +136,8 @@ func (m *MonitoredResource) UnmarshalJSON(data []byte) (e error) { TimeUpdated *common.SDKTime `json:"timeUpdated"` LifecycleState ResourceLifecycleStateEnum `json:"lifecycleState"` License LicenseTypeEnum `json:"license"` + SourceType SourceTypeEnum `json:"sourceType"` + ResourceCategory ResourceCategoryEnum `json:"resourceCategory"` Properties []MonitoredResourceProperty `json:"properties"` DatabaseConnectionDetails *ConnectionDetails `json:"databaseConnectionDetails"` Credentials monitoredresourcecredential `json:"credentials"` @@ -161,6 +175,10 @@ func (m *MonitoredResource) UnmarshalJSON(data []byte) (e error) { m.License = model.License + m.SourceType = model.SourceType + + m.ResourceCategory = model.ResourceCategory + m.Properties = make([]MonitoredResourceProperty, len(model.Properties)) copy(m.Properties, model.Properties) m.DatabaseConnectionDetails = model.DatabaseConnectionDetails diff --git a/stackmonitoring/monitored_resource_member_summary.go b/stackmonitoring/monitored_resource_member_summary.go index eb39b0f802..4ea6697d0b 100644 --- a/stackmonitoring/monitored_resource_member_summary.go +++ b/stackmonitoring/monitored_resource_member_summary.go @@ -51,6 +51,12 @@ type MonitoredResourceMemberSummary struct { // License edition of the monitored resource. License LicenseTypeEnum `mandatory:"false" json:"license,omitempty"` + // Source type to indicate if the resource is stack monitoring discovered, OCI native resource, etc. + SourceType SourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // Resource Category to indicate the kind of resource type. + ResourceCategory ResourceCategoryEnum `mandatory:"false" json:"resourceCategory,omitempty"` + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -80,6 +86,12 @@ func (m MonitoredResourceMemberSummary) ValidateEnumValue() (bool, error) { if _, ok := GetMappingLicenseTypeEnum(string(m.License)); !ok && m.License != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for License: %s. Supported values are: %s.", m.License, strings.Join(GetLicenseTypeEnumStringValues(), ","))) } + if _, ok := GetMappingSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceCategoryEnum(string(m.ResourceCategory)); !ok && m.ResourceCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceCategory: %s. Supported values are: %s.", m.ResourceCategory, strings.Join(GetResourceCategoryEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/stackmonitoring/monitored_resource_summary.go b/stackmonitoring/monitored_resource_summary.go index bd2771f5d0..fbdd194c55 100644 --- a/stackmonitoring/monitored_resource_summary.go +++ b/stackmonitoring/monitored_resource_summary.go @@ -58,6 +58,12 @@ type MonitoredResourceSummary struct { // License edition of the monitored resource. License LicenseTypeEnum `mandatory:"false" json:"license,omitempty"` + // Source type to indicate if the resource is stack monitoring discovered, OCI native resource, etc. + SourceType SourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // Resource Category to indicate the kind of resource type. + ResourceCategory ResourceCategoryEnum `mandatory:"false" json:"resourceCategory,omitempty"` + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -87,6 +93,12 @@ func (m MonitoredResourceSummary) ValidateEnumValue() (bool, error) { if _, ok := GetMappingLicenseTypeEnum(string(m.License)); !ok && m.License != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for License: %s. Supported values are: %s.", m.License, strings.Join(GetLicenseTypeEnumStringValues(), ","))) } + if _, ok := GetMappingSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceCategoryEnum(string(m.ResourceCategory)); !ok && m.ResourceCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceCategory: %s. Supported values are: %s.", m.ResourceCategory, strings.Join(GetResourceCategoryEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/stackmonitoring/monitored_resource_type.go b/stackmonitoring/monitored_resource_type.go index c4e3abfd27..e5880ba6b7 100644 --- a/stackmonitoring/monitored_resource_type.go +++ b/stackmonitoring/monitored_resource_type.go @@ -41,6 +41,12 @@ type MonitoredResourceType struct { // Lifecycle state of the monitored resource type. LifecycleState ResourceTypeLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + // Source type to indicate if the resource is stack monitoring discovered, OCI native resource, etc. + SourceType SourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // Resource Category to indicate the kind of resource type. + ResourceCategory ResourceCategoryEnum `mandatory:"false" json:"resourceCategory,omitempty"` + // The date and time when the monitored resource type was created, expressed in // RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` @@ -77,6 +83,12 @@ func (m MonitoredResourceType) ValidateEnumValue() (bool, error) { if _, ok := GetMappingResourceTypeLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetResourceTypeLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceCategoryEnum(string(m.ResourceCategory)); !ok && m.ResourceCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceCategory: %s. Supported values are: %s.", m.ResourceCategory, strings.Join(GetResourceCategoryEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -86,19 +98,21 @@ func (m MonitoredResourceType) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *MonitoredResourceType) UnmarshalJSON(data []byte) (e error) { model := struct { - DisplayName *string `json:"displayName"` - Description *string `json:"description"` - MetricNamespace *string `json:"metricNamespace"` - LifecycleState ResourceTypeLifecycleStateEnum `json:"lifecycleState"` - TimeCreated *common.SDKTime `json:"timeCreated"` - TimeUpdated *common.SDKTime `json:"timeUpdated"` - Metadata resourcetypemetadatadetails `json:"metadata"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - SystemTags map[string]map[string]interface{} `json:"systemTags"` - Id *string `json:"id"` - Name *string `json:"name"` - CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + MetricNamespace *string `json:"metricNamespace"` + LifecycleState ResourceTypeLifecycleStateEnum `json:"lifecycleState"` + SourceType SourceTypeEnum `json:"sourceType"` + ResourceCategory ResourceCategoryEnum `json:"resourceCategory"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + Metadata resourcetypemetadatadetails `json:"metadata"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + Id *string `json:"id"` + Name *string `json:"name"` + CompartmentId *string `json:"compartmentId"` }{} e = json.Unmarshal(data, &model) @@ -114,6 +128,10 @@ func (m *MonitoredResourceType) UnmarshalJSON(data []byte) (e error) { m.LifecycleState = model.LifecycleState + m.SourceType = model.SourceType + + m.ResourceCategory = model.ResourceCategory + m.TimeCreated = model.TimeCreated m.TimeUpdated = model.TimeUpdated diff --git a/stackmonitoring/monitored_resource_type_summary.go b/stackmonitoring/monitored_resource_type_summary.go index 1358142e51..2166515d54 100644 --- a/stackmonitoring/monitored_resource_type_summary.go +++ b/stackmonitoring/monitored_resource_type_summary.go @@ -41,6 +41,12 @@ type MonitoredResourceTypeSummary struct { // Lifecycle state of the monitored resource type. LifecycleState ResourceTypeLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + // Source type to indicate if the resource is stack monitoring discovered, OCI native resource, etc. + SourceType SourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // Resource Category to indicate the kind of resource type. + ResourceCategory ResourceCategoryEnum `mandatory:"false" json:"resourceCategory,omitempty"` + Metadata ResourceTypeMetadataDetails `mandatory:"false" json:"metadata"` // The date and time when the monitored resource type was created, expressed in @@ -77,6 +83,12 @@ func (m MonitoredResourceTypeSummary) ValidateEnumValue() (bool, error) { if _, ok := GetMappingResourceTypeLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetResourceTypeLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceCategoryEnum(string(m.ResourceCategory)); !ok && m.ResourceCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceCategory: %s. Supported values are: %s.", m.ResourceCategory, strings.Join(GetResourceCategoryEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -86,19 +98,21 @@ func (m MonitoredResourceTypeSummary) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *MonitoredResourceTypeSummary) UnmarshalJSON(data []byte) (e error) { model := struct { - DisplayName *string `json:"displayName"` - Description *string `json:"description"` - MetricNamespace *string `json:"metricNamespace"` - LifecycleState ResourceTypeLifecycleStateEnum `json:"lifecycleState"` - Metadata resourcetypemetadatadetails `json:"metadata"` - TimeCreated *common.SDKTime `json:"timeCreated"` - TimeUpdated *common.SDKTime `json:"timeUpdated"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - SystemTags map[string]map[string]interface{} `json:"systemTags"` - Id *string `json:"id"` - Name *string `json:"name"` - CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + MetricNamespace *string `json:"metricNamespace"` + LifecycleState ResourceTypeLifecycleStateEnum `json:"lifecycleState"` + SourceType SourceTypeEnum `json:"sourceType"` + ResourceCategory ResourceCategoryEnum `json:"resourceCategory"` + Metadata resourcetypemetadatadetails `json:"metadata"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + Id *string `json:"id"` + Name *string `json:"name"` + CompartmentId *string `json:"compartmentId"` }{} e = json.Unmarshal(data, &model) @@ -114,6 +128,10 @@ func (m *MonitoredResourceTypeSummary) UnmarshalJSON(data []byte) (e error) { m.LifecycleState = model.LifecycleState + m.SourceType = model.SourceType + + m.ResourceCategory = model.ResourceCategory + nn, e = model.Metadata.UnmarshalPolymorphicJSON(model.Metadata.JsonData) if e != nil { return diff --git a/stackmonitoring/resource_category.go b/stackmonitoring/resource_category.go new file mode 100644 index 0000000000..28a36bcc74 --- /dev/null +++ b/stackmonitoring/resource_category.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Stack Monitoring API +// +// Stack Monitoring API. +// + +package stackmonitoring + +import ( + "strings" +) + +// ResourceCategoryEnum Enum with underlying type: string +type ResourceCategoryEnum string + +// Set of constants representing the allowable values for ResourceCategoryEnum +const ( + ResourceCategoryApplication ResourceCategoryEnum = "APPLICATION" + ResourceCategoryDatabase ResourceCategoryEnum = "DATABASE" + ResourceCategoryMiddleware ResourceCategoryEnum = "MIDDLEWARE" + ResourceCategoryUnknown ResourceCategoryEnum = "UNKNOWN" +) + +var mappingResourceCategoryEnum = map[string]ResourceCategoryEnum{ + "APPLICATION": ResourceCategoryApplication, + "DATABASE": ResourceCategoryDatabase, + "MIDDLEWARE": ResourceCategoryMiddleware, + "UNKNOWN": ResourceCategoryUnknown, +} + +var mappingResourceCategoryEnumLowerCase = map[string]ResourceCategoryEnum{ + "application": ResourceCategoryApplication, + "database": ResourceCategoryDatabase, + "middleware": ResourceCategoryMiddleware, + "unknown": ResourceCategoryUnknown, +} + +// GetResourceCategoryEnumValues Enumerates the set of values for ResourceCategoryEnum +func GetResourceCategoryEnumValues() []ResourceCategoryEnum { + values := make([]ResourceCategoryEnum, 0) + for _, v := range mappingResourceCategoryEnum { + values = append(values, v) + } + return values +} + +// GetResourceCategoryEnumStringValues Enumerates the set of values in String for ResourceCategoryEnum +func GetResourceCategoryEnumStringValues() []string { + return []string{ + "APPLICATION", + "DATABASE", + "MIDDLEWARE", + "UNKNOWN", + } +} + +// GetMappingResourceCategoryEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingResourceCategoryEnum(val string) (ResourceCategoryEnum, bool) { + enum, ok := mappingResourceCategoryEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/stackmonitoring/search_monitored_resources_details.go b/stackmonitoring/search_monitored_resources_details.go index ac78d4ba13..7910513786 100644 --- a/stackmonitoring/search_monitored_resources_details.go +++ b/stackmonitoring/search_monitored_resources_details.go @@ -21,6 +21,18 @@ type SearchMonitoredResourcesDetails struct { // Compartment Identifier OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). CompartmentId *string `mandatory:"true" json:"compartmentId"` + // Multiple compartment identifiers OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentIds []string `mandatory:"false" json:"compartmentIds"` + + // Multiple lifecycle states filter. + LifecycleStates []ResourceLifecycleStateEnum `mandatory:"false" json:"lifecycleStates"` + + // Source type filter. + SourceType SourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // Resource category filter. + ResourceCategory ResourceCategoryEnum `mandatory:"false" json:"resourceCategory,omitempty"` + // A filter to return resources that match exact resource name. Name *string `mandatory:"false" json:"name"` @@ -113,6 +125,12 @@ func (m SearchMonitoredResourcesDetails) String() string { func (m SearchMonitoredResourcesDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceCategoryEnum(string(m.ResourceCategory)); !ok && m.ResourceCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceCategory: %s. Supported values are: %s.", m.ResourceCategory, strings.Join(GetResourceCategoryEnumStringValues(), ","))) + } if _, ok := GetMappingResourceLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetResourceLifecycleStateEnumStringValues(), ","))) } diff --git a/stackmonitoring/source_type.go b/stackmonitoring/source_type.go new file mode 100644 index 0000000000..6e973ae611 --- /dev/null +++ b/stackmonitoring/source_type.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Stack Monitoring API +// +// Stack Monitoring API. +// + +package stackmonitoring + +import ( + "strings" +) + +// SourceTypeEnum Enum with underlying type: string +type SourceTypeEnum string + +// Set of constants representing the allowable values for SourceTypeEnum +const ( + SourceTypeSmMgmtAgentMonitored SourceTypeEnum = "SM_MGMT_AGENT_MONITORED" + SourceTypeSmRepoOnly SourceTypeEnum = "SM_REPO_ONLY" + SourceTypeOciNative SourceTypeEnum = "OCI_NATIVE" + SourceTypePrometheus SourceTypeEnum = "PROMETHEUS" + SourceTypeTelegraf SourceTypeEnum = "TELEGRAF" + SourceTypeCollectd SourceTypeEnum = "COLLECTD" +) + +var mappingSourceTypeEnum = map[string]SourceTypeEnum{ + "SM_MGMT_AGENT_MONITORED": SourceTypeSmMgmtAgentMonitored, + "SM_REPO_ONLY": SourceTypeSmRepoOnly, + "OCI_NATIVE": SourceTypeOciNative, + "PROMETHEUS": SourceTypePrometheus, + "TELEGRAF": SourceTypeTelegraf, + "COLLECTD": SourceTypeCollectd, +} + +var mappingSourceTypeEnumLowerCase = map[string]SourceTypeEnum{ + "sm_mgmt_agent_monitored": SourceTypeSmMgmtAgentMonitored, + "sm_repo_only": SourceTypeSmRepoOnly, + "oci_native": SourceTypeOciNative, + "prometheus": SourceTypePrometheus, + "telegraf": SourceTypeTelegraf, + "collectd": SourceTypeCollectd, +} + +// GetSourceTypeEnumValues Enumerates the set of values for SourceTypeEnum +func GetSourceTypeEnumValues() []SourceTypeEnum { + values := make([]SourceTypeEnum, 0) + for _, v := range mappingSourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetSourceTypeEnumStringValues Enumerates the set of values in String for SourceTypeEnum +func GetSourceTypeEnumStringValues() []string { + return []string{ + "SM_MGMT_AGENT_MONITORED", + "SM_REPO_ONLY", + "OCI_NATIVE", + "PROMETHEUS", + "TELEGRAF", + "COLLECTD", + } +} + +// GetMappingSourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSourceTypeEnum(val string) (SourceTypeEnum, bool) { + enum, ok := mappingSourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/stackmonitoring/stackmonitoring_client.go b/stackmonitoring/stackmonitoring_client.go index e0d12b5ecc..f86424bdfb 100644 --- a/stackmonitoring/stackmonitoring_client.go +++ b/stackmonitoring/stackmonitoring_client.go @@ -405,7 +405,7 @@ func (client StackMonitoringClient) changeMonitoredResourceTaskCompartment(ctx c defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/stack-monitoring/20210330/monitoredResourceTask/ChangeMonitoredResourceTaskCompartment" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/stack-monitoring/20210330/MonitoredResourceTask/ChangeMonitoredResourceTaskCompartment" err = common.PostProcessServiceError(err, "StackMonitoring", "ChangeMonitoredResourceTaskCompartment", apiReferenceLink) return response, err } diff --git a/stackmonitoring/update_monitored_resource_type_details.go b/stackmonitoring/update_monitored_resource_type_details.go index ceb7090faf..e7dc0d68d0 100644 --- a/stackmonitoring/update_monitored_resource_type_details.go +++ b/stackmonitoring/update_monitored_resource_type_details.go @@ -28,6 +28,12 @@ type UpdateMonitoredResourceTypeDetails struct { // Metric namespace for resource type. MetricNamespace *string `mandatory:"false" json:"metricNamespace"` + // Source type to indicate if the resource is stack monitoring discovered, OCI native resource, etc. + SourceType SourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` + + // Resource Category to indicate the kind of resource type. + ResourceCategory ResourceCategoryEnum `mandatory:"false" json:"resourceCategory,omitempty"` + Metadata ResourceTypeMetadataDetails `mandatory:"false" json:"metadata"` // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. @@ -49,6 +55,12 @@ func (m UpdateMonitoredResourceTypeDetails) String() string { func (m UpdateMonitoredResourceTypeDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceCategoryEnum(string(m.ResourceCategory)); !ok && m.ResourceCategory != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceCategory: %s. Supported values are: %s.", m.ResourceCategory, strings.Join(GetResourceCategoryEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -58,12 +70,14 @@ func (m UpdateMonitoredResourceTypeDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *UpdateMonitoredResourceTypeDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - DisplayName *string `json:"displayName"` - Description *string `json:"description"` - MetricNamespace *string `json:"metricNamespace"` - Metadata resourcetypemetadatadetails `json:"metadata"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + MetricNamespace *string `json:"metricNamespace"` + SourceType SourceTypeEnum `json:"sourceType"` + ResourceCategory ResourceCategoryEnum `json:"resourceCategory"` + Metadata resourcetypemetadatadetails `json:"metadata"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` }{} e = json.Unmarshal(data, &model) @@ -77,6 +91,10 @@ func (m *UpdateMonitoredResourceTypeDetails) UnmarshalJSON(data []byte) (e error m.MetricNamespace = model.MetricNamespace + m.SourceType = model.SourceType + + m.ResourceCategory = model.ResourceCategory + nn, e = model.Metadata.UnmarshalPolymorphicJSON(model.Metadata.JsonData) if e != nil { return