diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d000c7b8c..99cde10d14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.62.0 - 2024-03-26 +### Added +- Support for creating and updating a refreshable clone with auto-refresh for an Autonomous Database in the Database service +- Support for symmetric hashing in the Network Load Balancer service +- Support for creating and deploying helm command specifications in the DevOps Service +- Support for uninstalling helm chart when deleting an Oracle Kubernetes Stage through the DevOps Service +- Support for collecting metrics and filter plugin with Unified Monitoring Agent (UMA) in the Logging service +- Support for reading logs from head position after agent restart in the Logging service +- Support for monitoring MySQL HeatWave clusters in Database Management Service +- Support for multiple severities in an alarm in the Monitoring service + +### Breaking Changes +- Support for default retries on the operations of the Network Load Balancer service +- The properties `DisplayName` and `Description` were made required in the model `CreateUnifiedAgentConfigurationDetails` in the Logging service +- The property `RecordInput` was made required in the model `OperationalMetricsSource` in the Logging service + + ## 65.61.2 - 2024-03-19 ### Added - Support for standalone Oracle HTTP server discovery and monitoring in the Stack Monitoring service diff --git a/common/version.go b/common/version.go index a9f4df693a..9c53ce1883 100644 --- a/common/version.go +++ b/common/version.go @@ -12,8 +12,8 @@ import ( const ( major = "65" - minor = "61" - patch = "2" + minor = "62" + patch = "0" tag = "" ) diff --git a/database/autonomous_database.go b/database/autonomous_database.go index 25aaf70015..6e8bbc021c 100644 --- a/database/autonomous_database.go +++ b/database/autonomous_database.go @@ -337,6 +337,15 @@ type AutonomousDatabase struct { // The wallet name for Oracle Key Vault. KeyStoreWalletName *string `mandatory:"false" json:"keyStoreWalletName"` + // The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter. + AutoRefreshFrequencyInSeconds *int `mandatory:"false" json:"autoRefreshFrequencyInSeconds"` + + // The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens. + AutoRefreshPointLagInSeconds *int `mandatory:"false" json:"autoRefreshPointLagInSeconds"` + + // The the date and time that auto-refreshing will begin for an Autonomous Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter. + TimeOfAutoRefreshStart *common.SDKTime `mandatory:"false" json:"timeOfAutoRefreshStart"` + // The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. SupportedRegionsToCloneTo []string `mandatory:"false" json:"supportedRegionsToCloneTo"` diff --git a/database/autonomous_database_summary.go b/database/autonomous_database_summary.go index e64e6c9308..4e99f7cc73 100644 --- a/database/autonomous_database_summary.go +++ b/database/autonomous_database_summary.go @@ -338,6 +338,15 @@ type AutonomousDatabaseSummary struct { // The wallet name for Oracle Key Vault. KeyStoreWalletName *string `mandatory:"false" json:"keyStoreWalletName"` + // The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter. + AutoRefreshFrequencyInSeconds *int `mandatory:"false" json:"autoRefreshFrequencyInSeconds"` + + // The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens. + AutoRefreshPointLagInSeconds *int `mandatory:"false" json:"autoRefreshPointLagInSeconds"` + + // The the date and time that auto-refreshing will begin for an Autonomous Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter. + TimeOfAutoRefreshStart *common.SDKTime `mandatory:"false" json:"timeOfAutoRefreshStart"` + // The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. SupportedRegionsToCloneTo []string `mandatory:"false" json:"supportedRegionsToCloneTo"` diff --git a/database/create_refreshable_autonomous_database_clone_details.go b/database/create_refreshable_autonomous_database_clone_details.go index 00ced583cb..192645e5fb 100644 --- a/database/create_refreshable_autonomous_database_clone_details.go +++ b/database/create_refreshable_autonomous_database_clone_details.go @@ -221,9 +221,22 @@ type CreateRefreshableAutonomousDatabaseCloneDetails struct { // The version of the vault secret. If no version is specified, the latest version will be used. SecretVersionNumber *int `mandatory:"false" json:"secretVersionNumber"` + // The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter. + AutoRefreshFrequencyInSeconds *int `mandatory:"false" json:"autoRefreshFrequencyInSeconds"` + + // The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens. + AutoRefreshPointLagInSeconds *int `mandatory:"false" json:"autoRefreshPointLagInSeconds"` + + // The the date and time that auto-refreshing will begin for an Autonomous Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter. + TimeOfAutoRefreshStart *common.SDKTime `mandatory:"false" json:"timeOfAutoRefreshStart"` + // The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous Database. RefreshableMode CreateRefreshableAutonomousDatabaseCloneDetailsRefreshableModeEnum `mandatory:"false" json:"refreshableMode,omitempty"` + // Indicates the Autonomous Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. + // This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. + OpenMode CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum `mandatory:"false" json:"openMode,omitempty"` + // The Oracle Database Edition that applies to the Autonomous databases. DatabaseEdition AutonomousDatabaseSummaryDatabaseEditionEnum `mandatory:"false" json:"databaseEdition,omitempty"` @@ -502,6 +515,9 @@ func (m CreateRefreshableAutonomousDatabaseCloneDetails) ValidateEnumValue() (bo if _, ok := GetMappingCreateRefreshableAutonomousDatabaseCloneDetailsRefreshableModeEnum(string(m.RefreshableMode)); !ok && m.RefreshableMode != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RefreshableMode: %s. Supported values are: %s.", m.RefreshableMode, strings.Join(GetCreateRefreshableAutonomousDatabaseCloneDetailsRefreshableModeEnumStringValues(), ","))) } + if _, ok := GetMappingCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum(string(m.OpenMode)); !ok && m.OpenMode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OpenMode: %s. Supported values are: %s.", m.OpenMode, strings.Join(GetCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnumStringValues(), ","))) + } if _, ok := GetMappingAutonomousDatabaseSummaryDatabaseEditionEnum(string(m.DatabaseEdition)); !ok && m.DatabaseEdition != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DatabaseEdition: %s. Supported values are: %s.", m.DatabaseEdition, strings.Join(GetAutonomousDatabaseSummaryDatabaseEditionEnumStringValues(), ","))) @@ -579,3 +595,45 @@ func GetMappingCreateRefreshableAutonomousDatabaseCloneDetailsRefreshableModeEnu enum, ok := mappingCreateRefreshableAutonomousDatabaseCloneDetailsRefreshableModeEnumLowerCase[strings.ToLower(val)] return enum, ok } + +// CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum Enum with underlying type: string +type CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum string + +// Set of constants representing the allowable values for CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum +const ( + CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeOnly CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum = "READ_ONLY" + CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeWrite CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum = "READ_WRITE" +) + +var mappingCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum = map[string]CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum{ + "READ_ONLY": CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeOnly, + "READ_WRITE": CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeWrite, +} + +var mappingCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnumLowerCase = map[string]CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum{ + "read_only": CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeOnly, + "read_write": CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeWrite, +} + +// GetCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnumValues Enumerates the set of values for CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum +func GetCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnumValues() []CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum { + values := make([]CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum, 0) + for _, v := range mappingCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum { + values = append(values, v) + } + return values +} + +// GetCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnumStringValues Enumerates the set of values in String for CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum +func GetCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnumStringValues() []string { + return []string{ + "READ_ONLY", + "READ_WRITE", + } +} + +// GetMappingCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum(val string) (CreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnum, bool) { + enum, ok := mappingCreateRefreshableAutonomousDatabaseCloneDetailsOpenModeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/update_autonomous_database_details.go b/database/update_autonomous_database_details.go index 5892540aab..0577ec51d7 100644 --- a/database/update_autonomous_database_details.go +++ b/database/update_autonomous_database_details.go @@ -214,6 +214,15 @@ type UpdateAutonomousDatabaseDetails struct { // - A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. NsgIds []string `mandatory:"false" json:"nsgIds"` + // The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter. + AutoRefreshFrequencyInSeconds *int `mandatory:"false" json:"autoRefreshFrequencyInSeconds"` + + // The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens. + AutoRefreshPointLagInSeconds *int `mandatory:"false" json:"autoRefreshPointLagInSeconds"` + + // The the date and time that auto-refreshing will begin for an Autonomous Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter. + TimeOfAutoRefreshStart *common.SDKTime `mandatory:"false" json:"timeOfAutoRefreshStart"` + // Customer Contacts. Setting this to an empty list removes all customer contacts of an Oracle // This cannot be updated in parallel with any of the following: isMTLSConnectionRequired, scheduledOperations, or dbToolsDetails. CustomerContacts []CustomerContact `mandatory:"false" json:"customerContacts"` diff --git a/databasemanagement/databasemanagement_managedmysqldatabases_client.go b/databasemanagement/databasemanagement_managedmysqldatabases_client.go index 7637b642c7..903d6dbba0 100644 --- a/databasemanagement/databasemanagement_managedmysqldatabases_client.go +++ b/databasemanagement/databasemanagement_managedmysqldatabases_client.go @@ -93,6 +93,63 @@ func (client *ManagedMySqlDatabasesClient) ConfigurationProvider() *common.Confi return client.config } +// GetHeatWaveFleetMetric Gets the health metrics for a fleet of HeatWave clusters in a compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/GetHeatWaveFleetMetric.go.html to see an example of how to use GetHeatWaveFleetMetric API. +func (client ManagedMySqlDatabasesClient) GetHeatWaveFleetMetric(ctx context.Context, request GetHeatWaveFleetMetricRequest) (response GetHeatWaveFleetMetricResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getHeatWaveFleetMetric, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetHeatWaveFleetMetricResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetHeatWaveFleetMetricResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetHeatWaveFleetMetricResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetHeatWaveFleetMetricResponse") + } + return +} + +// getHeatWaveFleetMetric implements the OCIOperation interface (enables retrying operations) +func (client ManagedMySqlDatabasesClient) getHeatWaveFleetMetric(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/heatWaveFleetMetrics", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetHeatWaveFleetMetricResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/HeatWaveFleetMetrics/GetHeatWaveFleetMetric" + err = common.PostProcessServiceError(err, "ManagedMySqlDatabases", "GetHeatWaveFleetMetric", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetManagedMySqlDatabase Retrieves the general information for a specific MySQL Database. // // # See also diff --git a/databasemanagement/get_heat_wave_fleet_metric_request_response.go b/databasemanagement/get_heat_wave_fleet_metric_request_response.go new file mode 100644 index 0000000000..6eefbb253e --- /dev/null +++ b/databasemanagement/get_heat_wave_fleet_metric_request_response.go @@ -0,0 +1,159 @@ +// 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. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetHeatWaveFleetMetricRequest wrapper for the GetHeatWaveFleetMetric operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/GetHeatWaveFleetMetric.go.html to see an example of how to use GetHeatWaveFleetMetricRequest. +type GetHeatWaveFleetMetricRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The start time of the time range to retrieve the health metrics of a Managed Database + // in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'". + StartTime *string `mandatory:"true" contributesTo:"query" name:"startTime"` + + // The end time of the time range to retrieve the health metrics of a Managed Database + // in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'". + EndTime *string `mandatory:"true" contributesTo:"query" name:"endTime"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The filter used to retrieve a specific set of metrics by passing the desired metric names with a comma separator. Note that, by default, the service returns all supported metrics. + FilterByMetricNames *string `mandatory:"false" contributesTo:"query" name:"filterByMetricNames"` + + // The parameter to filter by HeatWave cluster status. + FilterByHeatWaveStatus GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum `mandatory:"false" contributesTo:"query" name:"filterByHeatWaveStatus" omitEmpty:"true"` + + // The parameter to filter by HeatWave node shape. + FilterByHeatWaveShape *string `mandatory:"false" contributesTo:"query" name:"filterByHeatWaveShape"` + + // The parameter to filter based on whether HeatWave Lakehouse is enabled for the cluster. + IsHeatWaveLakehouseEnabled *bool `mandatory:"false" contributesTo:"query" name:"isHeatWaveLakehouseEnabled"` + + // 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 +} + +func (request GetHeatWaveFleetMetricRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetHeatWaveFleetMetricRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetHeatWaveFleetMetricRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetHeatWaveFleetMetricRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// 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 (request GetHeatWaveFleetMetricRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGetHeatWaveFleetMetricFilterByHeatWaveStatusEnum(string(request.FilterByHeatWaveStatus)); !ok && request.FilterByHeatWaveStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FilterByHeatWaveStatus: %s. Supported values are: %s.", request.FilterByHeatWaveStatus, strings.Join(GetGetHeatWaveFleetMetricFilterByHeatWaveStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetHeatWaveFleetMetricResponse wrapper for the GetHeatWaveFleetMetric operation +type GetHeatWaveFleetMetricResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HeatWaveFleetMetrics instance + HeatWaveFleetMetrics `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetHeatWaveFleetMetricResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetHeatWaveFleetMetricResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum Enum with underlying type: string +type GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum string + +// Set of constants representing the allowable values for GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum +const ( + GetHeatWaveFleetMetricFilterByHeatWaveStatusUp GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum = "UP" + GetHeatWaveFleetMetricFilterByHeatWaveStatusDown GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum = "DOWN" + GetHeatWaveFleetMetricFilterByHeatWaveStatusUnknown GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum = "UNKNOWN" +) + +var mappingGetHeatWaveFleetMetricFilterByHeatWaveStatusEnum = map[string]GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum{ + "UP": GetHeatWaveFleetMetricFilterByHeatWaveStatusUp, + "DOWN": GetHeatWaveFleetMetricFilterByHeatWaveStatusDown, + "UNKNOWN": GetHeatWaveFleetMetricFilterByHeatWaveStatusUnknown, +} + +var mappingGetHeatWaveFleetMetricFilterByHeatWaveStatusEnumLowerCase = map[string]GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum{ + "up": GetHeatWaveFleetMetricFilterByHeatWaveStatusUp, + "down": GetHeatWaveFleetMetricFilterByHeatWaveStatusDown, + "unknown": GetHeatWaveFleetMetricFilterByHeatWaveStatusUnknown, +} + +// GetGetHeatWaveFleetMetricFilterByHeatWaveStatusEnumValues Enumerates the set of values for GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum +func GetGetHeatWaveFleetMetricFilterByHeatWaveStatusEnumValues() []GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum { + values := make([]GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum, 0) + for _, v := range mappingGetHeatWaveFleetMetricFilterByHeatWaveStatusEnum { + values = append(values, v) + } + return values +} + +// GetGetHeatWaveFleetMetricFilterByHeatWaveStatusEnumStringValues Enumerates the set of values in String for GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum +func GetGetHeatWaveFleetMetricFilterByHeatWaveStatusEnumStringValues() []string { + return []string{ + "UP", + "DOWN", + "UNKNOWN", + } +} + +// GetMappingGetHeatWaveFleetMetricFilterByHeatWaveStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetHeatWaveFleetMetricFilterByHeatWaveStatusEnum(val string) (GetHeatWaveFleetMetricFilterByHeatWaveStatusEnum, bool) { + enum, ok := mappingGetHeatWaveFleetMetricFilterByHeatWaveStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/get_my_sql_fleet_metric_request_response.go b/databasemanagement/get_my_sql_fleet_metric_request_response.go index 778d286d18..041ec9729f 100644 --- a/databasemanagement/get_my_sql_fleet_metric_request_response.go +++ b/databasemanagement/get_my_sql_fleet_metric_request_response.go @@ -47,6 +47,9 @@ type GetMySqlFleetMetricRequest struct { // The parameter to filter by MySQL database version. FilterByMySqlDatabaseVersion *string `mandatory:"false" contributesTo:"query" name:"filterByMySqlDatabaseVersion"` + // The parameter to filter based on whether HeatWave is enabled for the database. + IsHeatWaveEnabled *bool `mandatory:"false" contributesTo:"query" name:"isHeatWaveEnabled"` + // 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/databasemanagement/heat_wave_cluster_status.go b/databasemanagement/heat_wave_cluster_status.go new file mode 100644 index 0000000000..795b73ae70 --- /dev/null +++ b/databasemanagement/heat_wave_cluster_status.go @@ -0,0 +1,62 @@ +// 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. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "strings" +) + +// HeatWaveClusterStatusEnum Enum with underlying type: string +type HeatWaveClusterStatusEnum string + +// Set of constants representing the allowable values for HeatWaveClusterStatusEnum +const ( + HeatWaveClusterStatusUp HeatWaveClusterStatusEnum = "UP" + HeatWaveClusterStatusDown HeatWaveClusterStatusEnum = "DOWN" + HeatWaveClusterStatusUnknown HeatWaveClusterStatusEnum = "UNKNOWN" +) + +var mappingHeatWaveClusterStatusEnum = map[string]HeatWaveClusterStatusEnum{ + "UP": HeatWaveClusterStatusUp, + "DOWN": HeatWaveClusterStatusDown, + "UNKNOWN": HeatWaveClusterStatusUnknown, +} + +var mappingHeatWaveClusterStatusEnumLowerCase = map[string]HeatWaveClusterStatusEnum{ + "up": HeatWaveClusterStatusUp, + "down": HeatWaveClusterStatusDown, + "unknown": HeatWaveClusterStatusUnknown, +} + +// GetHeatWaveClusterStatusEnumValues Enumerates the set of values for HeatWaveClusterStatusEnum +func GetHeatWaveClusterStatusEnumValues() []HeatWaveClusterStatusEnum { + values := make([]HeatWaveClusterStatusEnum, 0) + for _, v := range mappingHeatWaveClusterStatusEnum { + values = append(values, v) + } + return values +} + +// GetHeatWaveClusterStatusEnumStringValues Enumerates the set of values in String for HeatWaveClusterStatusEnum +func GetHeatWaveClusterStatusEnumStringValues() []string { + return []string{ + "UP", + "DOWN", + "UNKNOWN", + } +} + +// GetMappingHeatWaveClusterStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingHeatWaveClusterStatusEnum(val string) (HeatWaveClusterStatusEnum, bool) { + enum, ok := mappingHeatWaveClusterStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/heat_wave_cluster_usage_metrics.go b/databasemanagement/heat_wave_cluster_usage_metrics.go new file mode 100644 index 0000000000..73abe37438 --- /dev/null +++ b/databasemanagement/heat_wave_cluster_usage_metrics.go @@ -0,0 +1,68 @@ +// 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. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HeatWaveClusterUsageMetrics The list of aggregated metrics for a HeatWave cluster in the fleet. +type HeatWaveClusterUsageMetrics struct { + + // The status of the HeatWave cluster. Indicates whether the status of the cluster is UP, DOWN, or UNKNOWN at the current time. + Status HeatWaveClusterStatusEnum `mandatory:"true" json:"status"` + + // The OCID for the DB system associated with the HeatWave cluster. + DbSystemId *string `mandatory:"true" json:"dbSystemId"` + + // The name of the DB system associated with the HeatWave cluster. + DbSystemName *string `mandatory:"true" json:"dbSystemName"` + + // The name of the HeatWave cluster. + HeatWaveClusterDisplayName *string `mandatory:"true" json:"heatWaveClusterDisplayName"` + + // Number of nodes in the HeatWave cluster. + NodeCount *int `mandatory:"true" json:"nodeCount"` + + // If Lakehouse is enabled for the HeatWave cluster or not. + IsLakehouseEnabled *bool `mandatory:"true" json:"isLakehouseEnabled"` + + // Shape of the nodes in the HeatWave cluster. + HeatWaveNodeShape *string `mandatory:"true" json:"heatWaveNodeShape"` + + // The total memory belonging to the HeatWave cluster in GBs. + MemorySize *int `mandatory:"true" json:"memorySize"` + + // A list of the database health metrics like CPU and Memory. + Metrics []HeatWaveFleetMetricDefinition `mandatory:"true" json:"metrics"` +} + +func (m HeatWaveClusterUsageMetrics) 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 HeatWaveClusterUsageMetrics) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHeatWaveClusterStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetHeatWaveClusterStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/heat_wave_fleet_by_category.go b/databasemanagement/heat_wave_fleet_by_category.go new file mode 100644 index 0000000000..9c265adacb --- /dev/null +++ b/databasemanagement/heat_wave_fleet_by_category.go @@ -0,0 +1,47 @@ +// 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. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HeatWaveFleetByCategory The number of HeatWave clusters in the fleet, grouped by shape and Lakehouse-enabled status. +type HeatWaveFleetByCategory struct { + + // The name of the HeatWave fleet category. + Name *string `mandatory:"true" json:"name"` + + // The value of the HeatWave fleet category. + Value *string `mandatory:"true" json:"value"` + + // The number of matching HeatWave clusters. + Count *int `mandatory:"true" json:"count"` +} + +func (m HeatWaveFleetByCategory) 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 HeatWaveFleetByCategory) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/heat_wave_fleet_metric_definition.go b/databasemanagement/heat_wave_fleet_metric_definition.go new file mode 100644 index 0000000000..4b2804326a --- /dev/null +++ b/databasemanagement/heat_wave_fleet_metric_definition.go @@ -0,0 +1,53 @@ +// 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. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HeatWaveFleetMetricDefinition An aggregated metric for a HeatWave cluster. +type HeatWaveFleetMetricDefinition struct { + + // The name of the metric. + MetricName *string `mandatory:"true" json:"metricName"` + + // The value of the metric. + MetricValue *float64 `mandatory:"true" json:"metricValue"` + + // The data point date and time in UTC in ISO-8601 format. + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` + + // The dimensions of the metric. + Dimensions []MetricDimensionDefinition `mandatory:"true" json:"dimensions"` + + // The unit of the metric value. + Unit *string `mandatory:"true" json:"unit"` +} + +func (m HeatWaveFleetMetricDefinition) 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 HeatWaveFleetMetricDefinition) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/heat_wave_fleet_metric_summary_definition.go b/databasemanagement/heat_wave_fleet_metric_summary_definition.go new file mode 100644 index 0000000000..6a8361200d --- /dev/null +++ b/databasemanagement/heat_wave_fleet_metric_summary_definition.go @@ -0,0 +1,50 @@ +// 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. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HeatWaveFleetMetricSummaryDefinition A summary of the fleet metrics, which provides the metric aggregated value of the HeatWave clusters in the fleet. +type HeatWaveFleetMetricSummaryDefinition struct { + + // The name of the metric. + MetricName *string `mandatory:"true" json:"metricName"` + + // The aggregated metric value. + MetricValue *float64 `mandatory:"true" json:"metricValue"` + + // The unique dimension key and values of the metric. + Dimensions []MetricDimensionDefinition `mandatory:"true" json:"dimensions"` + + // The unit of the metric value. + Unit *string `mandatory:"true" json:"unit"` +} + +func (m HeatWaveFleetMetricSummaryDefinition) 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 HeatWaveFleetMetricSummaryDefinition) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/heat_wave_fleet_metrics.go b/databasemanagement/heat_wave_fleet_metrics.go new file mode 100644 index 0000000000..7b3ee05c1c --- /dev/null +++ b/databasemanagement/heat_wave_fleet_metrics.go @@ -0,0 +1,50 @@ +// 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. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HeatWaveFleetMetrics The details of the HeatWave cluster fleet health metrics. +type HeatWaveFleetMetrics struct { + + // The beginning of the time range during which metric data is retrieved. + StartTime *string `mandatory:"true" json:"startTime"` + + // The end of the time range during which metric data is retrieved. + EndTime *string `mandatory:"true" json:"endTime"` + + // The list of HeatWave clusters in the fleet and their usage metrics. + FleetClusters []HeatWaveClusterUsageMetrics `mandatory:"true" json:"fleetClusters"` + + // A summary of the inventory count and the metrics that describe the aggregated usage of CPU, storage, and so on of all the HeatWave clusters in the fleet. + FleetSummary []HeatWaveFleetSummary `mandatory:"true" json:"fleetSummary"` +} + +func (m HeatWaveFleetMetrics) 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 HeatWaveFleetMetrics) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/heat_wave_fleet_summary.go b/databasemanagement/heat_wave_fleet_summary.go new file mode 100644 index 0000000000..2d8a3fa8a2 --- /dev/null +++ b/databasemanagement/heat_wave_fleet_summary.go @@ -0,0 +1,44 @@ +// 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. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HeatWaveFleetSummary A summary of the inventory count and the metrics that describe the aggregated usage of CPU, storage, and so on of all the HeatWave clusters in the fleet. +type HeatWaveFleetSummary struct { + + // The usage metrics for the Managed HeatWave clusters in the fleet. + AggregatedMetrics []HeatWaveFleetMetricSummaryDefinition `mandatory:"true" json:"aggregatedMetrics"` + + // Summary counts of HeatWave clusters in the fleet grouped by cluster type. + Inventory []HeatWaveFleetByCategory `mandatory:"true" json:"inventory"` +} + +func (m HeatWaveFleetSummary) 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 HeatWaveFleetSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/heat_wave_node.go b/databasemanagement/heat_wave_node.go new file mode 100644 index 0000000000..f68100adbc --- /dev/null +++ b/databasemanagement/heat_wave_node.go @@ -0,0 +1,50 @@ +// 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. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HeatWaveNode The information about an individual HeatWave node. +type HeatWaveNode struct { + + // The ID associated with the HeatWave node. + Id *string `mandatory:"true" json:"id"` + + // The status of the HeatWave node. Indicates whether the status of the node is UP, DOWN, or UNKNOWN at the current time. + Status HeatWaveNodeStatusEnum `mandatory:"true" json:"status"` + + // The date and time the node was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` +} + +func (m HeatWaveNode) 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 HeatWaveNode) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHeatWaveNodeStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetHeatWaveNodeStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/heat_wave_node_status.go b/databasemanagement/heat_wave_node_status.go new file mode 100644 index 0000000000..600076bbfc --- /dev/null +++ b/databasemanagement/heat_wave_node_status.go @@ -0,0 +1,62 @@ +// 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. + +// Database Management API +// +// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics +// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and +// running a SQL job on a Managed Database or Managed Database Group. +// + +package databasemanagement + +import ( + "strings" +) + +// HeatWaveNodeStatusEnum Enum with underlying type: string +type HeatWaveNodeStatusEnum string + +// Set of constants representing the allowable values for HeatWaveNodeStatusEnum +const ( + HeatWaveNodeStatusUp HeatWaveNodeStatusEnum = "UP" + HeatWaveNodeStatusDown HeatWaveNodeStatusEnum = "DOWN" + HeatWaveNodeStatusUnknown HeatWaveNodeStatusEnum = "UNKNOWN" +) + +var mappingHeatWaveNodeStatusEnum = map[string]HeatWaveNodeStatusEnum{ + "UP": HeatWaveNodeStatusUp, + "DOWN": HeatWaveNodeStatusDown, + "UNKNOWN": HeatWaveNodeStatusUnknown, +} + +var mappingHeatWaveNodeStatusEnumLowerCase = map[string]HeatWaveNodeStatusEnum{ + "up": HeatWaveNodeStatusUp, + "down": HeatWaveNodeStatusDown, + "unknown": HeatWaveNodeStatusUnknown, +} + +// GetHeatWaveNodeStatusEnumValues Enumerates the set of values for HeatWaveNodeStatusEnum +func GetHeatWaveNodeStatusEnumValues() []HeatWaveNodeStatusEnum { + values := make([]HeatWaveNodeStatusEnum, 0) + for _, v := range mappingHeatWaveNodeStatusEnum { + values = append(values, v) + } + return values +} + +// GetHeatWaveNodeStatusEnumStringValues Enumerates the set of values in String for HeatWaveNodeStatusEnum +func GetHeatWaveNodeStatusEnumStringValues() []string { + return []string{ + "UP", + "DOWN", + "UNKNOWN", + } +} + +// GetMappingHeatWaveNodeStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingHeatWaveNodeStatusEnum(val string) (HeatWaveNodeStatusEnum, bool) { + enum, ok := mappingHeatWaveNodeStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/list_managed_my_sql_database_sql_data_request_response.go b/databasemanagement/list_managed_my_sql_database_sql_data_request_response.go index 57331c38f7..9715ccd3f0 100644 --- a/databasemanagement/list_managed_my_sql_database_sql_data_request_response.go +++ b/databasemanagement/list_managed_my_sql_database_sql_data_request_response.go @@ -30,6 +30,7 @@ type ListManagedMySqlDatabaseSqlDataRequest struct { EndTime *string `mandatory:"true" contributesTo:"query" name:"endTime"` // The parameter to filter results by key criteria which include : + // - AVG_TIMER_WAIT // - SUM_TIMER_WAIT // - COUNT_STAR // - SUM_ERRORS @@ -41,6 +42,8 @@ type ListManagedMySqlDatabaseSqlDataRequest struct { // - SUM_NO_GOOD_INDEX_USED // - FIRST_SEEN // - LAST_SEEN + // - HEATWAVE_OFFLOADED + // - HEATWAVE_OUT_OF_MEMORY FilterColumn *string `mandatory:"false" contributesTo:"query" name:"filterColumn"` // The client request ID for tracing. diff --git a/databasemanagement/managed_my_sql_database.go b/databasemanagement/managed_my_sql_database.go index 7f09f650fa..bfbfea123a 100644 --- a/databasemanagement/managed_my_sql_database.go +++ b/databasemanagement/managed_my_sql_database.go @@ -37,6 +37,30 @@ type ManagedMySqlDatabase struct { // The name of the Managed MySQL Database. Name *string `mandatory:"true" json:"name"` + + // The name of the HeatWave cluster. + HeatWaveClusterDisplayName *string `mandatory:"false" json:"heatWaveClusterDisplayName"` + + // If HeatWave is enabled for this db system or not. + IsHeatWaveEnabled *bool `mandatory:"false" json:"isHeatWaveEnabled"` + + // If HeatWave Lakehouse is enabled for the db system or not. + IsLakehouseEnabled *bool `mandatory:"false" json:"isLakehouseEnabled"` + + // Shape of the nodes in the HeatWave cluster. + HeatWaveNodeShape *string `mandatory:"false" json:"heatWaveNodeShape"` + + // The total memory belonging to the HeatWave cluster in GBs. + HeatWaveMemorySize *int `mandatory:"false" json:"heatWaveMemorySize"` + + // The information about an individual HeatWave nodes in the cluster. + HeatWaveNodes []HeatWaveNode `mandatory:"false" json:"heatWaveNodes"` + + // If the HeatWave cluster is active or not. + IsHeatWaveActive *bool `mandatory:"false" json:"isHeatWaveActive"` + + // The date and time the Managed MySQL Database was created. + TimeCreatedHeatWave *common.SDKTime `mandatory:"false" json:"timeCreatedHeatWave"` } func (m ManagedMySqlDatabase) String() string { diff --git a/databasemanagement/my_sql_data_summary.go b/databasemanagement/my_sql_data_summary.go index 1a19e20986..13060ecdea 100644 --- a/databasemanagement/my_sql_data_summary.go +++ b/databasemanagement/my_sql_data_summary.go @@ -115,6 +115,12 @@ type MySqlDataSummary struct { // The 99.9th percentile of the query latency. Quantile999 *float32 `mandatory:"true" json:"quantile999"` + + // The number of query executions offloaded to HeatWave. + HeatWaveOffloaded *float32 `mandatory:"false" json:"heatWaveOffloaded"` + + // The number of query executions with HeatWave out-of-memory errors. + HeatWaveOutOfMemory *float32 `mandatory:"false" json:"heatWaveOutOfMemory"` } func (m MySqlDataSummary) String() string { diff --git a/databasemanagement/my_sql_database_usage_metrics.go b/databasemanagement/my_sql_database_usage_metrics.go index 595ad6b4a4..0203011103 100644 --- a/databasemanagement/my_sql_database_usage_metrics.go +++ b/databasemanagement/my_sql_database_usage_metrics.go @@ -47,6 +47,15 @@ type MySqlDatabaseUsageMetrics struct { // A list of the database health metrics like CPU, Storage, and Memory. Metrics []MySqlFleetMetricDefinition `mandatory:"true" json:"metrics"` + + // If HeatWave is enabled for this db system or not. + IsHeatWaveEnabled *bool `mandatory:"false" json:"isHeatWaveEnabled"` + + // The name of the HeatWave cluster. + HeatWaveClusterDisplayName *string `mandatory:"false" json:"heatWaveClusterDisplayName"` + + // The number of nodes in the HeatWave cluster. + HeatWaveNodeCount *int `mandatory:"false" json:"heatWaveNodeCount"` } func (m MySqlDatabaseUsageMetrics) String() string { diff --git a/devops/create_oke_helm_chart_deploy_stage_details.go b/devops/create_oke_helm_chart_deploy_stage_details.go index 71d1e1a39a..98a7eacf6d 100644 --- a/devops/create_oke_helm_chart_deploy_stage_details.go +++ b/devops/create_oke_helm_chart_deploy_stage_details.go @@ -48,6 +48,12 @@ type CreateOkeHelmChartDeployStageDetails struct { // List of values.yaml file artifact OCIDs. ValuesArtifactIds []string `mandatory:"false" json:"valuesArtifactIds"` + // Uninstall the Helm chart release on deleting the stage. + IsUninstallOnStageDelete *bool `mandatory:"false" json:"isUninstallOnStageDelete"` + + // List of Helm command artifact OCIDs. + HelmCommandArtifactIds []string `mandatory:"false" json:"helmCommandArtifactIds"` + // Default namespace to be used for Kubernetes deployment when not specified in the manifest. Namespace *string `mandatory:"false" json:"namespace"` @@ -89,6 +95,9 @@ type CreateOkeHelmChartDeployStageDetails struct { // Enables helm --debug option to stream output to tf stdout. Set to false by default. IsDebugEnabled *bool `mandatory:"false" json:"isDebugEnabled"` + + // The purpose of running this Helm stage + Purpose CreateOkeHelmChartDeployStageDetailsPurposeEnum `mandatory:"false" json:"purpose,omitempty"` } // GetDescription returns Description @@ -130,6 +139,9 @@ func (m CreateOkeHelmChartDeployStageDetails) String() string { // Not recommended for calling this function directly func (m CreateOkeHelmChartDeployStageDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingCreateOkeHelmChartDeployStageDetailsPurposeEnum(string(m.Purpose)); !ok && m.Purpose != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Purpose: %s. Supported values are: %s.", m.Purpose, strings.Join(GetCreateOkeHelmChartDeployStageDetailsPurposeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) @@ -154,31 +166,34 @@ func (m CreateOkeHelmChartDeployStageDetails) MarshalJSON() (buff []byte, e erro // UnmarshalJSON unmarshals from json func (m *CreateOkeHelmChartDeployStageDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - Description *string `json:"description"` - DisplayName *string `json:"displayName"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - ValuesArtifactIds []string `json:"valuesArtifactIds"` - Namespace *string `json:"namespace"` - TimeoutInSeconds *int `json:"timeoutInSeconds"` - RollbackPolicy deploystagerollbackpolicy `json:"rollbackPolicy"` - SetValues *HelmSetValueCollection `json:"setValues"` - SetString *HelmSetValueCollection `json:"setString"` - AreHooksEnabled *bool `json:"areHooksEnabled"` - ShouldReuseValues *bool `json:"shouldReuseValues"` - ShouldResetValues *bool `json:"shouldResetValues"` - IsForceEnabled *bool `json:"isForceEnabled"` - ShouldCleanupOnFail *bool `json:"shouldCleanupOnFail"` - MaxHistory *int `json:"maxHistory"` - ShouldSkipCrds *bool `json:"shouldSkipCrds"` - ShouldSkipRenderSubchartNotes *bool `json:"shouldSkipRenderSubchartNotes"` - ShouldNotWait *bool `json:"shouldNotWait"` - IsDebugEnabled *bool `json:"isDebugEnabled"` - DeployPipelineId *string `json:"deployPipelineId"` - DeployStagePredecessorCollection *DeployStagePredecessorCollection `json:"deployStagePredecessorCollection"` - OkeClusterDeployEnvironmentId *string `json:"okeClusterDeployEnvironmentId"` - HelmChartDeployArtifactId *string `json:"helmChartDeployArtifactId"` - ReleaseName *string `json:"releaseName"` + Description *string `json:"description"` + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + ValuesArtifactIds []string `json:"valuesArtifactIds"` + IsUninstallOnStageDelete *bool `json:"isUninstallOnStageDelete"` + HelmCommandArtifactIds []string `json:"helmCommandArtifactIds"` + Purpose CreateOkeHelmChartDeployStageDetailsPurposeEnum `json:"purpose"` + Namespace *string `json:"namespace"` + TimeoutInSeconds *int `json:"timeoutInSeconds"` + RollbackPolicy deploystagerollbackpolicy `json:"rollbackPolicy"` + SetValues *HelmSetValueCollection `json:"setValues"` + SetString *HelmSetValueCollection `json:"setString"` + AreHooksEnabled *bool `json:"areHooksEnabled"` + ShouldReuseValues *bool `json:"shouldReuseValues"` + ShouldResetValues *bool `json:"shouldResetValues"` + IsForceEnabled *bool `json:"isForceEnabled"` + ShouldCleanupOnFail *bool `json:"shouldCleanupOnFail"` + MaxHistory *int `json:"maxHistory"` + ShouldSkipCrds *bool `json:"shouldSkipCrds"` + ShouldSkipRenderSubchartNotes *bool `json:"shouldSkipRenderSubchartNotes"` + ShouldNotWait *bool `json:"shouldNotWait"` + IsDebugEnabled *bool `json:"isDebugEnabled"` + DeployPipelineId *string `json:"deployPipelineId"` + DeployStagePredecessorCollection *DeployStagePredecessorCollection `json:"deployStagePredecessorCollection"` + OkeClusterDeployEnvironmentId *string `json:"okeClusterDeployEnvironmentId"` + HelmChartDeployArtifactId *string `json:"helmChartDeployArtifactId"` + ReleaseName *string `json:"releaseName"` }{} e = json.Unmarshal(data, &model) @@ -196,6 +211,12 @@ func (m *CreateOkeHelmChartDeployStageDetails) UnmarshalJSON(data []byte) (e err m.ValuesArtifactIds = make([]string, len(model.ValuesArtifactIds)) copy(m.ValuesArtifactIds, model.ValuesArtifactIds) + m.IsUninstallOnStageDelete = model.IsUninstallOnStageDelete + + m.HelmCommandArtifactIds = make([]string, len(model.HelmCommandArtifactIds)) + copy(m.HelmCommandArtifactIds, model.HelmCommandArtifactIds) + m.Purpose = model.Purpose + m.Namespace = model.Namespace m.TimeoutInSeconds = model.TimeoutInSeconds @@ -246,3 +267,45 @@ func (m *CreateOkeHelmChartDeployStageDetails) UnmarshalJSON(data []byte) (e err return } + +// CreateOkeHelmChartDeployStageDetailsPurposeEnum Enum with underlying type: string +type CreateOkeHelmChartDeployStageDetailsPurposeEnum string + +// Set of constants representing the allowable values for CreateOkeHelmChartDeployStageDetailsPurposeEnum +const ( + CreateOkeHelmChartDeployStageDetailsPurposeUpgrade CreateOkeHelmChartDeployStageDetailsPurposeEnum = "EXECUTE_HELM_UPGRADE" + CreateOkeHelmChartDeployStageDetailsPurposeCommand CreateOkeHelmChartDeployStageDetailsPurposeEnum = "EXECUTE_HELM_COMMAND" +) + +var mappingCreateOkeHelmChartDeployStageDetailsPurposeEnum = map[string]CreateOkeHelmChartDeployStageDetailsPurposeEnum{ + "EXECUTE_HELM_UPGRADE": CreateOkeHelmChartDeployStageDetailsPurposeUpgrade, + "EXECUTE_HELM_COMMAND": CreateOkeHelmChartDeployStageDetailsPurposeCommand, +} + +var mappingCreateOkeHelmChartDeployStageDetailsPurposeEnumLowerCase = map[string]CreateOkeHelmChartDeployStageDetailsPurposeEnum{ + "execute_helm_upgrade": CreateOkeHelmChartDeployStageDetailsPurposeUpgrade, + "execute_helm_command": CreateOkeHelmChartDeployStageDetailsPurposeCommand, +} + +// GetCreateOkeHelmChartDeployStageDetailsPurposeEnumValues Enumerates the set of values for CreateOkeHelmChartDeployStageDetailsPurposeEnum +func GetCreateOkeHelmChartDeployStageDetailsPurposeEnumValues() []CreateOkeHelmChartDeployStageDetailsPurposeEnum { + values := make([]CreateOkeHelmChartDeployStageDetailsPurposeEnum, 0) + for _, v := range mappingCreateOkeHelmChartDeployStageDetailsPurposeEnum { + values = append(values, v) + } + return values +} + +// GetCreateOkeHelmChartDeployStageDetailsPurposeEnumStringValues Enumerates the set of values in String for CreateOkeHelmChartDeployStageDetailsPurposeEnum +func GetCreateOkeHelmChartDeployStageDetailsPurposeEnumStringValues() []string { + return []string{ + "EXECUTE_HELM_UPGRADE", + "EXECUTE_HELM_COMMAND", + } +} + +// GetMappingCreateOkeHelmChartDeployStageDetailsPurposeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateOkeHelmChartDeployStageDetailsPurposeEnum(val string) (CreateOkeHelmChartDeployStageDetailsPurposeEnum, bool) { + enum, ok := mappingCreateOkeHelmChartDeployStageDetailsPurposeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/devops/create_repository_details.go b/devops/create_repository_details.go index a20701160d..afe10c9e96 100644 --- a/devops/create_repository_details.go +++ b/devops/create_repository_details.go @@ -18,7 +18,7 @@ import ( // CreateRepositoryDetails Information about the new repository. type CreateRepositoryDetails struct { - // Unique name of a repository. + // Name of the repository. Should be unique within the project. Name *string `mandatory:"true" json:"name"` // The OCID of the DevOps project containing the repository. diff --git a/devops/delete_ref_request_response.go b/devops/delete_ref_request_response.go index 5c519c9cff..5c9da3ee22 100644 --- a/devops/delete_ref_request_response.go +++ b/devops/delete_ref_request_response.go @@ -86,6 +86,9 @@ type DeleteRefResponse struct { // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // This API will be deprecated on Wed, 12 June 2024 01:00:00 GMT as it does not get recognized when refName has '/'. This will be replaced by "/repositories/{repositoryId}/actions/deleteGitRef". + Sunset *string `presentIn:"header" name:"sunset"` } func (response DeleteRefResponse) String() string { diff --git a/devops/deploy_artifact.go b/devops/deploy_artifact.go index 538924e05b..47b0d0ad33 100644 --- a/devops/deploy_artifact.go +++ b/devops/deploy_artifact.go @@ -166,6 +166,7 @@ const ( DeployArtifactDeployArtifactTypeGenericFile DeployArtifactDeployArtifactTypeEnum = "GENERIC_FILE" DeployArtifactDeployArtifactTypeDockerImage DeployArtifactDeployArtifactTypeEnum = "DOCKER_IMAGE" DeployArtifactDeployArtifactTypeHelmChart DeployArtifactDeployArtifactTypeEnum = "HELM_CHART" + DeployArtifactDeployArtifactTypeHelmCommandSpec DeployArtifactDeployArtifactTypeEnum = "HELM_COMMAND_SPEC" DeployArtifactDeployArtifactTypeCommandSpec DeployArtifactDeployArtifactTypeEnum = "COMMAND_SPEC" ) @@ -176,6 +177,7 @@ var mappingDeployArtifactDeployArtifactTypeEnum = map[string]DeployArtifactDeplo "GENERIC_FILE": DeployArtifactDeployArtifactTypeGenericFile, "DOCKER_IMAGE": DeployArtifactDeployArtifactTypeDockerImage, "HELM_CHART": DeployArtifactDeployArtifactTypeHelmChart, + "HELM_COMMAND_SPEC": DeployArtifactDeployArtifactTypeHelmCommandSpec, "COMMAND_SPEC": DeployArtifactDeployArtifactTypeCommandSpec, } @@ -186,6 +188,7 @@ var mappingDeployArtifactDeployArtifactTypeEnumLowerCase = map[string]DeployArti "generic_file": DeployArtifactDeployArtifactTypeGenericFile, "docker_image": DeployArtifactDeployArtifactTypeDockerImage, "helm_chart": DeployArtifactDeployArtifactTypeHelmChart, + "helm_command_spec": DeployArtifactDeployArtifactTypeHelmCommandSpec, "command_spec": DeployArtifactDeployArtifactTypeCommandSpec, } @@ -207,6 +210,7 @@ func GetDeployArtifactDeployArtifactTypeEnumStringValues() []string { "GENERIC_FILE", "DOCKER_IMAGE", "HELM_CHART", + "HELM_COMMAND_SPEC", "COMMAND_SPEC", } } diff --git a/devops/deploy_artifact_source.go b/devops/deploy_artifact_source.go index daaa9a9ff0..351d1a75bc 100644 --- a/devops/deploy_artifact_source.go +++ b/devops/deploy_artifact_source.go @@ -62,6 +62,10 @@ func (m *deployartifactsource) UnmarshalPolymorphicJSON(data []byte) (interface{ mm := OcirDeployArtifactSource{} err = json.Unmarshal(data, &mm) return mm, err + case "HELM_COMMAND_SPEC": + mm := HelmCommandSpecArtifactSource{} + err = json.Unmarshal(data, &mm) + return mm, err case "INLINE": mm := InlineDeployArtifactSource{} err = json.Unmarshal(data, &mm) diff --git a/devops/devops_client.go b/devops/devops_client.go index 5526808284..7435ccb82f 100644 --- a/devops/devops_client.go +++ b/devops/devops_client.go @@ -1626,7 +1626,7 @@ func (client DevopsClient) deleteProject(ctx context.Context, request common.OCI return response, err } -// DeleteRef Deletes a Repository's Ref by its name. Returns an error if the name is ambiguous. Can be disambiguated by using full names like "heads/" or "tags/". +// DeleteRef Deletes a Repository's Ref by its name. Returns an error if the name is ambiguous. Can be disambiguated by using full names like "heads/" or "tags/". This API will be deprecated on Wed, 12 June 2024 01:00:00 GMT as it does not get recognized when refName has '/'. This will be replaced by "/repositories/{repositoryId}/actions/deleteGitRef". // // # See also // @@ -2732,7 +2732,7 @@ func (client DevopsClient) getProject(ctx context.Context, request common.OCIReq return response, err } -// GetRef Retrieves a repository's reference by its name with preference for branches over tags if the name is ambiguous. This can be disambiguated by using full names like "heads/" or "tags/". +// GetRef This API will be deprecated on Wed, 12 June 2024 01:00:00 GMT as it does not get recognized when refName has '/'. This will be replaced by "/repositories/{repositoryId}/refs". Retrieves a repository's reference by its name with preference for branches over tags if the name is ambiguous. This can be disambiguated by using full names like "heads/" or "tags/". // // # See also // @@ -4471,7 +4471,7 @@ func (client DevopsClient) mirrorRepository(ctx context.Context, request common. return response, err } -// PutRepositoryRef Creates a new reference or updates an existing one. +// PutRepositoryRef Creates a new reference or updates an existing one. This API will be deprecated on Wed, 12 June 2024 01:00:00 GMT as it does not get recognized when refName has '/'. This will be replaced by "/repositories/{repositoryId}/actions/createOrUpdateGitRef". // // # See also // diff --git a/devops/devops_code_repository_filter.go b/devops/devops_code_repository_filter.go index b02c5a0701..71facf9e4c 100644 --- a/devops/devops_code_repository_filter.go +++ b/devops/devops_code_repository_filter.go @@ -22,7 +22,7 @@ type DevopsCodeRepositoryFilter struct { Exclude *DevopsCodeRepositoryFilterExclusionAttributes `mandatory:"false" json:"exclude"` - // The events only support PUSH. + // The events, for example, PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED. Events []DevopsCodeRepositoryFilterEventsEnum `mandatory:"false" json:"events,omitempty"` } diff --git a/devops/devops_code_repository_filter_attributes.go b/devops/devops_code_repository_filter_attributes.go index ff9980a049..b706b3799f 100644 --- a/devops/devops_code_repository_filter_attributes.go +++ b/devops/devops_code_repository_filter_attributes.go @@ -18,7 +18,7 @@ import ( // DevopsCodeRepositoryFilterAttributes Attributes to filter DevOps code repository events. type DevopsCodeRepositoryFilterAttributes struct { - // Branch for push event. + // Branch for push event; source branch for pull requests HeadRef *string `mandatory:"false" json:"headRef"` FileFilter *FileFilter `mandatory:"false" json:"fileFilter"` diff --git a/devops/diff_summary.go b/devops/diff_summary.go index cb06be9467..1a435269e2 100644 --- a/devops/diff_summary.go +++ b/devops/diff_summary.go @@ -47,6 +47,9 @@ type DiffSummary struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m DiffSummary) String() string { diff --git a/devops/get_ref_request_response.go b/devops/get_ref_request_response.go index 638e9d660d..671e4b0d10 100644 --- a/devops/get_ref_request_response.go +++ b/devops/get_ref_request_response.go @@ -83,6 +83,9 @@ type GetRefResponse struct { // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // This API will be deprecated on Wed, 12 June 2024 01:00:00 GMT as it does not get recognized when refName has '/'. This will be replaced by "/repositories/{repositoryId}/refs". + Sunset *string `presentIn:"header" name:"sunset"` } func (response GetRefResponse) String() string { diff --git a/devops/helm_command_spec_artifact_source.go b/devops/helm_command_spec_artifact_source.go new file mode 100644 index 0000000000..ca43c4b7de --- /dev/null +++ b/devops/helm_command_spec_artifact_source.go @@ -0,0 +1,98 @@ +// 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. + +// DevOps API +// +// Use the DevOps API to create DevOps projects, configure code repositories, add artifacts to deploy, build and test software applications, configure target deployment environments, and deploy software applications. For more information, see DevOps (https://docs.cloud.oracle.com/Content/devops/using/home.htm). +// + +package devops + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HelmCommandSpecArtifactSource Specifies Helm command spec details +type HelmCommandSpecArtifactSource struct { + + // The Helm commands to be executed, base 64 encoded + Base64EncodedContent *string `mandatory:"true" json:"base64EncodedContent"` + + // Specifies types of artifact sources. + HelmArtifactSourceType HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum `mandatory:"true" json:"helmArtifactSourceType"` +} + +func (m HelmCommandSpecArtifactSource) 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 HelmCommandSpecArtifactSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum(string(m.HelmArtifactSourceType)); !ok && m.HelmArtifactSourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for HelmArtifactSourceType: %s. Supported values are: %s.", m.HelmArtifactSourceType, strings.Join(GetHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m HelmCommandSpecArtifactSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeHelmCommandSpecArtifactSource HelmCommandSpecArtifactSource + s := struct { + DiscriminatorParam string `json:"deployArtifactSourceType"` + MarshalTypeHelmCommandSpecArtifactSource + }{ + "HELM_COMMAND_SPEC", + (MarshalTypeHelmCommandSpecArtifactSource)(m), + } + + return json.Marshal(&s) +} + +// HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum Enum with underlying type: string +type HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum string + +// Set of constants representing the allowable values for HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum +const ( + HelmCommandSpecArtifactSourceHelmArtifactSourceTypeInline HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum = "INLINE" +) + +var mappingHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum = map[string]HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum{ + "INLINE": HelmCommandSpecArtifactSourceHelmArtifactSourceTypeInline, +} + +var mappingHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnumLowerCase = map[string]HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum{ + "inline": HelmCommandSpecArtifactSourceHelmArtifactSourceTypeInline, +} + +// GetHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnumValues Enumerates the set of values for HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum +func GetHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnumValues() []HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum { + values := make([]HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum, 0) + for _, v := range mappingHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnumStringValues Enumerates the set of values in String for HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum +func GetHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnumStringValues() []string { + return []string{ + "INLINE", + } +} + +// GetMappingHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum(val string) (HelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnum, bool) { + enum, ok := mappingHelmCommandSpecArtifactSourceHelmArtifactSourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/devops/oke_helm_chart_deploy_stage.go b/devops/oke_helm_chart_deploy_stage.go index 154b587148..5a124382eb 100644 --- a/devops/oke_helm_chart_deploy_stage.go +++ b/devops/oke_helm_chart_deploy_stage.go @@ -69,6 +69,12 @@ type OkeHelmChartDeployStage struct { // List of values.yaml file artifact OCIDs. ValuesArtifactIds []string `mandatory:"false" json:"valuesArtifactIds"` + // Uninstall the Helm chart release on deleting the stage. + IsUninstallOnStageDelete *bool `mandatory:"false" json:"isUninstallOnStageDelete"` + + // List of Helm command artifact OCIDs. + HelmCommandArtifactIds []string `mandatory:"false" json:"helmCommandArtifactIds"` + // Default namespace to be used for Kubernetes deployment when not specified in the manifest. Namespace *string `mandatory:"false" json:"namespace"` @@ -111,6 +117,9 @@ type OkeHelmChartDeployStage struct { // Enables helm --debug option to stream output to tf stdout. Set to false by default. IsDebugEnabled *bool `mandatory:"false" json:"isDebugEnabled"` + // The purpose of running this Helm stage + Purpose OkeHelmChartDeployStagePurposeEnum `mandatory:"false" json:"purpose,omitempty"` + // The current state of the deployment stage. LifecycleState DeployStageLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` } @@ -194,6 +203,9 @@ func (m OkeHelmChartDeployStage) String() string { // Not recommended for calling this function directly func (m OkeHelmChartDeployStage) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingOkeHelmChartDeployStagePurposeEnum(string(m.Purpose)); !ok && m.Purpose != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Purpose: %s. Supported values are: %s.", m.Purpose, strings.Join(GetOkeHelmChartDeployStagePurposeEnumStringValues(), ","))) + } if _, ok := GetMappingDeployStageLifecycleStateEnum(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(GetDeployStageLifecycleStateEnumStringValues(), ","))) @@ -221,39 +233,42 @@ func (m OkeHelmChartDeployStage) MarshalJSON() (buff []byte, e error) { // UnmarshalJSON unmarshals from json func (m *OkeHelmChartDeployStage) UnmarshalJSON(data []byte) (e error) { model := struct { - Description *string `json:"description"` - DisplayName *string `json:"displayName"` - TimeCreated *common.SDKTime `json:"timeCreated"` - TimeUpdated *common.SDKTime `json:"timeUpdated"` - LifecycleState DeployStageLifecycleStateEnum `json:"lifecycleState"` - LifecycleDetails *string `json:"lifecycleDetails"` - DeployStagePredecessorCollection *DeployStagePredecessorCollection `json:"deployStagePredecessorCollection"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - SystemTags map[string]map[string]interface{} `json:"systemTags"` - ValuesArtifactIds []string `json:"valuesArtifactIds"` - Namespace *string `json:"namespace"` - TimeoutInSeconds *int `json:"timeoutInSeconds"` - RollbackPolicy deploystagerollbackpolicy `json:"rollbackPolicy"` - SetValues *HelmSetValueCollection `json:"setValues"` - SetString *HelmSetValueCollection `json:"setString"` - AreHooksEnabled *bool `json:"areHooksEnabled"` - ShouldReuseValues *bool `json:"shouldReuseValues"` - ShouldResetValues *bool `json:"shouldResetValues"` - IsForceEnabled *bool `json:"isForceEnabled"` - ShouldCleanupOnFail *bool `json:"shouldCleanupOnFail"` - MaxHistory *int `json:"maxHistory"` - ShouldSkipCrds *bool `json:"shouldSkipCrds"` - ShouldSkipRenderSubchartNotes *bool `json:"shouldSkipRenderSubchartNotes"` - ShouldNotWait *bool `json:"shouldNotWait"` - IsDebugEnabled *bool `json:"isDebugEnabled"` - Id *string `json:"id"` - ProjectId *string `json:"projectId"` - DeployPipelineId *string `json:"deployPipelineId"` - CompartmentId *string `json:"compartmentId"` - OkeClusterDeployEnvironmentId *string `json:"okeClusterDeployEnvironmentId"` - HelmChartDeployArtifactId *string `json:"helmChartDeployArtifactId"` - ReleaseName *string `json:"releaseName"` + Description *string `json:"description"` + DisplayName *string `json:"displayName"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleState DeployStageLifecycleStateEnum `json:"lifecycleState"` + LifecycleDetails *string `json:"lifecycleDetails"` + DeployStagePredecessorCollection *DeployStagePredecessorCollection `json:"deployStagePredecessorCollection"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + ValuesArtifactIds []string `json:"valuesArtifactIds"` + IsUninstallOnStageDelete *bool `json:"isUninstallOnStageDelete"` + HelmCommandArtifactIds []string `json:"helmCommandArtifactIds"` + Purpose OkeHelmChartDeployStagePurposeEnum `json:"purpose"` + Namespace *string `json:"namespace"` + TimeoutInSeconds *int `json:"timeoutInSeconds"` + RollbackPolicy deploystagerollbackpolicy `json:"rollbackPolicy"` + SetValues *HelmSetValueCollection `json:"setValues"` + SetString *HelmSetValueCollection `json:"setString"` + AreHooksEnabled *bool `json:"areHooksEnabled"` + ShouldReuseValues *bool `json:"shouldReuseValues"` + ShouldResetValues *bool `json:"shouldResetValues"` + IsForceEnabled *bool `json:"isForceEnabled"` + ShouldCleanupOnFail *bool `json:"shouldCleanupOnFail"` + MaxHistory *int `json:"maxHistory"` + ShouldSkipCrds *bool `json:"shouldSkipCrds"` + ShouldSkipRenderSubchartNotes *bool `json:"shouldSkipRenderSubchartNotes"` + ShouldNotWait *bool `json:"shouldNotWait"` + IsDebugEnabled *bool `json:"isDebugEnabled"` + Id *string `json:"id"` + ProjectId *string `json:"projectId"` + DeployPipelineId *string `json:"deployPipelineId"` + CompartmentId *string `json:"compartmentId"` + OkeClusterDeployEnvironmentId *string `json:"okeClusterDeployEnvironmentId"` + HelmChartDeployArtifactId *string `json:"helmChartDeployArtifactId"` + ReleaseName *string `json:"releaseName"` }{} e = json.Unmarshal(data, &model) @@ -283,6 +298,12 @@ func (m *OkeHelmChartDeployStage) UnmarshalJSON(data []byte) (e error) { m.ValuesArtifactIds = make([]string, len(model.ValuesArtifactIds)) copy(m.ValuesArtifactIds, model.ValuesArtifactIds) + m.IsUninstallOnStageDelete = model.IsUninstallOnStageDelete + + m.HelmCommandArtifactIds = make([]string, len(model.HelmCommandArtifactIds)) + copy(m.HelmCommandArtifactIds, model.HelmCommandArtifactIds) + m.Purpose = model.Purpose + m.Namespace = model.Namespace m.TimeoutInSeconds = model.TimeoutInSeconds @@ -337,3 +358,45 @@ func (m *OkeHelmChartDeployStage) UnmarshalJSON(data []byte) (e error) { return } + +// OkeHelmChartDeployStagePurposeEnum Enum with underlying type: string +type OkeHelmChartDeployStagePurposeEnum string + +// Set of constants representing the allowable values for OkeHelmChartDeployStagePurposeEnum +const ( + OkeHelmChartDeployStagePurposeUpgrade OkeHelmChartDeployStagePurposeEnum = "EXECUTE_HELM_UPGRADE" + OkeHelmChartDeployStagePurposeCommand OkeHelmChartDeployStagePurposeEnum = "EXECUTE_HELM_COMMAND" +) + +var mappingOkeHelmChartDeployStagePurposeEnum = map[string]OkeHelmChartDeployStagePurposeEnum{ + "EXECUTE_HELM_UPGRADE": OkeHelmChartDeployStagePurposeUpgrade, + "EXECUTE_HELM_COMMAND": OkeHelmChartDeployStagePurposeCommand, +} + +var mappingOkeHelmChartDeployStagePurposeEnumLowerCase = map[string]OkeHelmChartDeployStagePurposeEnum{ + "execute_helm_upgrade": OkeHelmChartDeployStagePurposeUpgrade, + "execute_helm_command": OkeHelmChartDeployStagePurposeCommand, +} + +// GetOkeHelmChartDeployStagePurposeEnumValues Enumerates the set of values for OkeHelmChartDeployStagePurposeEnum +func GetOkeHelmChartDeployStagePurposeEnumValues() []OkeHelmChartDeployStagePurposeEnum { + values := make([]OkeHelmChartDeployStagePurposeEnum, 0) + for _, v := range mappingOkeHelmChartDeployStagePurposeEnum { + values = append(values, v) + } + return values +} + +// GetOkeHelmChartDeployStagePurposeEnumStringValues Enumerates the set of values in String for OkeHelmChartDeployStagePurposeEnum +func GetOkeHelmChartDeployStagePurposeEnumStringValues() []string { + return []string{ + "EXECUTE_HELM_UPGRADE", + "EXECUTE_HELM_COMMAND", + } +} + +// GetMappingOkeHelmChartDeployStagePurposeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOkeHelmChartDeployStagePurposeEnum(val string) (OkeHelmChartDeployStagePurposeEnum, bool) { + enum, ok := mappingOkeHelmChartDeployStagePurposeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/devops/oke_helm_chart_deploy_stage_summary.go b/devops/oke_helm_chart_deploy_stage_summary.go index a628cdf94a..c92c92b03d 100644 --- a/devops/oke_helm_chart_deploy_stage_summary.go +++ b/devops/oke_helm_chart_deploy_stage_summary.go @@ -69,6 +69,12 @@ type OkeHelmChartDeployStageSummary struct { // List of values.yaml file artifact OCIDs. ValuesArtifactIds []string `mandatory:"false" json:"valuesArtifactIds"` + // Uninstall the Helm chart release on deleting the stage. + IsUninstallOnStageDelete *bool `mandatory:"false" json:"isUninstallOnStageDelete"` + + // List of Helm command artifact OCIDs. + HelmCommandArtifactIds []string `mandatory:"false" json:"helmCommandArtifactIds"` + // Default namespace to be used for Kubernetes deployment when not specified in the manifest. Namespace *string `mandatory:"false" json:"namespace"` @@ -111,6 +117,9 @@ type OkeHelmChartDeployStageSummary struct { // Enables helm --debug option to stream output. Set to false by default. IsDebugEnabled *bool `mandatory:"false" json:"isDebugEnabled"` + // The purpose of running this Helm stage + Purpose OkeHelmChartDeployStageSummaryPurposeEnum `mandatory:"false" json:"purpose,omitempty"` + // The current state of the deployment stage. LifecycleState DeployStageLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` } @@ -194,6 +203,9 @@ func (m OkeHelmChartDeployStageSummary) String() string { // Not recommended for calling this function directly func (m OkeHelmChartDeployStageSummary) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingOkeHelmChartDeployStageSummaryPurposeEnum(string(m.Purpose)); !ok && m.Purpose != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Purpose: %s. Supported values are: %s.", m.Purpose, strings.Join(GetOkeHelmChartDeployStageSummaryPurposeEnumStringValues(), ","))) + } if _, ok := GetMappingDeployStageLifecycleStateEnum(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(GetDeployStageLifecycleStateEnumStringValues(), ","))) @@ -221,39 +233,42 @@ func (m OkeHelmChartDeployStageSummary) MarshalJSON() (buff []byte, e error) { // UnmarshalJSON unmarshals from json func (m *OkeHelmChartDeployStageSummary) UnmarshalJSON(data []byte) (e error) { model := struct { - Description *string `json:"description"` - DisplayName *string `json:"displayName"` - TimeCreated *common.SDKTime `json:"timeCreated"` - TimeUpdated *common.SDKTime `json:"timeUpdated"` - LifecycleState DeployStageLifecycleStateEnum `json:"lifecycleState"` - LifecycleDetails *string `json:"lifecycleDetails"` - DeployStagePredecessorCollection *DeployStagePredecessorCollection `json:"deployStagePredecessorCollection"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - SystemTags map[string]map[string]interface{} `json:"systemTags"` - ValuesArtifactIds []string `json:"valuesArtifactIds"` - Namespace *string `json:"namespace"` - TimeoutInSeconds *int `json:"timeoutInSeconds"` - RollbackPolicy deploystagerollbackpolicy `json:"rollbackPolicy"` - SetValues *HelmSetValueCollection `json:"setValues"` - SetString *HelmSetValueCollection `json:"setString"` - AreHooksEnabled *bool `json:"areHooksEnabled"` - ShouldReuseValues *bool `json:"shouldReuseValues"` - ShouldResetValues *bool `json:"shouldResetValues"` - IsForceEnabled *bool `json:"isForceEnabled"` - ShouldCleanupOnFail *bool `json:"shouldCleanupOnFail"` - MaxHistory *int `json:"maxHistory"` - ShouldSkipCrds *bool `json:"shouldSkipCrds"` - ShouldSkipRenderSubchartNotes *bool `json:"shouldSkipRenderSubchartNotes"` - ShouldNotWait *bool `json:"shouldNotWait"` - IsDebugEnabled *bool `json:"isDebugEnabled"` - Id *string `json:"id"` - ProjectId *string `json:"projectId"` - DeployPipelineId *string `json:"deployPipelineId"` - CompartmentId *string `json:"compartmentId"` - OkeClusterDeployEnvironmentId *string `json:"okeClusterDeployEnvironmentId"` - HelmChartDeployArtifactId *string `json:"helmChartDeployArtifactId"` - ReleaseName *string `json:"releaseName"` + Description *string `json:"description"` + DisplayName *string `json:"displayName"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleState DeployStageLifecycleStateEnum `json:"lifecycleState"` + LifecycleDetails *string `json:"lifecycleDetails"` + DeployStagePredecessorCollection *DeployStagePredecessorCollection `json:"deployStagePredecessorCollection"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + ValuesArtifactIds []string `json:"valuesArtifactIds"` + IsUninstallOnStageDelete *bool `json:"isUninstallOnStageDelete"` + HelmCommandArtifactIds []string `json:"helmCommandArtifactIds"` + Purpose OkeHelmChartDeployStageSummaryPurposeEnum `json:"purpose"` + Namespace *string `json:"namespace"` + TimeoutInSeconds *int `json:"timeoutInSeconds"` + RollbackPolicy deploystagerollbackpolicy `json:"rollbackPolicy"` + SetValues *HelmSetValueCollection `json:"setValues"` + SetString *HelmSetValueCollection `json:"setString"` + AreHooksEnabled *bool `json:"areHooksEnabled"` + ShouldReuseValues *bool `json:"shouldReuseValues"` + ShouldResetValues *bool `json:"shouldResetValues"` + IsForceEnabled *bool `json:"isForceEnabled"` + ShouldCleanupOnFail *bool `json:"shouldCleanupOnFail"` + MaxHistory *int `json:"maxHistory"` + ShouldSkipCrds *bool `json:"shouldSkipCrds"` + ShouldSkipRenderSubchartNotes *bool `json:"shouldSkipRenderSubchartNotes"` + ShouldNotWait *bool `json:"shouldNotWait"` + IsDebugEnabled *bool `json:"isDebugEnabled"` + Id *string `json:"id"` + ProjectId *string `json:"projectId"` + DeployPipelineId *string `json:"deployPipelineId"` + CompartmentId *string `json:"compartmentId"` + OkeClusterDeployEnvironmentId *string `json:"okeClusterDeployEnvironmentId"` + HelmChartDeployArtifactId *string `json:"helmChartDeployArtifactId"` + ReleaseName *string `json:"releaseName"` }{} e = json.Unmarshal(data, &model) @@ -283,6 +298,12 @@ func (m *OkeHelmChartDeployStageSummary) UnmarshalJSON(data []byte) (e error) { m.ValuesArtifactIds = make([]string, len(model.ValuesArtifactIds)) copy(m.ValuesArtifactIds, model.ValuesArtifactIds) + m.IsUninstallOnStageDelete = model.IsUninstallOnStageDelete + + m.HelmCommandArtifactIds = make([]string, len(model.HelmCommandArtifactIds)) + copy(m.HelmCommandArtifactIds, model.HelmCommandArtifactIds) + m.Purpose = model.Purpose + m.Namespace = model.Namespace m.TimeoutInSeconds = model.TimeoutInSeconds @@ -337,3 +358,45 @@ func (m *OkeHelmChartDeployStageSummary) UnmarshalJSON(data []byte) (e error) { return } + +// OkeHelmChartDeployStageSummaryPurposeEnum Enum with underlying type: string +type OkeHelmChartDeployStageSummaryPurposeEnum string + +// Set of constants representing the allowable values for OkeHelmChartDeployStageSummaryPurposeEnum +const ( + OkeHelmChartDeployStageSummaryPurposeUpgrade OkeHelmChartDeployStageSummaryPurposeEnum = "EXECUTE_HELM_UPGRADE" + OkeHelmChartDeployStageSummaryPurposeCommand OkeHelmChartDeployStageSummaryPurposeEnum = "EXECUTE_HELM_COMMAND" +) + +var mappingOkeHelmChartDeployStageSummaryPurposeEnum = map[string]OkeHelmChartDeployStageSummaryPurposeEnum{ + "EXECUTE_HELM_UPGRADE": OkeHelmChartDeployStageSummaryPurposeUpgrade, + "EXECUTE_HELM_COMMAND": OkeHelmChartDeployStageSummaryPurposeCommand, +} + +var mappingOkeHelmChartDeployStageSummaryPurposeEnumLowerCase = map[string]OkeHelmChartDeployStageSummaryPurposeEnum{ + "execute_helm_upgrade": OkeHelmChartDeployStageSummaryPurposeUpgrade, + "execute_helm_command": OkeHelmChartDeployStageSummaryPurposeCommand, +} + +// GetOkeHelmChartDeployStageSummaryPurposeEnumValues Enumerates the set of values for OkeHelmChartDeployStageSummaryPurposeEnum +func GetOkeHelmChartDeployStageSummaryPurposeEnumValues() []OkeHelmChartDeployStageSummaryPurposeEnum { + values := make([]OkeHelmChartDeployStageSummaryPurposeEnum, 0) + for _, v := range mappingOkeHelmChartDeployStageSummaryPurposeEnum { + values = append(values, v) + } + return values +} + +// GetOkeHelmChartDeployStageSummaryPurposeEnumStringValues Enumerates the set of values in String for OkeHelmChartDeployStageSummaryPurposeEnum +func GetOkeHelmChartDeployStageSummaryPurposeEnumStringValues() []string { + return []string{ + "EXECUTE_HELM_UPGRADE", + "EXECUTE_HELM_COMMAND", + } +} + +// GetMappingOkeHelmChartDeployStageSummaryPurposeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOkeHelmChartDeployStageSummaryPurposeEnum(val string) (OkeHelmChartDeployStageSummaryPurposeEnum, bool) { + enum, ok := mappingOkeHelmChartDeployStageSummaryPurposeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/devops/put_repository_ref_request_response.go b/devops/put_repository_ref_request_response.go index b7cbad68fe..d4cb6d8e76 100644 --- a/devops/put_repository_ref_request_response.go +++ b/devops/put_repository_ref_request_response.go @@ -98,6 +98,9 @@ type PutRepositoryRefResponse struct { // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // This API will be deprecated on Wed, 12 June 2024 01:00:00 GMT as it does not get recognized when refName has '/'. This will be replaced by "/repositories/{repositoryId}/actions/createOrUpdateGitRef". + Sunset *string `presentIn:"header" name:"sunset"` } func (response PutRepositoryRefResponse) String() string { diff --git a/devops/repository.go b/devops/repository.go index 1575655020..9dc8d6cf8d 100644 --- a/devops/repository.go +++ b/devops/repository.go @@ -27,7 +27,7 @@ type Repository struct { // The OCID of the DevOps project containing the repository. ProjectId *string `mandatory:"true" json:"projectId"` - // Unique name of a repository. This value is mutable. + // Name of the repository. Should be unique within the project. This value is mutable. Name *string `mandatory:"false" json:"name"` // Tenancy unique namespace. @@ -78,6 +78,8 @@ type Repository struct { // Trigger build events supported for this repository: // PUSH - Build is triggered when a push event occurs. + // PULL_REQUEST_CREATED - Build is triggered when a pull request is created in the repository. + // PULL_REQUEST_UPDATED - Build is triggered when a push is made to a branch with an open pull request. // COMMIT_UPDATES - Build is triggered when new commits are mirrored into a repository. TriggerBuildEvents []RepositoryTriggerBuildEventsEnum `mandatory:"false" json:"triggerBuildEvents,omitempty"` @@ -216,18 +218,24 @@ type RepositoryTriggerBuildEventsEnum string // Set of constants representing the allowable values for RepositoryTriggerBuildEventsEnum const ( - RepositoryTriggerBuildEventsPush RepositoryTriggerBuildEventsEnum = "PUSH" - RepositoryTriggerBuildEventsCommitUpdates RepositoryTriggerBuildEventsEnum = "COMMIT_UPDATES" + RepositoryTriggerBuildEventsPush RepositoryTriggerBuildEventsEnum = "PUSH" + RepositoryTriggerBuildEventsPullRequestCreated RepositoryTriggerBuildEventsEnum = "PULL_REQUEST_CREATED" + RepositoryTriggerBuildEventsPullRequestUpdated RepositoryTriggerBuildEventsEnum = "PULL_REQUEST_UPDATED" + RepositoryTriggerBuildEventsCommitUpdates RepositoryTriggerBuildEventsEnum = "COMMIT_UPDATES" ) var mappingRepositoryTriggerBuildEventsEnum = map[string]RepositoryTriggerBuildEventsEnum{ - "PUSH": RepositoryTriggerBuildEventsPush, - "COMMIT_UPDATES": RepositoryTriggerBuildEventsCommitUpdates, + "PUSH": RepositoryTriggerBuildEventsPush, + "PULL_REQUEST_CREATED": RepositoryTriggerBuildEventsPullRequestCreated, + "PULL_REQUEST_UPDATED": RepositoryTriggerBuildEventsPullRequestUpdated, + "COMMIT_UPDATES": RepositoryTriggerBuildEventsCommitUpdates, } var mappingRepositoryTriggerBuildEventsEnumLowerCase = map[string]RepositoryTriggerBuildEventsEnum{ - "push": RepositoryTriggerBuildEventsPush, - "commit_updates": RepositoryTriggerBuildEventsCommitUpdates, + "push": RepositoryTriggerBuildEventsPush, + "pull_request_created": RepositoryTriggerBuildEventsPullRequestCreated, + "pull_request_updated": RepositoryTriggerBuildEventsPullRequestUpdated, + "commit_updates": RepositoryTriggerBuildEventsCommitUpdates, } // GetRepositoryTriggerBuildEventsEnumValues Enumerates the set of values for RepositoryTriggerBuildEventsEnum @@ -243,6 +251,8 @@ func GetRepositoryTriggerBuildEventsEnumValues() []RepositoryTriggerBuildEventsE func GetRepositoryTriggerBuildEventsEnumStringValues() []string { return []string{ "PUSH", + "PULL_REQUEST_CREATED", + "PULL_REQUEST_UPDATED", "COMMIT_UPDATES", } } diff --git a/devops/repository_author_summary.go b/devops/repository_author_summary.go index 2a65698c01..8f97742027 100644 --- a/devops/repository_author_summary.go +++ b/devops/repository_author_summary.go @@ -26,6 +26,9 @@ type RepositoryAuthorSummary struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m RepositoryAuthorSummary) String() string { diff --git a/devops/repository_branch_summary.go b/devops/repository_branch_summary.go index 6baba7beda..a2550b314c 100644 --- a/devops/repository_branch_summary.go +++ b/devops/repository_branch_summary.go @@ -36,6 +36,9 @@ type RepositoryBranchSummary struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } // GetRefName returns RefName @@ -63,6 +66,11 @@ func (m RepositoryBranchSummary) GetDefinedTags() map[string]map[string]interfac return m.DefinedTags } +// GetSystemTags returns SystemTags +func (m RepositoryBranchSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + func (m RepositoryBranchSummary) String() string { return common.PointerString(m) } diff --git a/devops/repository_commit_summary.go b/devops/repository_commit_summary.go index 1522c2b9bf..e55e23e8fc 100644 --- a/devops/repository_commit_summary.go +++ b/devops/repository_commit_summary.go @@ -50,6 +50,9 @@ type RepositoryCommitSummary struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m RepositoryCommitSummary) String() string { diff --git a/devops/repository_mirror_record_summary.go b/devops/repository_mirror_record_summary.go index 3019439d43..83386406e6 100644 --- a/devops/repository_mirror_record_summary.go +++ b/devops/repository_mirror_record_summary.go @@ -42,6 +42,9 @@ type RepositoryMirrorRecordSummary struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m RepositoryMirrorRecordSummary) String() string { diff --git a/devops/repository_path_summary.go b/devops/repository_path_summary.go index 5461548670..979ad49b6b 100644 --- a/devops/repository_path_summary.go +++ b/devops/repository_path_summary.go @@ -41,6 +41,9 @@ type RepositoryPathSummary struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m RepositoryPathSummary) String() string { diff --git a/devops/repository_ref_summary.go b/devops/repository_ref_summary.go index effc699f29..bc273000c8 100644 --- a/devops/repository_ref_summary.go +++ b/devops/repository_ref_summary.go @@ -33,12 +33,16 @@ type RepositoryRefSummary interface { // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"foo-namespace": {"bar-key": "value"}}` GetDefinedTags() map[string]map[string]interface{} + + // Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + GetSystemTags() map[string]map[string]interface{} } type repositoryrefsummary struct { JsonData []byte FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` RefName *string `mandatory:"true" json:"refName"` FullRefName *string `mandatory:"true" json:"fullRefName"` RepositoryId *string `mandatory:"true" json:"repositoryId"` @@ -61,6 +65,7 @@ func (m *repositoryrefsummary) UnmarshalJSON(data []byte) error { m.RepositoryId = s.Model.RepositoryId m.FreeformTags = s.Model.FreeformTags m.DefinedTags = s.Model.DefinedTags + m.SystemTags = s.Model.SystemTags m.RefType = s.Model.RefType return err @@ -99,6 +104,11 @@ func (m repositoryrefsummary) GetDefinedTags() map[string]map[string]interface{} return m.DefinedTags } +// GetSystemTags returns SystemTags +func (m repositoryrefsummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + // GetRefName returns RefName func (m repositoryrefsummary) GetRefName() *string { return m.RefName diff --git a/devops/repository_summary.go b/devops/repository_summary.go index a06ed23c64..27a73a3fec 100644 --- a/devops/repository_summary.go +++ b/devops/repository_summary.go @@ -27,7 +27,7 @@ type RepositorySummary struct { // The OCID of the DevOps project containing the repository. ProjectId *string `mandatory:"true" json:"projectId"` - // Unique name of a repository. This value is mutable. + // Name of the repository. Should be unique within the project. This value is mutable. Name *string `mandatory:"false" json:"name"` // Tenancy unique namespace. diff --git a/devops/repository_tag_summary.go b/devops/repository_tag_summary.go index 1d9b6aebf5..682b51a928 100644 --- a/devops/repository_tag_summary.go +++ b/devops/repository_tag_summary.go @@ -36,6 +36,9 @@ type RepositoryTagSummary struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } // GetRefName returns RefName @@ -63,6 +66,11 @@ func (m RepositoryTagSummary) GetDefinedTags() map[string]map[string]interface{} return m.DefinedTags } +// GetSystemTags returns SystemTags +func (m RepositoryTagSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + func (m RepositoryTagSummary) String() string { return common.PointerString(m) } diff --git a/devops/update_oke_helm_chart_deploy_stage_details.go b/devops/update_oke_helm_chart_deploy_stage_details.go index 472568d6cb..5b18348e7b 100644 --- a/devops/update_oke_helm_chart_deploy_stage_details.go +++ b/devops/update_oke_helm_chart_deploy_stage_details.go @@ -45,6 +45,12 @@ type UpdateOkeHelmChartDeployStageDetails struct { // Name of the Helm chart release. ReleaseName *string `mandatory:"false" json:"releaseName"` + // Uninstall the Helm chart release on deleting the stage. + IsUninstallOnStageDelete *bool `mandatory:"false" json:"isUninstallOnStageDelete"` + + // List of Helm command artifact OCIDs. + HelmCommandArtifactIds []string `mandatory:"false" json:"helmCommandArtifactIds"` + // Default namespace to be used for Kubernetes deployment when not specified in the manifest. Namespace *string `mandatory:"false" json:"namespace"` @@ -86,6 +92,9 @@ type UpdateOkeHelmChartDeployStageDetails struct { // Enables helm --debug option to stream output to tf stdout. Set to false by default. IsDebugEnabled *bool `mandatory:"false" json:"isDebugEnabled"` + + // The purpose of running this Helm stage + Purpose UpdateOkeHelmChartDeployStageDetailsPurposeEnum `mandatory:"false" json:"purpose,omitempty"` } // GetDescription returns Description @@ -122,6 +131,9 @@ func (m UpdateOkeHelmChartDeployStageDetails) String() string { // Not recommended for calling this function directly func (m UpdateOkeHelmChartDeployStageDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingUpdateOkeHelmChartDeployStageDetailsPurposeEnum(string(m.Purpose)); !ok && m.Purpose != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Purpose: %s. Supported values are: %s.", m.Purpose, strings.Join(GetUpdateOkeHelmChartDeployStageDetailsPurposeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) @@ -146,30 +158,33 @@ func (m UpdateOkeHelmChartDeployStageDetails) MarshalJSON() (buff []byte, e erro // UnmarshalJSON unmarshals from json func (m *UpdateOkeHelmChartDeployStageDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - Description *string `json:"description"` - DisplayName *string `json:"displayName"` - DeployStagePredecessorCollection *DeployStagePredecessorCollection `json:"deployStagePredecessorCollection"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - OkeClusterDeployEnvironmentId *string `json:"okeClusterDeployEnvironmentId"` - HelmChartDeployArtifactId *string `json:"helmChartDeployArtifactId"` - ValuesArtifactIds []string `json:"valuesArtifactIds"` - ReleaseName *string `json:"releaseName"` - Namespace *string `json:"namespace"` - TimeoutInSeconds *int `json:"timeoutInSeconds"` - RollbackPolicy deploystagerollbackpolicy `json:"rollbackPolicy"` - SetValues *HelmSetValueCollection `json:"setValues"` - SetString *HelmSetValueCollection `json:"setString"` - AreHooksEnabled *bool `json:"areHooksEnabled"` - ShouldReuseValues *bool `json:"shouldReuseValues"` - ShouldResetValues *bool `json:"shouldResetValues"` - IsForceEnabled *bool `json:"isForceEnabled"` - ShouldCleanupOnFail *bool `json:"shouldCleanupOnFail"` - MaxHistory *int `json:"maxHistory"` - ShouldSkipCrds *bool `json:"shouldSkipCrds"` - ShouldSkipRenderSubchartNotes *bool `json:"shouldSkipRenderSubchartNotes"` - ShouldNotWait *bool `json:"shouldNotWait"` - IsDebugEnabled *bool `json:"isDebugEnabled"` + Description *string `json:"description"` + DisplayName *string `json:"displayName"` + DeployStagePredecessorCollection *DeployStagePredecessorCollection `json:"deployStagePredecessorCollection"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + OkeClusterDeployEnvironmentId *string `json:"okeClusterDeployEnvironmentId"` + HelmChartDeployArtifactId *string `json:"helmChartDeployArtifactId"` + ValuesArtifactIds []string `json:"valuesArtifactIds"` + ReleaseName *string `json:"releaseName"` + IsUninstallOnStageDelete *bool `json:"isUninstallOnStageDelete"` + HelmCommandArtifactIds []string `json:"helmCommandArtifactIds"` + Purpose UpdateOkeHelmChartDeployStageDetailsPurposeEnum `json:"purpose"` + Namespace *string `json:"namespace"` + TimeoutInSeconds *int `json:"timeoutInSeconds"` + RollbackPolicy deploystagerollbackpolicy `json:"rollbackPolicy"` + SetValues *HelmSetValueCollection `json:"setValues"` + SetString *HelmSetValueCollection `json:"setString"` + AreHooksEnabled *bool `json:"areHooksEnabled"` + ShouldReuseValues *bool `json:"shouldReuseValues"` + ShouldResetValues *bool `json:"shouldResetValues"` + IsForceEnabled *bool `json:"isForceEnabled"` + ShouldCleanupOnFail *bool `json:"shouldCleanupOnFail"` + MaxHistory *int `json:"maxHistory"` + ShouldSkipCrds *bool `json:"shouldSkipCrds"` + ShouldSkipRenderSubchartNotes *bool `json:"shouldSkipRenderSubchartNotes"` + ShouldNotWait *bool `json:"shouldNotWait"` + IsDebugEnabled *bool `json:"isDebugEnabled"` }{} e = json.Unmarshal(data, &model) @@ -195,6 +210,12 @@ func (m *UpdateOkeHelmChartDeployStageDetails) UnmarshalJSON(data []byte) (e err copy(m.ValuesArtifactIds, model.ValuesArtifactIds) m.ReleaseName = model.ReleaseName + m.IsUninstallOnStageDelete = model.IsUninstallOnStageDelete + + m.HelmCommandArtifactIds = make([]string, len(model.HelmCommandArtifactIds)) + copy(m.HelmCommandArtifactIds, model.HelmCommandArtifactIds) + m.Purpose = model.Purpose + m.Namespace = model.Namespace m.TimeoutInSeconds = model.TimeoutInSeconds @@ -235,3 +256,45 @@ func (m *UpdateOkeHelmChartDeployStageDetails) UnmarshalJSON(data []byte) (e err return } + +// UpdateOkeHelmChartDeployStageDetailsPurposeEnum Enum with underlying type: string +type UpdateOkeHelmChartDeployStageDetailsPurposeEnum string + +// Set of constants representing the allowable values for UpdateOkeHelmChartDeployStageDetailsPurposeEnum +const ( + UpdateOkeHelmChartDeployStageDetailsPurposeUpgrade UpdateOkeHelmChartDeployStageDetailsPurposeEnum = "EXECUTE_HELM_UPGRADE" + UpdateOkeHelmChartDeployStageDetailsPurposeCommand UpdateOkeHelmChartDeployStageDetailsPurposeEnum = "EXECUTE_HELM_COMMAND" +) + +var mappingUpdateOkeHelmChartDeployStageDetailsPurposeEnum = map[string]UpdateOkeHelmChartDeployStageDetailsPurposeEnum{ + "EXECUTE_HELM_UPGRADE": UpdateOkeHelmChartDeployStageDetailsPurposeUpgrade, + "EXECUTE_HELM_COMMAND": UpdateOkeHelmChartDeployStageDetailsPurposeCommand, +} + +var mappingUpdateOkeHelmChartDeployStageDetailsPurposeEnumLowerCase = map[string]UpdateOkeHelmChartDeployStageDetailsPurposeEnum{ + "execute_helm_upgrade": UpdateOkeHelmChartDeployStageDetailsPurposeUpgrade, + "execute_helm_command": UpdateOkeHelmChartDeployStageDetailsPurposeCommand, +} + +// GetUpdateOkeHelmChartDeployStageDetailsPurposeEnumValues Enumerates the set of values for UpdateOkeHelmChartDeployStageDetailsPurposeEnum +func GetUpdateOkeHelmChartDeployStageDetailsPurposeEnumValues() []UpdateOkeHelmChartDeployStageDetailsPurposeEnum { + values := make([]UpdateOkeHelmChartDeployStageDetailsPurposeEnum, 0) + for _, v := range mappingUpdateOkeHelmChartDeployStageDetailsPurposeEnum { + values = append(values, v) + } + return values +} + +// GetUpdateOkeHelmChartDeployStageDetailsPurposeEnumStringValues Enumerates the set of values in String for UpdateOkeHelmChartDeployStageDetailsPurposeEnum +func GetUpdateOkeHelmChartDeployStageDetailsPurposeEnumStringValues() []string { + return []string{ + "EXECUTE_HELM_UPGRADE", + "EXECUTE_HELM_COMMAND", + } +} + +// GetMappingUpdateOkeHelmChartDeployStageDetailsPurposeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUpdateOkeHelmChartDeployStageDetailsPurposeEnum(val string) (UpdateOkeHelmChartDeployStageDetailsPurposeEnum, bool) { + enum, ok := mappingUpdateOkeHelmChartDeployStageDetailsPurposeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/devops/update_repository_details.go b/devops/update_repository_details.go index 70df37127c..76b01a5e2d 100644 --- a/devops/update_repository_details.go +++ b/devops/update_repository_details.go @@ -18,7 +18,7 @@ import ( // UpdateRepositoryDetails The information to be updated. type UpdateRepositoryDetails struct { - // Unique name of a repository. + // Name of the repository. Should be unique within the project. Name *string `mandatory:"false" json:"name"` // Details of the repository. Avoid entering confidential information. diff --git a/logging/create_unified_agent_configuration_details.go b/logging/create_unified_agent_configuration_details.go index 6486c7944b..fb8131a15e 100644 --- a/logging/create_unified_agent_configuration_details.go +++ b/logging/create_unified_agent_configuration_details.go @@ -21,6 +21,10 @@ import ( // CreateUnifiedAgentConfigurationDetails Unified Agent configuration creation object. type CreateUnifiedAgentConfigurationDetails struct { + // The user-friendly display name. This must be unique within the enclosing resource, + // and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + // Whether or not this resource is currently enabled. IsEnabled *bool `mandatory:"true" json:"isEnabled"` @@ -29,9 +33,8 @@ type CreateUnifiedAgentConfigurationDetails struct { // The OCID of the compartment that the resource belongs to. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The user-friendly display name. This must be unique within the enclosing resource, - // and it's changeable. Avoid entering confidential information. - DisplayName *string `mandatory:"false" json:"displayName"` + // Description for this resource. + Description *string `mandatory:"true" json:"description"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). @@ -43,9 +46,6 @@ type CreateUnifiedAgentConfigurationDetails struct { // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` - // Description for this resource. - Description *string `mandatory:"false" json:"description"` - GroupAssociation *GroupAssociationDetails `mandatory:"false" json:"groupAssociation"` } @@ -68,14 +68,14 @@ func (m CreateUnifiedAgentConfigurationDetails) ValidateEnumValue() (bool, error // UnmarshalJSON unmarshals from json func (m *CreateUnifiedAgentConfigurationDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - DisplayName *string `json:"displayName"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` FreeformTags map[string]string `json:"freeformTags"` - Description *string `json:"description"` GroupAssociation *GroupAssociationDetails `json:"groupAssociation"` + DisplayName *string `json:"displayName"` IsEnabled *bool `json:"isEnabled"` ServiceConfiguration unifiedagentserviceconfigurationdetails `json:"serviceConfiguration"` CompartmentId *string `json:"compartmentId"` + Description *string `json:"description"` }{} e = json.Unmarshal(data, &model) @@ -83,16 +83,14 @@ func (m *CreateUnifiedAgentConfigurationDetails) UnmarshalJSON(data []byte) (e e return } var nn interface{} - m.DisplayName = model.DisplayName - m.DefinedTags = model.DefinedTags m.FreeformTags = model.FreeformTags - m.Description = model.Description - m.GroupAssociation = model.GroupAssociation + m.DisplayName = model.DisplayName + m.IsEnabled = model.IsEnabled nn, e = model.ServiceConfiguration.UnmarshalPolymorphicJSON(model.ServiceConfiguration.JsonData) @@ -107,5 +105,7 @@ func (m *CreateUnifiedAgentConfigurationDetails) UnmarshalJSON(data []byte) (e e m.CompartmentId = model.CompartmentId + m.Description = model.Description + return } diff --git a/logging/grep_filter_allow_rule.go b/logging/grep_filter_allow_rule.go new file mode 100644 index 0000000000..f9acbdb0dd --- /dev/null +++ b/logging/grep_filter_allow_rule.go @@ -0,0 +1,44 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GrepFilterAllowRule Specifies the filtering rule +type GrepFilterAllowRule struct { + + // The field name to which the regular expression is applied + Key *string `mandatory:"false" json:"key"` + + // The regular expression + Pattern *string `mandatory:"false" json:"pattern"` +} + +func (m GrepFilterAllowRule) 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 GrepFilterAllowRule) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/grep_filter_deny_rule.go b/logging/grep_filter_deny_rule.go new file mode 100644 index 0000000000..d4a2239a59 --- /dev/null +++ b/logging/grep_filter_deny_rule.go @@ -0,0 +1,44 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GrepFilterDenyRule Specifies the filtering rule to reject logs +type GrepFilterDenyRule struct { + + // The field name to which the regular expression is applied + Key *string `mandatory:"false" json:"key"` + + // The regular expression + Pattern *string `mandatory:"false" json:"pattern"` +} + +func (m GrepFilterDenyRule) 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 GrepFilterDenyRule) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/operational_metrics_source.go b/logging/operational_metrics_source.go index 3dcf1fd102..77adc5755d 100644 --- a/logging/operational_metrics_source.go +++ b/logging/operational_metrics_source.go @@ -23,10 +23,10 @@ type OperationalMetricsSource struct { // Type of the unified monitoring agent operational metrics source object. Type OperationalMetricsSourceTypeEnum `mandatory:"true" json:"type"` + RecordInput *OperationalMetricsRecordInput `mandatory:"true" json:"recordInput"` + // List of unified monitoring agent operational metrics. Metrics []string `mandatory:"false" json:"metrics"` - - RecordInput *OperationalMetricsRecordInput `mandatory:"false" json:"recordInput"` } func (m OperationalMetricsSource) String() string { diff --git a/logging/record_transformer_pair.go b/logging/record_transformer_pair.go new file mode 100644 index 0000000000..f5867a49c1 --- /dev/null +++ b/logging/record_transformer_pair.go @@ -0,0 +1,44 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RecordTransformerPair A new Key-value pairs added in logs +type RecordTransformerPair struct { + + // A new key + Key *string `mandatory:"false" json:"key"` + + // A new value + Value *string `mandatory:"false" json:"value"` +} + +func (m RecordTransformerPair) 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 RecordTransformerPair) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/unified_agent_custom_filter.go b/logging/unified_agent_custom_filter.go new file mode 100644 index 0000000000..e7ae398927 --- /dev/null +++ b/logging/unified_agent_custom_filter.go @@ -0,0 +1,70 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentCustomFilter Logging custom filter plugin. +type UnifiedAgentCustomFilter struct { + + // Unique name for the filter. + Name *string `mandatory:"true" json:"name"` + + // Type of the custom filter + CustomFilterType *string `mandatory:"true" json:"customFilterType"` + + // Parameters of the custom filter + Params map[string]string `mandatory:"false" json:"params"` + + // List of custom sections in custom filter + CustomSections []UnifiedAgentCustomSection `mandatory:"false" json:"customSections"` +} + +// GetName returns Name +func (m UnifiedAgentCustomFilter) GetName() *string { + return m.Name +} + +func (m UnifiedAgentCustomFilter) 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 UnifiedAgentCustomFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentCustomFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentCustomFilter UnifiedAgentCustomFilter + s := struct { + DiscriminatorParam string `json:"filterType"` + MarshalTypeUnifiedAgentCustomFilter + }{ + "CUSTOM_FILTER", + (MarshalTypeUnifiedAgentCustomFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/logging/unified_agent_custom_plugin_log_source.go b/logging/unified_agent_custom_plugin_log_source.go new file mode 100644 index 0000000000..cc6c0277a9 --- /dev/null +++ b/logging/unified_agent_custom_plugin_log_source.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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentCustomPluginLogSource User-customized-source-plugin log source object. +type UnifiedAgentCustomPluginLogSource struct { + + // Unique name for the source. + Name *string `mandatory:"true" json:"name"` + + // User customized source plugin. + CustomPlugin *string `mandatory:"true" json:"customPlugin"` +} + +// GetName returns Name +func (m UnifiedAgentCustomPluginLogSource) GetName() *string { + return m.Name +} + +func (m UnifiedAgentCustomPluginLogSource) 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 UnifiedAgentCustomPluginLogSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentCustomPluginLogSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentCustomPluginLogSource UnifiedAgentCustomPluginLogSource + s := struct { + DiscriminatorParam string `json:"sourceType"` + MarshalTypeUnifiedAgentCustomPluginLogSource + }{ + "CUSTOM_PLUGIN", + (MarshalTypeUnifiedAgentCustomPluginLogSource)(m), + } + + return json.Marshal(&s) +} diff --git a/logging/unified_agent_custom_section.go b/logging/unified_agent_custom_section.go new file mode 100644 index 0000000000..2c7f8e6208 --- /dev/null +++ b/logging/unified_agent_custom_section.go @@ -0,0 +1,44 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentCustomSection Custom section in custom filter +type UnifiedAgentCustomSection struct { + + // The name of the custom section + Name *string `mandatory:"false" json:"name"` + + // Parameters in the custom section + Params map[string]string `mandatory:"false" json:"params"` +} + +func (m UnifiedAgentCustomSection) 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 UnifiedAgentCustomSection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/unified_agent_kubernetes_configuration_details.go b/logging/unified_agent_kubernetes_configuration_details.go new file mode 100644 index 0000000000..b121cbbf2d --- /dev/null +++ b/logging/unified_agent_kubernetes_configuration_details.go @@ -0,0 +1,58 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentKubernetesConfigurationDetails Unified Agent kubernetes service configuration object. +type UnifiedAgentKubernetesConfigurationDetails struct { + Source *UnifiedAgentKubernetesSource `mandatory:"true" json:"source"` + + Destination *UnifiedAgentMonitoringDestination `mandatory:"true" json:"destination"` + + Filter *UnifiedAgentKubernetesFilter `mandatory:"false" json:"filter"` +} + +func (m UnifiedAgentKubernetesConfigurationDetails) 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 UnifiedAgentKubernetesConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentKubernetesConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentKubernetesConfigurationDetails UnifiedAgentKubernetesConfigurationDetails + s := struct { + DiscriminatorParam string `json:"sourceType"` + MarshalTypeUnifiedAgentKubernetesConfigurationDetails + }{ + "KUBERNETES", + (MarshalTypeUnifiedAgentKubernetesConfigurationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/logging/unified_agent_kubernetes_filter.go b/logging/unified_agent_kubernetes_filter.go new file mode 100644 index 0000000000..e2a5ebfd46 --- /dev/null +++ b/logging/unified_agent_kubernetes_filter.go @@ -0,0 +1,67 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentKubernetesFilter Kubernetes filter object +type UnifiedAgentKubernetesFilter struct { + + // Unique name for the filter. + Name *string `mandatory:"true" json:"name"` + + // List of metrics regex to be allowed. + AllowList []string `mandatory:"false" json:"allowList"` + + // List of metrics regex to be denied. + DenyList []string `mandatory:"false" json:"denyList"` +} + +// GetName returns Name +func (m UnifiedAgentKubernetesFilter) GetName() *string { + return m.Name +} + +func (m UnifiedAgentKubernetesFilter) 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 UnifiedAgentKubernetesFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentKubernetesFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentKubernetesFilter UnifiedAgentKubernetesFilter + s := struct { + DiscriminatorParam string `json:"filterType"` + MarshalTypeUnifiedAgentKubernetesFilter + }{ + "KUBERNETES_FILTER", + (MarshalTypeUnifiedAgentKubernetesFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/logging/unified_agent_kubernetes_scrape_target.go b/logging/unified_agent_kubernetes_scrape_target.go new file mode 100644 index 0000000000..e44ab0e802 --- /dev/null +++ b/logging/unified_agent_kubernetes_scrape_target.go @@ -0,0 +1,103 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentKubernetesScrapeTarget Monitoring scrape object. +type UnifiedAgentKubernetesScrapeTarget struct { + + // Type of resource to scrape metrics. + ResourceType UnifiedAgentKubernetesScrapeTargetResourceTypeEnum `mandatory:"true" json:"resourceType"` + + // K8s namespace of the resource. + K8sNamespace *string `mandatory:"true" json:"k8sNamespace"` + + // Name of the service prepended to the endpoints. + ServiceName *string `mandatory:"false" json:"serviceName"` + + // Resource group in OCI monitoring. + ResourceGroup *string `mandatory:"false" json:"resourceGroup"` +} + +func (m UnifiedAgentKubernetesScrapeTarget) 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 UnifiedAgentKubernetesScrapeTarget) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingUnifiedAgentKubernetesScrapeTargetResourceTypeEnum(string(m.ResourceType)); !ok && m.ResourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceType: %s. Supported values are: %s.", m.ResourceType, strings.Join(GetUnifiedAgentKubernetesScrapeTargetResourceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnifiedAgentKubernetesScrapeTargetResourceTypeEnum Enum with underlying type: string +type UnifiedAgentKubernetesScrapeTargetResourceTypeEnum string + +// Set of constants representing the allowable values for UnifiedAgentKubernetesScrapeTargetResourceTypeEnum +const ( + UnifiedAgentKubernetesScrapeTargetResourceTypePods UnifiedAgentKubernetesScrapeTargetResourceTypeEnum = "PODS" + UnifiedAgentKubernetesScrapeTargetResourceTypeEndpoints UnifiedAgentKubernetesScrapeTargetResourceTypeEnum = "ENDPOINTS" + UnifiedAgentKubernetesScrapeTargetResourceTypeNodes UnifiedAgentKubernetesScrapeTargetResourceTypeEnum = "NODES" + UnifiedAgentKubernetesScrapeTargetResourceTypeServices UnifiedAgentKubernetesScrapeTargetResourceTypeEnum = "SERVICES" +) + +var mappingUnifiedAgentKubernetesScrapeTargetResourceTypeEnum = map[string]UnifiedAgentKubernetesScrapeTargetResourceTypeEnum{ + "PODS": UnifiedAgentKubernetesScrapeTargetResourceTypePods, + "ENDPOINTS": UnifiedAgentKubernetesScrapeTargetResourceTypeEndpoints, + "NODES": UnifiedAgentKubernetesScrapeTargetResourceTypeNodes, + "SERVICES": UnifiedAgentKubernetesScrapeTargetResourceTypeServices, +} + +var mappingUnifiedAgentKubernetesScrapeTargetResourceTypeEnumLowerCase = map[string]UnifiedAgentKubernetesScrapeTargetResourceTypeEnum{ + "pods": UnifiedAgentKubernetesScrapeTargetResourceTypePods, + "endpoints": UnifiedAgentKubernetesScrapeTargetResourceTypeEndpoints, + "nodes": UnifiedAgentKubernetesScrapeTargetResourceTypeNodes, + "services": UnifiedAgentKubernetesScrapeTargetResourceTypeServices, +} + +// GetUnifiedAgentKubernetesScrapeTargetResourceTypeEnumValues Enumerates the set of values for UnifiedAgentKubernetesScrapeTargetResourceTypeEnum +func GetUnifiedAgentKubernetesScrapeTargetResourceTypeEnumValues() []UnifiedAgentKubernetesScrapeTargetResourceTypeEnum { + values := make([]UnifiedAgentKubernetesScrapeTargetResourceTypeEnum, 0) + for _, v := range mappingUnifiedAgentKubernetesScrapeTargetResourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetUnifiedAgentKubernetesScrapeTargetResourceTypeEnumStringValues Enumerates the set of values in String for UnifiedAgentKubernetesScrapeTargetResourceTypeEnum +func GetUnifiedAgentKubernetesScrapeTargetResourceTypeEnumStringValues() []string { + return []string{ + "PODS", + "ENDPOINTS", + "NODES", + "SERVICES", + } +} + +// GetMappingUnifiedAgentKubernetesScrapeTargetResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUnifiedAgentKubernetesScrapeTargetResourceTypeEnum(val string) (UnifiedAgentKubernetesScrapeTargetResourceTypeEnum, bool) { + enum, ok := mappingUnifiedAgentKubernetesScrapeTargetResourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/logging/unified_agent_kubernetes_source.go b/logging/unified_agent_kubernetes_source.go new file mode 100644 index 0000000000..7f7a1b1d4c --- /dev/null +++ b/logging/unified_agent_kubernetes_source.go @@ -0,0 +1,44 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentKubernetesSource Kubernetes source object. +type UnifiedAgentKubernetesSource struct { + + // Unique name for the source. + Name *string `mandatory:"true" json:"name"` + + // List of UnifiedAgentKubernetesScrapeTarget. + ScrapeTargets []UnifiedAgentKubernetesScrapeTarget `mandatory:"true" json:"scrapeTargets"` +} + +func (m UnifiedAgentKubernetesSource) 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 UnifiedAgentKubernetesSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/unified_agent_logging_configuration.go b/logging/unified_agent_logging_configuration.go index 13bdcbaea6..b147a765fe 100644 --- a/logging/unified_agent_logging_configuration.go +++ b/logging/unified_agent_logging_configuration.go @@ -25,6 +25,9 @@ type UnifiedAgentLoggingConfiguration struct { Sources []UnifiedAgentLoggingSource `mandatory:"true" json:"sources"` Destination *UnifiedAgentLoggingDestination `mandatory:"true" json:"destination"` + + // Logging filter object. + Filter []UnifiedAgentLoggingFilter `mandatory:"false" json:"filter"` } func (m UnifiedAgentLoggingConfiguration) String() string { @@ -60,6 +63,7 @@ func (m UnifiedAgentLoggingConfiguration) MarshalJSON() (buff []byte, e error) { // UnmarshalJSON unmarshals from json func (m *UnifiedAgentLoggingConfiguration) UnmarshalJSON(data []byte) (e error) { model := struct { + Filter []unifiedagentloggingfilter `json:"filter"` Sources []unifiedagentloggingsource `json:"sources"` Destination *UnifiedAgentLoggingDestination `json:"destination"` }{} @@ -69,6 +73,18 @@ func (m *UnifiedAgentLoggingConfiguration) UnmarshalJSON(data []byte) (e error) return } var nn interface{} + m.Filter = make([]UnifiedAgentLoggingFilter, len(model.Filter)) + for i, n := range model.Filter { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Filter[i] = nn.(UnifiedAgentLoggingFilter) + } else { + m.Filter[i] = nil + } + } m.Sources = make([]UnifiedAgentLoggingSource, len(model.Sources)) for i, n := range model.Sources { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) diff --git a/logging/unified_agent_logging_filter.go b/logging/unified_agent_logging_filter.go new file mode 100644 index 0000000000..199bc4f429 --- /dev/null +++ b/logging/unified_agent_logging_filter.go @@ -0,0 +1,151 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentLoggingFilter Logging filter object. +type UnifiedAgentLoggingFilter interface { + + // Unique name for the filter. + GetName() *string +} + +type unifiedagentloggingfilter struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + FilterType string `json:"filterType"` +} + +// UnmarshalJSON unmarshals json +func (m *unifiedagentloggingfilter) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerunifiedagentloggingfilter unifiedagentloggingfilter + s := struct { + Model Unmarshalerunifiedagentloggingfilter + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.FilterType = s.Model.FilterType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *unifiedagentloggingfilter) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.FilterType { + case "CUSTOM_FILTER": + mm := UnifiedAgentCustomFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "PARSER_FILTER": + mm := UnifiedAgentParserFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "GREP_FILTER": + mm := UnifiedAgentLoggingGrepFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "RECORD_TRANSFORMER_FILTER": + mm := UnifiedAgentLoggingRecordTransformerFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UnifiedAgentLoggingFilter: %s.", m.FilterType) + return *m, nil + } +} + +// GetName returns Name +func (m unifiedagentloggingfilter) GetName() *string { + return m.Name +} + +func (m unifiedagentloggingfilter) 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 unifiedagentloggingfilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnifiedAgentLoggingFilterFilterTypeEnum Enum with underlying type: string +type UnifiedAgentLoggingFilterFilterTypeEnum string + +// Set of constants representing the allowable values for UnifiedAgentLoggingFilterFilterTypeEnum +const ( + UnifiedAgentLoggingFilterFilterTypeParserFilter UnifiedAgentLoggingFilterFilterTypeEnum = "PARSER_FILTER" + UnifiedAgentLoggingFilterFilterTypeGrepFilter UnifiedAgentLoggingFilterFilterTypeEnum = "GREP_FILTER" + UnifiedAgentLoggingFilterFilterTypeRecordTransformerFilter UnifiedAgentLoggingFilterFilterTypeEnum = "RECORD_TRANSFORMER_FILTER" + UnifiedAgentLoggingFilterFilterTypeCustomFilter UnifiedAgentLoggingFilterFilterTypeEnum = "CUSTOM_FILTER" +) + +var mappingUnifiedAgentLoggingFilterFilterTypeEnum = map[string]UnifiedAgentLoggingFilterFilterTypeEnum{ + "PARSER_FILTER": UnifiedAgentLoggingFilterFilterTypeParserFilter, + "GREP_FILTER": UnifiedAgentLoggingFilterFilterTypeGrepFilter, + "RECORD_TRANSFORMER_FILTER": UnifiedAgentLoggingFilterFilterTypeRecordTransformerFilter, + "CUSTOM_FILTER": UnifiedAgentLoggingFilterFilterTypeCustomFilter, +} + +var mappingUnifiedAgentLoggingFilterFilterTypeEnumLowerCase = map[string]UnifiedAgentLoggingFilterFilterTypeEnum{ + "parser_filter": UnifiedAgentLoggingFilterFilterTypeParserFilter, + "grep_filter": UnifiedAgentLoggingFilterFilterTypeGrepFilter, + "record_transformer_filter": UnifiedAgentLoggingFilterFilterTypeRecordTransformerFilter, + "custom_filter": UnifiedAgentLoggingFilterFilterTypeCustomFilter, +} + +// GetUnifiedAgentLoggingFilterFilterTypeEnumValues Enumerates the set of values for UnifiedAgentLoggingFilterFilterTypeEnum +func GetUnifiedAgentLoggingFilterFilterTypeEnumValues() []UnifiedAgentLoggingFilterFilterTypeEnum { + values := make([]UnifiedAgentLoggingFilterFilterTypeEnum, 0) + for _, v := range mappingUnifiedAgentLoggingFilterFilterTypeEnum { + values = append(values, v) + } + return values +} + +// GetUnifiedAgentLoggingFilterFilterTypeEnumStringValues Enumerates the set of values in String for UnifiedAgentLoggingFilterFilterTypeEnum +func GetUnifiedAgentLoggingFilterFilterTypeEnumStringValues() []string { + return []string{ + "PARSER_FILTER", + "GREP_FILTER", + "RECORD_TRANSFORMER_FILTER", + "CUSTOM_FILTER", + } +} + +// GetMappingUnifiedAgentLoggingFilterFilterTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUnifiedAgentLoggingFilterFilterTypeEnum(val string) (UnifiedAgentLoggingFilterFilterTypeEnum, bool) { + enum, ok := mappingUnifiedAgentLoggingFilterFilterTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/logging/unified_agent_logging_grep_filter.go b/logging/unified_agent_logging_grep_filter.go new file mode 100644 index 0000000000..7064640805 --- /dev/null +++ b/logging/unified_agent_logging_grep_filter.go @@ -0,0 +1,68 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentLoggingGrepFilter Logging grep filter object greps events by the values of specified fields. +// Ref: https://docs.fluentd.org/filter/grep +type UnifiedAgentLoggingGrepFilter struct { + + // Unique name for the filter. + Name *string `mandatory:"true" json:"name"` + + // A list of filtering rules to include logs + AllowList []GrepFilterAllowRule `mandatory:"false" json:"allowList"` + + // A list of filtering rules to reject logs + DenyList []GrepFilterDenyRule `mandatory:"false" json:"denyList"` +} + +// GetName returns Name +func (m UnifiedAgentLoggingGrepFilter) GetName() *string { + return m.Name +} + +func (m UnifiedAgentLoggingGrepFilter) 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 UnifiedAgentLoggingGrepFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentLoggingGrepFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentLoggingGrepFilter UnifiedAgentLoggingGrepFilter + s := struct { + DiscriminatorParam string `json:"filterType"` + MarshalTypeUnifiedAgentLoggingGrepFilter + }{ + "GREP_FILTER", + (MarshalTypeUnifiedAgentLoggingGrepFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/logging/unified_agent_logging_record_transformer_filter.go b/logging/unified_agent_logging_record_transformer_filter.go new file mode 100644 index 0000000000..36c6ce0fe1 --- /dev/null +++ b/logging/unified_agent_logging_record_transformer_filter.go @@ -0,0 +1,83 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentLoggingRecordTransformerFilter Logging record transformer filter object mutates/transforms logs. +// Ref: https://docs.fluentd.org/filter/record_transformer +type UnifiedAgentLoggingRecordTransformerFilter struct { + + // Unique name for the filter. + Name *string `mandatory:"true" json:"name"` + + // Add new key-value pairs in logs + RecordList []RecordTransformerPair `mandatory:"true" json:"recordList"` + + // When set to true, the full Ruby syntax is enabled in the ${} expression. + IsRubyEnabled *bool `mandatory:"false" json:"isRubyEnabled"` + + // If true, automatically casts the field types. + IsAutoTypecastEnabled *bool `mandatory:"false" json:"isAutoTypecastEnabled"` + + // If true, it modifies a new empty hash + IsRenewRecordEnabled *bool `mandatory:"false" json:"isRenewRecordEnabled"` + + // Overwrites the time of logs with this value, this value must be a Unix timestamp. + RenewTimeKey *string `mandatory:"false" json:"renewTimeKey"` + + // A list of keys to keep. Only relevant if isRenewRecordEnabled is set to true + KeepKeys []string `mandatory:"false" json:"keepKeys"` + + // A list of keys to delete + RemoveKeys []string `mandatory:"false" json:"removeKeys"` +} + +// GetName returns Name +func (m UnifiedAgentLoggingRecordTransformerFilter) GetName() *string { + return m.Name +} + +func (m UnifiedAgentLoggingRecordTransformerFilter) 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 UnifiedAgentLoggingRecordTransformerFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentLoggingRecordTransformerFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentLoggingRecordTransformerFilter UnifiedAgentLoggingRecordTransformerFilter + s := struct { + DiscriminatorParam string `json:"filterType"` + MarshalTypeUnifiedAgentLoggingRecordTransformerFilter + }{ + "RECORD_TRANSFORMER_FILTER", + (MarshalTypeUnifiedAgentLoggingRecordTransformerFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/logging/unified_agent_logging_source.go b/logging/unified_agent_logging_source.go index 3c878d4c61..0093856b91 100644 --- a/logging/unified_agent_logging_source.go +++ b/logging/unified_agent_logging_source.go @@ -57,6 +57,10 @@ func (m *unifiedagentloggingsource) UnmarshalPolymorphicJSON(data []byte) (inter var err error switch m.SourceType { + case "CUSTOM_PLUGIN": + mm := UnifiedAgentCustomPluginLogSource{} + err = json.Unmarshal(data, &mm) + return mm, err case "WINDOWS_EVENT_LOG": mm := UnifiedAgentWindowsEventSource{} err = json.Unmarshal(data, &mm) @@ -99,16 +103,19 @@ type UnifiedAgentLoggingSourceSourceTypeEnum string const ( UnifiedAgentLoggingSourceSourceTypeLogTail UnifiedAgentLoggingSourceSourceTypeEnum = "LOG_TAIL" UnifiedAgentLoggingSourceSourceTypeWindowsEventLog UnifiedAgentLoggingSourceSourceTypeEnum = "WINDOWS_EVENT_LOG" + UnifiedAgentLoggingSourceSourceTypeCustomPlugin UnifiedAgentLoggingSourceSourceTypeEnum = "CUSTOM_PLUGIN" ) var mappingUnifiedAgentLoggingSourceSourceTypeEnum = map[string]UnifiedAgentLoggingSourceSourceTypeEnum{ "LOG_TAIL": UnifiedAgentLoggingSourceSourceTypeLogTail, "WINDOWS_EVENT_LOG": UnifiedAgentLoggingSourceSourceTypeWindowsEventLog, + "CUSTOM_PLUGIN": UnifiedAgentLoggingSourceSourceTypeCustomPlugin, } var mappingUnifiedAgentLoggingSourceSourceTypeEnumLowerCase = map[string]UnifiedAgentLoggingSourceSourceTypeEnum{ "log_tail": UnifiedAgentLoggingSourceSourceTypeLogTail, "windows_event_log": UnifiedAgentLoggingSourceSourceTypeWindowsEventLog, + "custom_plugin": UnifiedAgentLoggingSourceSourceTypeCustomPlugin, } // GetUnifiedAgentLoggingSourceSourceTypeEnumValues Enumerates the set of values for UnifiedAgentLoggingSourceSourceTypeEnum @@ -125,6 +132,7 @@ func GetUnifiedAgentLoggingSourceSourceTypeEnumStringValues() []string { return []string{ "LOG_TAIL", "WINDOWS_EVENT_LOG", + "CUSTOM_PLUGIN", } } diff --git a/logging/unified_agent_monitoring_application_configuration_details.go b/logging/unified_agent_monitoring_application_configuration_details.go new file mode 100644 index 0000000000..93816a75e5 --- /dev/null +++ b/logging/unified_agent_monitoring_application_configuration_details.go @@ -0,0 +1,87 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentMonitoringApplicationConfigurationDetails Unified Agent monitoing application configuration details +type UnifiedAgentMonitoringApplicationConfigurationDetails interface { +} + +type unifiedagentmonitoringapplicationconfigurationdetails struct { + JsonData []byte + SourceType string `json:"sourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *unifiedagentmonitoringapplicationconfigurationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerunifiedagentmonitoringapplicationconfigurationdetails unifiedagentmonitoringapplicationconfigurationdetails + s := struct { + Model Unmarshalerunifiedagentmonitoringapplicationconfigurationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.SourceType = s.Model.SourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *unifiedagentmonitoringapplicationconfigurationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SourceType { + case "KUBERNETES": + mm := UnifiedAgentKubernetesConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "URL": + mm := UnifiedAgentUrlConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "TAIL": + mm := UnifiedAgentOpenmetricsTailConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UnifiedAgentMonitoringApplicationConfigurationDetails: %s.", m.SourceType) + return *m, nil + } +} + +func (m unifiedagentmonitoringapplicationconfigurationdetails) 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 unifiedagentmonitoringapplicationconfigurationdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/unified_agent_monitoring_configuration_details.go b/logging/unified_agent_monitoring_configuration_details.go new file mode 100644 index 0000000000..b9191e34a1 --- /dev/null +++ b/logging/unified_agent_monitoring_configuration_details.go @@ -0,0 +1,82 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentMonitoringConfigurationDetails Unified Agent monitoring service configuration object. +type UnifiedAgentMonitoringConfigurationDetails struct { + + // Unified Agent monitoring application configuration details. + ApplicationConfigurations []UnifiedAgentMonitoringApplicationConfigurationDetails `mandatory:"true" json:"applicationConfigurations"` +} + +func (m UnifiedAgentMonitoringConfigurationDetails) 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 UnifiedAgentMonitoringConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentMonitoringConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentMonitoringConfigurationDetails UnifiedAgentMonitoringConfigurationDetails + s := struct { + DiscriminatorParam string `json:"configurationType"` + MarshalTypeUnifiedAgentMonitoringConfigurationDetails + }{ + "MONITORING", + (MarshalTypeUnifiedAgentMonitoringConfigurationDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *UnifiedAgentMonitoringConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + ApplicationConfigurations []unifiedagentmonitoringapplicationconfigurationdetails `json:"applicationConfigurations"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.ApplicationConfigurations = make([]UnifiedAgentMonitoringApplicationConfigurationDetails, len(model.ApplicationConfigurations)) + for i, n := range model.ApplicationConfigurations { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.ApplicationConfigurations[i] = nn.(UnifiedAgentMonitoringApplicationConfigurationDetails) + } else { + m.ApplicationConfigurations[i] = nil + } + } + return +} diff --git a/logging/unified_agent_monitoring_destination.go b/logging/unified_agent_monitoring_destination.go new file mode 100644 index 0000000000..fdc6d2e1d0 --- /dev/null +++ b/logging/unified_agent_monitoring_destination.go @@ -0,0 +1,44 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentMonitoringDestination Kubernetes destination object. +type UnifiedAgentMonitoringDestination struct { + + // The OCID of the compartment that the resource belongs to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Namespace to which metrics will be emitted. + MetricsNamespace *string `mandatory:"true" json:"metricsNamespace"` +} + +func (m UnifiedAgentMonitoringDestination) 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 UnifiedAgentMonitoringDestination) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/unified_agent_monitoring_filter.go b/logging/unified_agent_monitoring_filter.go new file mode 100644 index 0000000000..fcd6f8a05e --- /dev/null +++ b/logging/unified_agent_monitoring_filter.go @@ -0,0 +1,135 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentMonitoringFilter Monitoring filter object. +type UnifiedAgentMonitoringFilter interface { + + // Unique name for the filter. + GetName() *string +} + +type unifiedagentmonitoringfilter struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + FilterType string `json:"filterType"` +} + +// UnmarshalJSON unmarshals json +func (m *unifiedagentmonitoringfilter) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerunifiedagentmonitoringfilter unifiedagentmonitoringfilter + s := struct { + Model Unmarshalerunifiedagentmonitoringfilter + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.FilterType = s.Model.FilterType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *unifiedagentmonitoringfilter) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.FilterType { + case "KUBERNETES_FILTER": + mm := UnifiedAgentKubernetesFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "URL_FILTER": + mm := UnifiedAgentUrlFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UnifiedAgentMonitoringFilter: %s.", m.FilterType) + return *m, nil + } +} + +// GetName returns Name +func (m unifiedagentmonitoringfilter) GetName() *string { + return m.Name +} + +func (m unifiedagentmonitoringfilter) 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 unifiedagentmonitoringfilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnifiedAgentMonitoringFilterFilterTypeEnum Enum with underlying type: string +type UnifiedAgentMonitoringFilterFilterTypeEnum string + +// Set of constants representing the allowable values for UnifiedAgentMonitoringFilterFilterTypeEnum +const ( + UnifiedAgentMonitoringFilterFilterTypeKubernetesFilter UnifiedAgentMonitoringFilterFilterTypeEnum = "KUBERNETES_FILTER" + UnifiedAgentMonitoringFilterFilterTypeUrlFilter UnifiedAgentMonitoringFilterFilterTypeEnum = "URL_FILTER" +) + +var mappingUnifiedAgentMonitoringFilterFilterTypeEnum = map[string]UnifiedAgentMonitoringFilterFilterTypeEnum{ + "KUBERNETES_FILTER": UnifiedAgentMonitoringFilterFilterTypeKubernetesFilter, + "URL_FILTER": UnifiedAgentMonitoringFilterFilterTypeUrlFilter, +} + +var mappingUnifiedAgentMonitoringFilterFilterTypeEnumLowerCase = map[string]UnifiedAgentMonitoringFilterFilterTypeEnum{ + "kubernetes_filter": UnifiedAgentMonitoringFilterFilterTypeKubernetesFilter, + "url_filter": UnifiedAgentMonitoringFilterFilterTypeUrlFilter, +} + +// GetUnifiedAgentMonitoringFilterFilterTypeEnumValues Enumerates the set of values for UnifiedAgentMonitoringFilterFilterTypeEnum +func GetUnifiedAgentMonitoringFilterFilterTypeEnumValues() []UnifiedAgentMonitoringFilterFilterTypeEnum { + values := make([]UnifiedAgentMonitoringFilterFilterTypeEnum, 0) + for _, v := range mappingUnifiedAgentMonitoringFilterFilterTypeEnum { + values = append(values, v) + } + return values +} + +// GetUnifiedAgentMonitoringFilterFilterTypeEnumStringValues Enumerates the set of values in String for UnifiedAgentMonitoringFilterFilterTypeEnum +func GetUnifiedAgentMonitoringFilterFilterTypeEnumStringValues() []string { + return []string{ + "KUBERNETES_FILTER", + "URL_FILTER", + } +} + +// GetMappingUnifiedAgentMonitoringFilterFilterTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUnifiedAgentMonitoringFilterFilterTypeEnum(val string) (UnifiedAgentMonitoringFilterFilterTypeEnum, bool) { + enum, ok := mappingUnifiedAgentMonitoringFilterFilterTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/logging/unified_agent_monitoring_source_types.go b/logging/unified_agent_monitoring_source_types.go new file mode 100644 index 0000000000..6618b1aa94 --- /dev/null +++ b/logging/unified_agent_monitoring_source_types.go @@ -0,0 +1,62 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "strings" +) + +// UnifiedAgentMonitoringSourceTypesEnum Enum with underlying type: string +type UnifiedAgentMonitoringSourceTypesEnum string + +// Set of constants representing the allowable values for UnifiedAgentMonitoringSourceTypesEnum +const ( + UnifiedAgentMonitoringSourceTypesKubernetes UnifiedAgentMonitoringSourceTypesEnum = "KUBERNETES" + UnifiedAgentMonitoringSourceTypesTail UnifiedAgentMonitoringSourceTypesEnum = "TAIL" + UnifiedAgentMonitoringSourceTypesUrl UnifiedAgentMonitoringSourceTypesEnum = "URL" +) + +var mappingUnifiedAgentMonitoringSourceTypesEnum = map[string]UnifiedAgentMonitoringSourceTypesEnum{ + "KUBERNETES": UnifiedAgentMonitoringSourceTypesKubernetes, + "TAIL": UnifiedAgentMonitoringSourceTypesTail, + "URL": UnifiedAgentMonitoringSourceTypesUrl, +} + +var mappingUnifiedAgentMonitoringSourceTypesEnumLowerCase = map[string]UnifiedAgentMonitoringSourceTypesEnum{ + "kubernetes": UnifiedAgentMonitoringSourceTypesKubernetes, + "tail": UnifiedAgentMonitoringSourceTypesTail, + "url": UnifiedAgentMonitoringSourceTypesUrl, +} + +// GetUnifiedAgentMonitoringSourceTypesEnumValues Enumerates the set of values for UnifiedAgentMonitoringSourceTypesEnum +func GetUnifiedAgentMonitoringSourceTypesEnumValues() []UnifiedAgentMonitoringSourceTypesEnum { + values := make([]UnifiedAgentMonitoringSourceTypesEnum, 0) + for _, v := range mappingUnifiedAgentMonitoringSourceTypesEnum { + values = append(values, v) + } + return values +} + +// GetUnifiedAgentMonitoringSourceTypesEnumStringValues Enumerates the set of values in String for UnifiedAgentMonitoringSourceTypesEnum +func GetUnifiedAgentMonitoringSourceTypesEnumStringValues() []string { + return []string{ + "KUBERNETES", + "TAIL", + "URL", + } +} + +// GetMappingUnifiedAgentMonitoringSourceTypesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUnifiedAgentMonitoringSourceTypesEnum(val string) (UnifiedAgentMonitoringSourceTypesEnum, bool) { + enum, ok := mappingUnifiedAgentMonitoringSourceTypesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/logging/unified_agent_monitoring_url_source.go b/logging/unified_agent_monitoring_url_source.go new file mode 100644 index 0000000000..f7b048b378 --- /dev/null +++ b/logging/unified_agent_monitoring_url_source.go @@ -0,0 +1,44 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentMonitoringUrlSource Kubernetes source object. +type UnifiedAgentMonitoringUrlSource struct { + + // Unique name for the source. + Name *string `mandatory:"true" json:"name"` + + // List of UnifiedAgentKubernetesScrapeTarget. + ScrapeTargets []UnifiedAgentUrlScrapeTarget `mandatory:"true" json:"scrapeTargets"` +} + +func (m UnifiedAgentMonitoringUrlSource) 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 UnifiedAgentMonitoringUrlSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/unified_agent_openmetrics_parser.go b/logging/unified_agent_openmetrics_parser.go new file mode 100644 index 0000000000..65634ed29c --- /dev/null +++ b/logging/unified_agent_openmetrics_parser.go @@ -0,0 +1,128 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentOpenmetricsParser Openmetrics parser. +type UnifiedAgentOpenmetricsParser struct { + + // Specifies the time field for the event time. If the event doesn't have this field, the current time is used. + FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` + + // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } + Types map[string]string `mandatory:"false" json:"types"` + + // Specify the null value pattern. + NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` + + // If true, an empty string field is replaced with a null value. + IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` + + // If true, use Fluent::EventTime.now(current time) as a timestamp when the time_key is specified. + IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` + + // If true, keep the time field in the record. + IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` + + // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. + TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` + + RecordInput *UnifiedAgentOpenmetricsParserRecord `mandatory:"false" json:"recordInput"` +} + +// GetFieldTimeKey returns FieldTimeKey +func (m UnifiedAgentOpenmetricsParser) GetFieldTimeKey() *string { + return m.FieldTimeKey +} + +// GetTypes returns Types +func (m UnifiedAgentOpenmetricsParser) GetTypes() map[string]string { + return m.Types +} + +// GetNullValuePattern returns NullValuePattern +func (m UnifiedAgentOpenmetricsParser) GetNullValuePattern() *string { + return m.NullValuePattern +} + +// GetIsNullEmptyString returns IsNullEmptyString +func (m UnifiedAgentOpenmetricsParser) GetIsNullEmptyString() *bool { + return m.IsNullEmptyString +} + +// GetIsEstimateCurrentEvent returns IsEstimateCurrentEvent +func (m UnifiedAgentOpenmetricsParser) GetIsEstimateCurrentEvent() *bool { + return m.IsEstimateCurrentEvent +} + +// GetIsKeepTimeKey returns IsKeepTimeKey +func (m UnifiedAgentOpenmetricsParser) GetIsKeepTimeKey() *bool { + return m.IsKeepTimeKey +} + +// GetTimeoutInMilliseconds returns TimeoutInMilliseconds +func (m UnifiedAgentOpenmetricsParser) GetTimeoutInMilliseconds() *int { + return m.TimeoutInMilliseconds +} + +func (m UnifiedAgentOpenmetricsParser) 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 UnifiedAgentOpenmetricsParser) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentOpenmetricsParser) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentOpenmetricsParser UnifiedAgentOpenmetricsParser + s := struct { + DiscriminatorParam string `json:"parserType"` + MarshalTypeUnifiedAgentOpenmetricsParser + }{ + "OPENMETRICS", + (MarshalTypeUnifiedAgentOpenmetricsParser)(m), + } + + return json.Marshal(&s) +} diff --git a/logging/unified_agent_openmetrics_parser_record.go b/logging/unified_agent_openmetrics_parser_record.go new file mode 100644 index 0000000000..abf3e7974d --- /dev/null +++ b/logging/unified_agent_openmetrics_parser_record.go @@ -0,0 +1,47 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentOpenmetricsParserRecord record section of openmetrics parser. +type UnifiedAgentOpenmetricsParserRecord struct { + + // Namespace to emit metrics. + Namespace *string `mandatory:"false" json:"namespace"` + + // Resource group to emit metrics. + ResourceGroup *string `mandatory:"false" json:"resourceGroup"` + + // Dimensions to be added for metrics. + Dimensions map[string]string `mandatory:"false" json:"dimensions"` +} + +func (m UnifiedAgentOpenmetricsParserRecord) 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 UnifiedAgentOpenmetricsParserRecord) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/unified_agent_openmetrics_tail_configuration_details.go b/logging/unified_agent_openmetrics_tail_configuration_details.go new file mode 100644 index 0000000000..8ae0a51d2a --- /dev/null +++ b/logging/unified_agent_openmetrics_tail_configuration_details.go @@ -0,0 +1,58 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentOpenmetricsTailConfigurationDetails Unified Agent Openmetrics tail configuration object. +type UnifiedAgentOpenmetricsTailConfigurationDetails struct { + + // Tail log source objects. + Sources []UnifiedAgentTailLogSource `mandatory:"true" json:"sources"` + + Destination *UnifiedAgentMonitoringDestination `mandatory:"true" json:"destination"` +} + +func (m UnifiedAgentOpenmetricsTailConfigurationDetails) 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 UnifiedAgentOpenmetricsTailConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentOpenmetricsTailConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentOpenmetricsTailConfigurationDetails UnifiedAgentOpenmetricsTailConfigurationDetails + s := struct { + DiscriminatorParam string `json:"sourceType"` + MarshalTypeUnifiedAgentOpenmetricsTailConfigurationDetails + }{ + "TAIL", + (MarshalTypeUnifiedAgentOpenmetricsTailConfigurationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/logging/unified_agent_parser.go b/logging/unified_agent_parser.go index 69f5954be4..e3694baa16 100644 --- a/logging/unified_agent_parser.go +++ b/logging/unified_agent_parser.go @@ -124,6 +124,10 @@ func (m *unifiedagentparser) UnmarshalPolymorphicJSON(data []byte) (interface{}, mm := UnifiedAgentSyslogParser{} err = json.Unmarshal(data, &mm) return mm, err + case "OPENMETRICS": + mm := UnifiedAgentOpenmetricsParser{} + err = json.Unmarshal(data, &mm) + return mm, err case "AUDITD": mm := UnifiedAgentAuditdParser{} err = json.Unmarshal(data, &mm) @@ -236,6 +240,7 @@ const ( UnifiedAgentParserParserTypeMultiline UnifiedAgentParserParserTypeEnum = "MULTILINE" UnifiedAgentParserParserTypeGrok UnifiedAgentParserParserTypeEnum = "GROK" UnifiedAgentParserParserTypeMultilineGrok UnifiedAgentParserParserTypeEnum = "MULTILINE_GROK" + UnifiedAgentParserParserTypeOpenmetrics UnifiedAgentParserParserTypeEnum = "OPENMETRICS" ) var mappingUnifiedAgentParserParserTypeEnum = map[string]UnifiedAgentParserParserTypeEnum{ @@ -253,6 +258,7 @@ var mappingUnifiedAgentParserParserTypeEnum = map[string]UnifiedAgentParserParse "MULTILINE": UnifiedAgentParserParserTypeMultiline, "GROK": UnifiedAgentParserParserTypeGrok, "MULTILINE_GROK": UnifiedAgentParserParserTypeMultilineGrok, + "OPENMETRICS": UnifiedAgentParserParserTypeOpenmetrics, } var mappingUnifiedAgentParserParserTypeEnumLowerCase = map[string]UnifiedAgentParserParserTypeEnum{ @@ -270,6 +276,7 @@ var mappingUnifiedAgentParserParserTypeEnumLowerCase = map[string]UnifiedAgentPa "multiline": UnifiedAgentParserParserTypeMultiline, "grok": UnifiedAgentParserParserTypeGrok, "multiline_grok": UnifiedAgentParserParserTypeMultilineGrok, + "openmetrics": UnifiedAgentParserParserTypeOpenmetrics, } // GetUnifiedAgentParserParserTypeEnumValues Enumerates the set of values for UnifiedAgentParserParserTypeEnum @@ -298,6 +305,7 @@ func GetUnifiedAgentParserParserTypeEnumStringValues() []string { "MULTILINE", "GROK", "MULTILINE_GROK", + "OPENMETRICS", } } diff --git a/logging/unified_agent_parser_filter.go b/logging/unified_agent_parser_filter.go new file mode 100644 index 0000000000..2532b150df --- /dev/null +++ b/logging/unified_agent_parser_filter.go @@ -0,0 +1,141 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentParserFilter Logging parser filter object. +// Ref: https://docs.fluentd.org/filter/parser +type UnifiedAgentParserFilter struct { + + // Unique name for the filter. + Name *string `mandatory:"true" json:"name"` + + Parser UnifiedAgentParser `mandatory:"true" json:"parser"` + + // The field name in the record to parse. + KeyName *string `mandatory:"true" json:"keyName"` + + // If true, keep the original event time in the parsed result. + ReserveTime *bool `mandatory:"false" json:"reserveTime"` + + // If true, keep the original key-value pair in the parsed result. + ReserveData *bool `mandatory:"false" json:"reserveData"` + + // If true, remove the keyName field when parsing is succeeded. + RemoveKeyNameField *bool `mandatory:"false" json:"removeKeyNameField"` + + // If true, the invalid string is replaced with safe characters and is re-parsed. + ReplaceInvalidSequence *bool `mandatory:"false" json:"replaceInvalidSequence"` + + // Store the parsed values with the specified key name prefix. + InjectKeyPrefix *string `mandatory:"false" json:"injectKeyPrefix"` + + // Store the parsed values as a hash value in a field. + HashValueField *string `mandatory:"false" json:"hashValueField"` + + // If true, emit invalid record to @ERROR label. Invalid cases are: 1) key does not exist; 2) the format + // does not match; or 3) an unexpected error. You can rescue unexpected format logs in the @ERROR lable. + // If you want to ignore these errors, set this to false. + EmitInvalidRecordToError *bool `mandatory:"false" json:"emitInvalidRecordToError"` +} + +// GetName returns Name +func (m UnifiedAgentParserFilter) GetName() *string { + return m.Name +} + +func (m UnifiedAgentParserFilter) 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 UnifiedAgentParserFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentParserFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentParserFilter UnifiedAgentParserFilter + s := struct { + DiscriminatorParam string `json:"filterType"` + MarshalTypeUnifiedAgentParserFilter + }{ + "PARSER_FILTER", + (MarshalTypeUnifiedAgentParserFilter)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *UnifiedAgentParserFilter) UnmarshalJSON(data []byte) (e error) { + model := struct { + ReserveTime *bool `json:"reserveTime"` + ReserveData *bool `json:"reserveData"` + RemoveKeyNameField *bool `json:"removeKeyNameField"` + ReplaceInvalidSequence *bool `json:"replaceInvalidSequence"` + InjectKeyPrefix *string `json:"injectKeyPrefix"` + HashValueField *string `json:"hashValueField"` + EmitInvalidRecordToError *bool `json:"emitInvalidRecordToError"` + Name *string `json:"name"` + Parser unifiedagentparser `json:"parser"` + KeyName *string `json:"keyName"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.ReserveTime = model.ReserveTime + + m.ReserveData = model.ReserveData + + m.RemoveKeyNameField = model.RemoveKeyNameField + + m.ReplaceInvalidSequence = model.ReplaceInvalidSequence + + m.InjectKeyPrefix = model.InjectKeyPrefix + + m.HashValueField = model.HashValueField + + m.EmitInvalidRecordToError = model.EmitInvalidRecordToError + + m.Name = model.Name + + nn, e = model.Parser.UnmarshalPolymorphicJSON(model.Parser.JsonData) + if e != nil { + return + } + if nn != nil { + m.Parser = nn.(UnifiedAgentParser) + } else { + m.Parser = nil + } + + m.KeyName = model.KeyName + + return +} diff --git a/logging/unified_agent_service_configuration_details.go b/logging/unified_agent_service_configuration_details.go index 1e277b1529..aed2f5ec39 100644 --- a/logging/unified_agent_service_configuration_details.go +++ b/logging/unified_agent_service_configuration_details.go @@ -56,6 +56,10 @@ func (m *unifiedagentserviceconfigurationdetails) UnmarshalPolymorphicJSON(data mm := UnifiedAgentLoggingConfiguration{} err = json.Unmarshal(data, &mm) return mm, err + case "MONITORING": + mm := UnifiedAgentMonitoringConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err default: common.Logf("Recieved unsupported enum value for UnifiedAgentServiceConfigurationDetails: %s.", m.ConfigurationType) return *m, nil diff --git a/logging/unified_agent_service_configuration_types.go b/logging/unified_agent_service_configuration_types.go index faa07f5359..5da634fc74 100644 --- a/logging/unified_agent_service_configuration_types.go +++ b/logging/unified_agent_service_configuration_types.go @@ -20,15 +20,18 @@ type UnifiedAgentServiceConfigurationTypesEnum string // Set of constants representing the allowable values for UnifiedAgentServiceConfigurationTypesEnum const ( - UnifiedAgentServiceConfigurationTypesLogging UnifiedAgentServiceConfigurationTypesEnum = "LOGGING" + UnifiedAgentServiceConfigurationTypesLogging UnifiedAgentServiceConfigurationTypesEnum = "LOGGING" + UnifiedAgentServiceConfigurationTypesMonitoring UnifiedAgentServiceConfigurationTypesEnum = "MONITORING" ) var mappingUnifiedAgentServiceConfigurationTypesEnum = map[string]UnifiedAgentServiceConfigurationTypesEnum{ - "LOGGING": UnifiedAgentServiceConfigurationTypesLogging, + "LOGGING": UnifiedAgentServiceConfigurationTypesLogging, + "MONITORING": UnifiedAgentServiceConfigurationTypesMonitoring, } var mappingUnifiedAgentServiceConfigurationTypesEnumLowerCase = map[string]UnifiedAgentServiceConfigurationTypesEnum{ - "logging": UnifiedAgentServiceConfigurationTypesLogging, + "logging": UnifiedAgentServiceConfigurationTypesLogging, + "monitoring": UnifiedAgentServiceConfigurationTypesMonitoring, } // GetUnifiedAgentServiceConfigurationTypesEnumValues Enumerates the set of values for UnifiedAgentServiceConfigurationTypesEnum @@ -44,6 +47,7 @@ func GetUnifiedAgentServiceConfigurationTypesEnumValues() []UnifiedAgentServiceC func GetUnifiedAgentServiceConfigurationTypesEnumStringValues() []string { return []string{ "LOGGING", + "MONITORING", } } diff --git a/logging/unified_agent_tail_log_source.go b/logging/unified_agent_tail_log_source.go index daef729f42..68049c0d6f 100644 --- a/logging/unified_agent_tail_log_source.go +++ b/logging/unified_agent_tail_log_source.go @@ -28,6 +28,8 @@ type UnifiedAgentTailLogSource struct { Paths []string `mandatory:"true" json:"paths"` Parser UnifiedAgentParser `mandatory:"false" json:"parser"` + + AdvancedOptions *UnifiedAgentTailSourceAdvancedOptions `mandatory:"false" json:"advancedOptions"` } // GetName returns Name @@ -68,9 +70,10 @@ func (m UnifiedAgentTailLogSource) MarshalJSON() (buff []byte, e error) { // UnmarshalJSON unmarshals from json func (m *UnifiedAgentTailLogSource) UnmarshalJSON(data []byte) (e error) { model := struct { - Parser unifiedagentparser `json:"parser"` - Name *string `json:"name"` - Paths []string `json:"paths"` + Parser unifiedagentparser `json:"parser"` + AdvancedOptions *UnifiedAgentTailSourceAdvancedOptions `json:"advancedOptions"` + Name *string `json:"name"` + Paths []string `json:"paths"` }{} e = json.Unmarshal(data, &model) @@ -88,6 +91,8 @@ func (m *UnifiedAgentTailLogSource) UnmarshalJSON(data []byte) (e error) { m.Parser = nil } + m.AdvancedOptions = model.AdvancedOptions + m.Name = model.Name m.Paths = make([]string, len(model.Paths)) diff --git a/logging/unified_agent_tail_source_advanced_options.go b/logging/unified_agent_tail_source_advanced_options.go new file mode 100644 index 0000000000..5b4a2bad78 --- /dev/null +++ b/logging/unified_agent_tail_source_advanced_options.go @@ -0,0 +1,41 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentTailSourceAdvancedOptions Advanced options for logging configuration +type UnifiedAgentTailSourceAdvancedOptions struct { + + // Starts to read the logs from the head of the file or the last read position recorded in pos_file, not tail. + IsReadFromHead *bool `mandatory:"false" json:"isReadFromHead"` +} + +func (m UnifiedAgentTailSourceAdvancedOptions) 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 UnifiedAgentTailSourceAdvancedOptions) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/unified_agent_url_configuration_details.go b/logging/unified_agent_url_configuration_details.go new file mode 100644 index 0000000000..c9b55e3060 --- /dev/null +++ b/logging/unified_agent_url_configuration_details.go @@ -0,0 +1,58 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentUrlConfigurationDetails Unified Agent scrape URL configuration object. +type UnifiedAgentUrlConfigurationDetails struct { + Source *UnifiedAgentMonitoringUrlSource `mandatory:"true" json:"source"` + + Destination *UnifiedAgentMonitoringDestination `mandatory:"true" json:"destination"` + + Filter *UnifiedAgentUrlFilter `mandatory:"false" json:"filter"` +} + +func (m UnifiedAgentUrlConfigurationDetails) 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 UnifiedAgentUrlConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentUrlConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentUrlConfigurationDetails UnifiedAgentUrlConfigurationDetails + s := struct { + DiscriminatorParam string `json:"sourceType"` + MarshalTypeUnifiedAgentUrlConfigurationDetails + }{ + "URL", + (MarshalTypeUnifiedAgentUrlConfigurationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/logging/unified_agent_url_filter.go b/logging/unified_agent_url_filter.go new file mode 100644 index 0000000000..42374bfaf3 --- /dev/null +++ b/logging/unified_agent_url_filter.go @@ -0,0 +1,67 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentUrlFilter Kubernetes filter object +type UnifiedAgentUrlFilter struct { + + // Unique name for the filter. + Name *string `mandatory:"true" json:"name"` + + // List of metrics regex to be allowed. + AllowList []string `mandatory:"false" json:"allowList"` + + // List of metrics regex to be denied. + DenyList []string `mandatory:"false" json:"denyList"` +} + +// GetName returns Name +func (m UnifiedAgentUrlFilter) GetName() *string { + return m.Name +} + +func (m UnifiedAgentUrlFilter) 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 UnifiedAgentUrlFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UnifiedAgentUrlFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentUrlFilter UnifiedAgentUrlFilter + s := struct { + DiscriminatorParam string `json:"filterType"` + MarshalTypeUnifiedAgentUrlFilter + }{ + "URL_FILTER", + (MarshalTypeUnifiedAgentUrlFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/logging/unified_agent_url_scrape_target.go b/logging/unified_agent_url_scrape_target.go new file mode 100644 index 0000000000..e668c0b332 --- /dev/null +++ b/logging/unified_agent_url_scrape_target.go @@ -0,0 +1,44 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, and agent configurations. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentUrlScrapeTarget Monitoring scrape object. +type UnifiedAgentUrlScrapeTarget struct { + + // URL from which the metrics are fetched. + Url *string `mandatory:"true" json:"url"` + + // Custom name. + Name *string `mandatory:"false" json:"name"` +} + +func (m UnifiedAgentUrlScrapeTarget) 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 UnifiedAgentUrlScrapeTarget) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/logging/unified_json_parser.go b/logging/unified_json_parser.go index 7a7ddf0cc8..c9be7e7c40 100644 --- a/logging/unified_json_parser.go +++ b/logging/unified_json_parser.go @@ -62,6 +62,12 @@ type UnifiedJsonParser struct { // Process time value using the specified format. TimeFormat *string `mandatory:"false" json:"timeFormat"` + // If true, a separator parameter can be further defined. + ParseNested *bool `mandatory:"false" json:"parseNested"` + + // Keys of adjacent levels are joined by the separator. + Separator *string `mandatory:"false" json:"separator"` + // JSON parser time type. TimeType UnifiedJsonParserTimeTypeEnum `mandatory:"false" json:"timeType,omitempty"` } diff --git a/monitoring/alarm.go b/monitoring/alarm.go index bbeab7080f..7a0981b7d4 100644 --- a/monitoring/alarm.go +++ b/monitoring/alarm.go @@ -161,6 +161,21 @@ type Alarm struct { // Usage of predefined tag keys. These predefined keys are scoped to namespaces. // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A set of overrides that control evaluations of the alarm. + // Each override can specify values for query, severity, body, and pending duration. + // When an alarm contains overrides, the Monitoring service evaluates each override in order, beginning with the first override in the array (index position `0`), + // and then evaluates the alarm's base values (`ruleName` value of `BASE`). + Overrides []AlarmOverride `mandatory:"false" json:"overrides"` + + // Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. + // A valid ruleName value starts with an alphabetic character and includes only alphanumeric characters, underscores and square brackets. + // Minimum number of characters: 3. Default value is `BASE`. For information about alarm overrides, see AlarmOverride. + RuleName *string `mandatory:"false" json:"ruleName"` + + // The version of the alarm notification to be delivered. Allowed value: `1.X` + // The value must start with a number (up to four digits), followed by a period and an uppercase X. + NotificationVersion *string `mandatory:"false" json:"notificationVersion"` } func (m Alarm) String() string { diff --git a/monitoring/alarm_dimension_states_entry.go b/monitoring/alarm_dimension_states_entry.go index da29e8bf19..47bb628d67 100644 --- a/monitoring/alarm_dimension_states_entry.go +++ b/monitoring/alarm_dimension_states_entry.go @@ -28,6 +28,11 @@ type AlarmDimensionStatesEntry struct { // Example: `FIRING` Status AlarmDimensionStatesEntryStatusEnum `mandatory:"true" json:"status"` + // Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. + // A valid ruleName value starts with an alphabetic character and includes only alphanumeric characters, underscores and square brackets. + // Minimum number of characters: 3. Default value is `BASE`. For information about alarm overrides, see AlarmOverride. + RuleName *string `mandatory:"true" json:"ruleName"` + // Transition time associated with the alarm state entry. Format defined by RFC3339. // Example: `2022-02-01T01:02:29.600Z` Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` diff --git a/monitoring/alarm_override.go b/monitoring/alarm_override.go new file mode 100644 index 0000000000..7763681a0f --- /dev/null +++ b/monitoring/alarm_override.go @@ -0,0 +1,95 @@ +// 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. + +// Monitoring API +// +// Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. +// Endpoints vary by operation. For PostMetricData, use the `telemetry-ingestion` endpoints; for all other operations, use the `telemetry` endpoints. +// For more information, see +// the Monitoring documentation (https://docs.cloud.oracle.com/iaas/Content/Monitoring/home.htm). +// + +package monitoring + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AlarmOverride Values to use for an independent evaluation of the alarm. +// You can specify values for query, severity, body, and pending duration. +// When an alarm contains overrides, the Monitoring service evaluates each override in order, +// beginning with the first override in the array (index position `0`), +// and then evaluates the alarm's base values (`ruleName` value of `BASE`) +type AlarmOverride struct { + + // The period of time that the condition defined in the alarm must persist before the alarm state + // changes from "OK" to "FIRING". For example, a value of 5 minutes means that the + // alarm must persist in breaching the condition for five minutes before the alarm updates its + // state to "FIRING". + // The duration is specified as a string in ISO 8601 format (`PT10M` for ten minutes or `PT1H` + // for one hour). Minimum: PT1M. Maximum: PT1H. Default: PT1M. + // Under the default value of PT1M, the first evaluation that breaches the alarm updates the + // state to "FIRING". + // The alarm updates its status to "OK" when the breaching condition has been clear for + // the most recent minute. + // Example: `PT5M` + PendingDuration *string `mandatory:"false" json:"pendingDuration"` + + // The perceived severity of the alarm with regard to the affected system. + // Example: `CRITICAL` + Severity AlarmSeverityEnum `mandatory:"false" json:"severity,omitempty"` + + // The human-readable content of the delivered alarm notification. Oracle recommends providing guidance + // to operators for resolving the alarm condition. Consider adding links to standard runbook + // practices. Avoid entering confidential information. + // Example: `High CPU usage alert. Follow runbook instructions for resolution.` + Body *string `mandatory:"false" json:"body"` + + // A user-friendly description for this alarm override. Must be unique across all `ruleName` values for the alarm. + RuleName *string `mandatory:"false" json:"ruleName"` + + // The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of + // the Monitoring service interprets results for each returned time series as Boolean values, + // where zero represents false and a non-zero value represents true. A true value means that the trigger + // rule condition has been met. The query must specify a metric, statistic, interval, and trigger + // rule (threshold or absence). Supported values for interval depend on the specified time range. More + // interval values are supported for smaller time ranges. You can optionally + // specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`. + // For information about writing MQL expressions, see + // Editing the MQL Expression for a Query (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Tasks/query-metric-mql.htm). + // For details about MQL, see + // Monitoring Query Language (MQL) Reference (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). + // For available dimensions, review the metric definition for the supported service. See + // Supported Services (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). + // Example of threshold alarm: + // ----- + // CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.groupBy(availabilityDomain).percentile(0.9) > 85 + // ----- + // Example of absence alarm: + // ----- + // CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.absent() + // ----- + Query *string `mandatory:"false" json:"query"` +} + +func (m AlarmOverride) 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 AlarmOverride) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingAlarmSeverityEnum(string(m.Severity)); !ok && m.Severity != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Severity: %s. Supported values are: %s.", m.Severity, strings.Join(GetAlarmSeverityEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/monitoring/alarm_status_summary.go b/monitoring/alarm_status_summary.go index abe970ceb7..c102765b15 100644 --- a/monitoring/alarm_status_summary.go +++ b/monitoring/alarm_status_summary.go @@ -41,6 +41,11 @@ type AlarmStatusSummary struct { // Example: `CRITICAL` Severity AlarmStatusSummarySeverityEnum `mandatory:"true" json:"severity"` + // Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. + // A valid ruleName value starts with an alphabetic character and includes only alphanumeric characters, underscores and square brackets. + // Minimum number of characters: 3. Default value is `BASE`. For information about alarm overrides, see AlarmOverride. + RuleName *string `mandatory:"true" json:"ruleName"` + // Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing. // Note: A three-minute lag for this value accounts for any late-arriving metrics. // Example: `2023-02-01T01:02:29.600Z` diff --git a/monitoring/alarm_summary.go b/monitoring/alarm_summary.go index 58bf247178..95c3e69ae7 100644 --- a/monitoring/alarm_summary.go +++ b/monitoring/alarm_summary.go @@ -105,6 +105,21 @@ type AlarmSummary struct { // Usage of predefined tag keys. These predefined keys are scoped to namespaces. // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A set of overrides that control evaluations of the alarm. + // Each override can specify values for query, severity, body, and pending duration. + // When an alarm contains overrides, the Monitoring service evaluates each override in order, beginning with the first override in the array (index position `0`), + // and then evaluates the alarm's base values (`ruleName` value of `BASE`). + Overrides []AlarmOverride `mandatory:"false" json:"overrides"` + + // Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. + // A valid ruleName value starts with an alphabetic character and includes only alphanumeric characters, underscores and square brackets. + // Minimum number of characters: 3. Default value is `BASE`. For information about alarm overrides, see AlarmOverride. + RuleName *string `mandatory:"false" json:"ruleName"` + + // The version of the alarm notification to be delivered. Allowed value: `1.X` + // The value must start with a number (up to four digits), followed by a period and an uppercase X. + NotificationVersion *string `mandatory:"false" json:"notificationVersion"` } func (m AlarmSummary) String() string { diff --git a/monitoring/create_alarm_details.go b/monitoring/create_alarm_details.go index 18b17d22c2..546b47b7a5 100644 --- a/monitoring/create_alarm_details.go +++ b/monitoring/create_alarm_details.go @@ -140,6 +140,21 @@ type CreateAlarmDetails struct { // Usage of predefined tag keys. These predefined keys are scoped to namespaces. // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A set of overrides that control evaluations of the alarm. + // Each override can specify values for query, severity, body, and pending duration. + // When an alarm contains overrides, the Monitoring service evaluates each override in order, beginning with the first override in the array (index position `0`), + // and then evaluates the alarm's base values (`ruleName` value of `BASE`). + Overrides []AlarmOverride `mandatory:"false" json:"overrides"` + + // Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. + // A valid ruleName value starts with an alphabetic character and includes only alphanumeric characters, underscores and square brackets. + // Minimum number of characters: 3. Default value is `BASE`. For information about alarm overrides, see AlarmOverride. + RuleName *string `mandatory:"false" json:"ruleName"` + + // The version of the alarm notification to be delivered. Allowed value: `1.X` + // The value must start with a number (up to four digits), followed by a period and an uppercase X. + NotificationVersion *string `mandatory:"false" json:"notificationVersion"` } func (m CreateAlarmDetails) String() string { diff --git a/monitoring/get_alarm_history_request_response.go b/monitoring/get_alarm_history_request_response.go index 881da2f43f..1386d75a8f 100644 --- a/monitoring/get_alarm_history_request_response.go +++ b/monitoring/get_alarm_history_request_response.go @@ -25,8 +25,9 @@ type GetAlarmHistoryRequest struct { // request, please provide the complete request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` - // The type of history entries to retrieve. State history (STATE_HISTORY) or state transition history (STATE_TRANSITION_HISTORY). - // If not specified, entries of both types are retrieved. + // The type of history entries to retrieve. + // State history (STATE_HISTORY), state transition history (STATE_TRANSITION_HISTORY), rule history (RULE_HISTORY) or rule transition history (RULE_TRANSITION_HISTORY). + // If not specified, entries of all types are retrieved. // Example: `STATE_HISTORY` AlarmHistorytype GetAlarmHistoryAlarmHistorytypeEnum `mandatory:"false" contributesTo:"query" name:"alarmHistorytype" omitEmpty:"true"` @@ -128,18 +129,24 @@ type GetAlarmHistoryAlarmHistorytypeEnum string // Set of constants representing the allowable values for GetAlarmHistoryAlarmHistorytypeEnum const ( - GetAlarmHistoryAlarmHistorytypeHistory GetAlarmHistoryAlarmHistorytypeEnum = "STATE_HISTORY" - GetAlarmHistoryAlarmHistorytypeTransitionHistory GetAlarmHistoryAlarmHistorytypeEnum = "STATE_TRANSITION_HISTORY" + GetAlarmHistoryAlarmHistorytypeStateHistory GetAlarmHistoryAlarmHistorytypeEnum = "STATE_HISTORY" + GetAlarmHistoryAlarmHistorytypeStateTransitionHistory GetAlarmHistoryAlarmHistorytypeEnum = "STATE_TRANSITION_HISTORY" + GetAlarmHistoryAlarmHistorytypeRuleHistory GetAlarmHistoryAlarmHistorytypeEnum = "RULE_HISTORY" + GetAlarmHistoryAlarmHistorytypeRuleTransitionHistory GetAlarmHistoryAlarmHistorytypeEnum = "RULE_TRANSITION_HISTORY" ) var mappingGetAlarmHistoryAlarmHistorytypeEnum = map[string]GetAlarmHistoryAlarmHistorytypeEnum{ - "STATE_HISTORY": GetAlarmHistoryAlarmHistorytypeHistory, - "STATE_TRANSITION_HISTORY": GetAlarmHistoryAlarmHistorytypeTransitionHistory, + "STATE_HISTORY": GetAlarmHistoryAlarmHistorytypeStateHistory, + "STATE_TRANSITION_HISTORY": GetAlarmHistoryAlarmHistorytypeStateTransitionHistory, + "RULE_HISTORY": GetAlarmHistoryAlarmHistorytypeRuleHistory, + "RULE_TRANSITION_HISTORY": GetAlarmHistoryAlarmHistorytypeRuleTransitionHistory, } var mappingGetAlarmHistoryAlarmHistorytypeEnumLowerCase = map[string]GetAlarmHistoryAlarmHistorytypeEnum{ - "state_history": GetAlarmHistoryAlarmHistorytypeHistory, - "state_transition_history": GetAlarmHistoryAlarmHistorytypeTransitionHistory, + "state_history": GetAlarmHistoryAlarmHistorytypeStateHistory, + "state_transition_history": GetAlarmHistoryAlarmHistorytypeStateTransitionHistory, + "rule_history": GetAlarmHistoryAlarmHistorytypeRuleHistory, + "rule_transition_history": GetAlarmHistoryAlarmHistorytypeRuleTransitionHistory, } // GetGetAlarmHistoryAlarmHistorytypeEnumValues Enumerates the set of values for GetAlarmHistoryAlarmHistorytypeEnum @@ -156,6 +163,8 @@ func GetGetAlarmHistoryAlarmHistorytypeEnumStringValues() []string { return []string{ "STATE_HISTORY", "STATE_TRANSITION_HISTORY", + "RULE_HISTORY", + "RULE_TRANSITION_HISTORY", } } diff --git a/monitoring/update_alarm_details.go b/monitoring/update_alarm_details.go index cb666e4c19..c8e5d1fd94 100644 --- a/monitoring/update_alarm_details.go +++ b/monitoring/update_alarm_details.go @@ -139,6 +139,21 @@ type UpdateAlarmDetails struct { // Usage of predefined tag keys. These predefined keys are scoped to namespaces. // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A set of overrides that control evaluations of the alarm. + // Each override can specify values for query, severity, body, and pending duration. + // When an alarm contains overrides, the Monitoring service evaluates each override in order, beginning with the first override in the array (index position `0`), + // and then evaluates the alarm's base values (`ruleName` value of `BASE`). + Overrides []AlarmOverride `mandatory:"false" json:"overrides"` + + // Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. + // A valid ruleName value starts with an alphabetic character and includes only alphanumeric characters, underscores and square brackets. + // Minimum number of characters: 3. Default value is `BASE`. For information about alarm overrides, see AlarmOverride. + RuleName *string `mandatory:"false" json:"ruleName"` + + // The version of the alarm notification to be delivered. Allowed value: `1.X` + // The value must start with a number (up to four digits), followed by a period and an uppercase X. + NotificationVersion *string `mandatory:"false" json:"notificationVersion"` } func (m UpdateAlarmDetails) String() string { diff --git a/networkloadbalancer/backend.go b/networkloadbalancer/backend.go index b63b82e1c3..43590be71e 100644 --- a/networkloadbalancer/backend.go +++ b/networkloadbalancer/backend.go @@ -16,7 +16,7 @@ import ( ) // Backend The configuration of a backend server that is a member of a network load balancer backend set. -// For more information, see Managing Backend Servers (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendservers.htm). +// For more information, see Managing Backend Servers (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/BackendServers/backend-server-management.htm). type Backend struct { // The communication port for the backend server. @@ -39,7 +39,7 @@ type Backend struct { // proportion of incoming traffic. For example, a server weighted '3' receives three times the number of new connections // as a server weighted '1'. // For more information about load balancing policies, see - // How Network Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm). + // How Network Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/introducton.htm#Policies). // Example: `3` Weight *int `mandatory:"false" json:"weight"` diff --git a/networkloadbalancer/backend_details.go b/networkloadbalancer/backend_details.go index 1dfb997ee0..8c90d81dc8 100644 --- a/networkloadbalancer/backend_details.go +++ b/networkloadbalancer/backend_details.go @@ -38,7 +38,7 @@ type BackendDetails struct { // proportion of incoming traffic. For example, a server weighted '3' receives three times the number of new connections // as a server weighted '1'. // For more information about load balancing policies, see - // How Network Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm). + // How Network Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/introducton.htm#Policies). // Example: `3` Weight *int `mandatory:"false" json:"weight"` diff --git a/networkloadbalancer/backend_set.go b/networkloadbalancer/backend_set.go index 2ddf9c73c5..ec6e3aa27c 100644 --- a/networkloadbalancer/backend_set.go +++ b/networkloadbalancer/backend_set.go @@ -17,7 +17,7 @@ import ( // BackendSet The configuration of a network load balancer backend set. // For more information about backend set configuration, see -// Managing Backend Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendsets.htm). +// Managing Backend Sets (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/BackendSets/backend-set-management.htm). // **Caution:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type BackendSet struct { diff --git a/networkloadbalancer/backend_set_details.go b/networkloadbalancer/backend_set_details.go index 2005bee14c..cb89b0921c 100644 --- a/networkloadbalancer/backend_set_details.go +++ b/networkloadbalancer/backend_set_details.go @@ -17,7 +17,7 @@ import ( // BackendSetDetails The configuration of a network load balancer backend set. // For more information about backend set configuration, see -// Managing Backend Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendsets.htm). +// Managing Backend Sets (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/BackendSets/backend-set-management.htm). // **Caution:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type BackendSetDetails struct { HealthChecker *HealthChecker `mandatory:"true" json:"healthChecker"` diff --git a/networkloadbalancer/backend_set_summary.go b/networkloadbalancer/backend_set_summary.go index 89264c4af6..67b419ee6c 100644 --- a/networkloadbalancer/backend_set_summary.go +++ b/networkloadbalancer/backend_set_summary.go @@ -17,7 +17,7 @@ import ( // BackendSetSummary The configuration of a network load balancer backend set. // For more information about backend set configuration, see -// Managing Backend Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendsets.htm). +// Managing Backend Sets (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/BackendSets/backend-set-management.htm). // **Caution:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type BackendSetSummary struct { diff --git a/networkloadbalancer/backend_summary.go b/networkloadbalancer/backend_summary.go index 5bb9e19407..6aad3a0f82 100644 --- a/networkloadbalancer/backend_summary.go +++ b/networkloadbalancer/backend_summary.go @@ -16,7 +16,7 @@ import ( ) // BackendSummary The configuration of a backend server that is a member of a network load balancer backend set. -// For more information, see Managing Backend Servers (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendservers.htm). +// For more information, see Managing Backend Servers (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/BackendServers/backend-server-management.htm). type BackendSummary struct { // The communication port for the backend server. @@ -39,7 +39,7 @@ type BackendSummary struct { // proportion of incoming traffic. For example, a server weighted '3' receives three times the number of new connections // as a server weighted '1'. // For more information about load balancing policies, see - // How Network Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm). + // How Network Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/introducton.htm#Policies). // Example: `3` Weight *int `mandatory:"false" json:"weight"` diff --git a/networkloadbalancer/create_backend_details.go b/networkloadbalancer/create_backend_details.go index 48c80bed4a..7abc9cccde 100644 --- a/networkloadbalancer/create_backend_details.go +++ b/networkloadbalancer/create_backend_details.go @@ -16,7 +16,7 @@ import ( ) // CreateBackendDetails The configuration of a backend server that is a member of a network load balancer backend set. -// For more information, see Managing Backend Servers (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendservers.htm). +// For more information, see Managing Backend Servers (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/BackendServers/backend-server-management.htm). type CreateBackendDetails struct { // The communication port for the backend server. @@ -39,7 +39,7 @@ type CreateBackendDetails struct { // proportion of incoming traffic. For example, a server weighted '3' receives three times the number of new connections // as a server weighted '1'. // For more information about load balancing policies, see - // How Network Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm). + // How Network Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/introducton.htm#Policies). // Example: `3` Weight *int `mandatory:"false" json:"weight"` diff --git a/networkloadbalancer/create_backend_set_details.go b/networkloadbalancer/create_backend_set_details.go index a251884fda..510d6e232f 100644 --- a/networkloadbalancer/create_backend_set_details.go +++ b/networkloadbalancer/create_backend_set_details.go @@ -17,7 +17,7 @@ import ( // CreateBackendSetDetails The configuration details for creating a backend set in a network load balancer. // For more information about backend set configuration, see -// Managing Backend Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendsets.htm). +// Managing Backend Sets (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/BackendSets/backend-set-management.htm). // **Caution:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type CreateBackendSetDetails struct { diff --git a/networkloadbalancer/create_listener_details.go b/networkloadbalancer/create_listener_details.go index b9e0745c1e..f44dce5f24 100644 --- a/networkloadbalancer/create_listener_details.go +++ b/networkloadbalancer/create_listener_details.go @@ -16,8 +16,8 @@ import ( ) // CreateListenerDetails The configuration of the listener. -// For more information about backend set configuration, see -// Managing Load Balancer Listeners (https://docs.cloud.oracle.com/Content/Balance/Tasks/managinglisteners.htm). +// For more information about listener configuration, see +// Managing Network Load Balancer Listeners (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/Listeners/listener-management.htm). type CreateListenerDetails struct { // A friendly name for the listener. It must be unique and it cannot be changed. @@ -33,10 +33,9 @@ type CreateListenerDetails struct { Port *int `mandatory:"true" json:"port"` // The protocol on which the listener accepts connection requests. - // For public network load balancers, ANY protocol refers to TCP/UDP. + // For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. // For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). - // To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols - // operation. + // "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. // Example: `TCP` Protocol ListenerProtocolsEnum `mandatory:"true" json:"protocol"` diff --git a/networkloadbalancer/create_network_load_balancer_details.go b/networkloadbalancer/create_network_load_balancer_details.go index 5d1944bfaf..7441f2e639 100644 --- a/networkloadbalancer/create_network_load_balancer_details.go +++ b/networkloadbalancer/create_network_load_balancer_details.go @@ -16,7 +16,7 @@ import ( ) // CreateNetworkLoadBalancerDetails The properties that define a network load balancer. For more information, see -// Managing a network load balancer (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingloadbalancer.htm). +// Managing a network load balancer (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/NetworkLoadBalancers/network-load-balancer-management.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, then // contact an administrator. If you are an administrator who writes policies to give users access, then see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). @@ -38,6 +38,10 @@ type CreateNetworkLoadBalancerDetails struct { // enabled on the load balancer VNIC, and packets are sent to the backend with the entire IP header intact. IsPreserveSourceDestination *bool `mandatory:"false" json:"isPreserveSourceDestination"` + // This can only be enabled when NLB is working in transparent mode with source destination header preservation enabled. + // This removes the additional dependency from NLB backends(like Firewalls) to perform SNAT. + IsSymmetricHashEnabled *bool `mandatory:"false" json:"isSymmetricHashEnabled"` + // An array of reserved Ips. ReservedIps []ReservedIp `mandatory:"false" json:"reservedIps"` @@ -47,7 +51,7 @@ type CreateNetworkLoadBalancerDetails struct { // A public network load balancer is accessible from the internet, depending on the // security list rules (https://docs.cloud.oracle.com/Content/network/Concepts/securitylists.htm) for your virtual cloud network. For more information about public and // private network load balancers, - // see How Network Load Balancing Works (https://docs.cloud.oracle.com/Content/Balance/Concepts/balanceoverview.htm#how-network-load-balancing-works). + // see How Network Load Balancing Works (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/overview.htm). // This value is true by default. // Example: `true` IsPrivate *bool `mandatory:"false" json:"isPrivate"` diff --git a/networkloadbalancer/health_checker.go b/networkloadbalancer/health_checker.go index 0d1d2e6b6b..9f8dd3f559 100644 --- a/networkloadbalancer/health_checker.go +++ b/networkloadbalancer/health_checker.go @@ -16,7 +16,7 @@ import ( ) // HealthChecker The health check policy configuration. -// For more information, see Editing Health Check Policies (https://docs.cloud.oracle.com/Content/Balance/Tasks/editinghealthcheck.htm). +// For more information, see Editing Health Check Policies (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/HealthCheckPolicies/health-check-policy-management.htm). type HealthChecker struct { // The protocol the health check must use; either HTTP or HTTPS, or UDP or TCP. diff --git a/networkloadbalancer/health_checker_details.go b/networkloadbalancer/health_checker_details.go index 0bbb7313f4..fdf217f120 100644 --- a/networkloadbalancer/health_checker_details.go +++ b/networkloadbalancer/health_checker_details.go @@ -16,7 +16,7 @@ import ( ) // HealthCheckerDetails The health check policy configuration. -// For more information, see Editing Health Check Policies (https://docs.cloud.oracle.com/Content/Balance/Tasks/editinghealthcheck.htm). +// For more information, see Editing Health Check Policies (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/HealthCheckPolicies/health-check-policy-management.htm). type HealthCheckerDetails struct { // The protocol the health check must use; either HTTP or HTTPS, or UDP or TCP. diff --git a/networkloadbalancer/listener.go b/networkloadbalancer/listener.go index 723e0cc34a..f0dbb8680d 100644 --- a/networkloadbalancer/listener.go +++ b/networkloadbalancer/listener.go @@ -16,8 +16,8 @@ import ( ) // Listener The congfiguration of the listener. -// For more information about backend set configuration, see -// Managing Load Balancer Listeners (https://docs.cloud.oracle.com/Content/Balance/Tasks/managinglisteners.htm). +// For more information about listener configuration, see +// Managing Load Balancer Listeners (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/Listeners/listener-management.htm). type Listener struct { // A friendly name for the listener. It must be unique and it cannot be changed. @@ -33,10 +33,9 @@ type Listener struct { Port *int `mandatory:"true" json:"port"` // The protocol on which the listener accepts connection requests. - // For public network load balancers, ANY protocol refers to TCP/UDP. + // For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. // For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). - // To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols - // operation. + // "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. // Example: `TCP` Protocol ListenerProtocolsEnum `mandatory:"true" json:"protocol"` diff --git a/networkloadbalancer/listener_details.go b/networkloadbalancer/listener_details.go index 28579a3fb3..a7eea20848 100644 --- a/networkloadbalancer/listener_details.go +++ b/networkloadbalancer/listener_details.go @@ -16,8 +16,8 @@ import ( ) // ListenerDetails The listener's configuration. -// For more information about backend set configuration, see -// Managing Load Balancer Listeners (https://docs.cloud.oracle.com/Content/Balance/Tasks/managinglisteners.htm). +// For more information about listener configuration, see +// Managing Load Balancer Listeners (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/Listeners/listener-management.htm). type ListenerDetails struct { // A friendly name for the listener. It must be unique and it cannot be changed. @@ -33,10 +33,9 @@ type ListenerDetails struct { Port *int `mandatory:"true" json:"port"` // The protocol on which the listener accepts connection requests. - // For public network load balancers, ANY protocol refers to TCP/UDP. + // For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. // For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). - // To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols - // operation. + // "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. // Example: `TCP` Protocol ListenerProtocolsEnum `mandatory:"true" json:"protocol"` diff --git a/networkloadbalancer/listener_summary.go b/networkloadbalancer/listener_summary.go index fd393719e3..62a39a0fc7 100644 --- a/networkloadbalancer/listener_summary.go +++ b/networkloadbalancer/listener_summary.go @@ -16,8 +16,8 @@ import ( ) // ListenerSummary The configuration of the listener. -// For more information about backend set configuration, see -// Managing Load Balancer Listeners (https://docs.cloud.oracle.com/Content/Balance/Tasks/managinglisteners.htm). +// For more information about listener configuration, see +// Managing Load Balancer Listeners (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/Listeners/listener-management.htm). type ListenerSummary struct { // A friendly name for the listener. It must be unique and it cannot be changed. @@ -33,10 +33,9 @@ type ListenerSummary struct { Port *int `mandatory:"true" json:"port"` // The protocol on which the listener accepts connection requests. - // For public network load balancers, ANY protocol refers to TCP/UDP. + // For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. // For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). - // To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols - // operation. + // "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. // Example: `TCP` Protocol ListenerProtocolsEnum `mandatory:"true" json:"protocol"` diff --git a/networkloadbalancer/network_load_balancer.go b/networkloadbalancer/network_load_balancer.go index 70a841daff..d771371f94 100644 --- a/networkloadbalancer/network_load_balancer.go +++ b/networkloadbalancer/network_load_balancer.go @@ -16,7 +16,7 @@ import ( ) // NetworkLoadBalancer The properties that define a network load balancer. For more information, see -// Managing a network load balancer (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingloadbalancer.htm). +// Managing a network load balancer (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/NetworkLoadBalancers/network-load-balancer-management.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, // contact an administrator. If you are an administrator who writes policies to give users access, then see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). @@ -65,7 +65,7 @@ type NetworkLoadBalancer struct { // A public network load balancer is accessible from the internet, depending the // security list rules (https://docs.cloud.oracle.com/Content/network/Concepts/securitylists.htm) for your virtual cloudn network. For more information about public and // private network load balancers, - // see How Network Load Balancing Works (https://docs.cloud.oracle.com/Content/Balance/Concepts/balanceoverview.htm#how-network-load-balancing-works). + // see How Network Load Balancing Works (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/overview.htm). // This value is true by default. // Example: `true` IsPrivate *bool `mandatory:"false" json:"isPrivate"` @@ -74,6 +74,10 @@ type NetworkLoadBalancer struct { // Packets are sent to the backend set without any changes to the source and destination IP. IsPreserveSourceDestination *bool `mandatory:"false" json:"isPreserveSourceDestination"` + // This can only be enabled when NLB is working in transparent mode with source destination header preservation enabled. + // This removes the additional dependency from NLB backends(like Firewalls) to perform SNAT. + IsSymmetricHashEnabled *bool `mandatory:"false" json:"isSymmetricHashEnabled"` + // An array of network security groups OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) associated with the network load // balancer. // During the creation of the network load balancer, the service adds the new load balancer to the specified network security groups. diff --git a/networkloadbalancer/network_load_balancer_summary.go b/networkloadbalancer/network_load_balancer_summary.go index 9d32732668..c2e497a934 100644 --- a/networkloadbalancer/network_load_balancer_summary.go +++ b/networkloadbalancer/network_load_balancer_summary.go @@ -58,7 +58,7 @@ type NetworkLoadBalancerSummary struct { // A public network load balancer is accessible from the internet, depending the // security list rules (https://docs.cloud.oracle.com/Content/network/Concepts/securitylists.htm) for your virtual cloudn network. For more information about public and // private network load balancers, - // see How Network Load Balancing Works (https://docs.cloud.oracle.com/Content/Balance/Concepts/balanceoverview.htm#how-network-load-balancing-works). + // see How Network Load Balancing Works (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/overview.htm). // This value is true by default. // Example: `true` IsPrivate *bool `mandatory:"false" json:"isPrivate"` @@ -67,6 +67,10 @@ type NetworkLoadBalancerSummary struct { // Packets are sent to the backend set without any changes to the source and destination IP. IsPreserveSourceDestination *bool `mandatory:"false" json:"isPreserveSourceDestination"` + // This can only be enabled when NLB is working in transparent mode with source destination header preservation enabled. + // This removes the additional dependency from NLB backends(like Firewalls) to perform SNAT. + IsSymmetricHashEnabled *bool `mandatory:"false" json:"isSymmetricHashEnabled"` + // An array of network security groups OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) associated with the network load // balancer. // During the creation of the network load balancer, the service adds the new load balancer to the specified network security groups. diff --git a/networkloadbalancer/networkloadbalancer_client.go b/networkloadbalancer/networkloadbalancer_client.go index 1355ecf685..3e657977ea 100644 --- a/networkloadbalancer/networkloadbalancer_client.go +++ b/networkloadbalancer/networkloadbalancer_client.go @@ -97,9 +97,10 @@ func (client *NetworkLoadBalancerClient) ConfigurationProvider() *common.Configu // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ChangeNetworkLoadBalancerCompartment.go.html to see an example of how to use ChangeNetworkLoadBalancerCompartment API. +// A default retry strategy applies to this operation ChangeNetworkLoadBalancerCompartment() func (client NetworkLoadBalancerClient) ChangeNetworkLoadBalancerCompartment(ctx context.Context, request ChangeNetworkLoadBalancerCompartmentRequest) (response ChangeNetworkLoadBalancerCompartmentResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -159,9 +160,10 @@ func (client NetworkLoadBalancerClient) changeNetworkLoadBalancerCompartment(ctx // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/CreateBackend.go.html to see an example of how to use CreateBackend API. +// A default retry strategy applies to this operation CreateBackend() func (client NetworkLoadBalancerClient) CreateBackend(ctx context.Context, request CreateBackendRequest) (response CreateBackendResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -221,9 +223,10 @@ func (client NetworkLoadBalancerClient) createBackend(ctx context.Context, reque // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/CreateBackendSet.go.html to see an example of how to use CreateBackendSet API. +// A default retry strategy applies to this operation CreateBackendSet() func (client NetworkLoadBalancerClient) CreateBackendSet(ctx context.Context, request CreateBackendSetRequest) (response CreateBackendSetResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -283,9 +286,10 @@ func (client NetworkLoadBalancerClient) createBackendSet(ctx context.Context, re // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/CreateListener.go.html to see an example of how to use CreateListener API. +// A default retry strategy applies to this operation CreateListener() func (client NetworkLoadBalancerClient) CreateListener(ctx context.Context, request CreateListenerRequest) (response CreateListenerResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -345,9 +349,10 @@ func (client NetworkLoadBalancerClient) createListener(ctx context.Context, requ // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/CreateNetworkLoadBalancer.go.html to see an example of how to use CreateNetworkLoadBalancer API. +// A default retry strategy applies to this operation CreateNetworkLoadBalancer() func (client NetworkLoadBalancerClient) CreateNetworkLoadBalancer(ctx context.Context, request CreateNetworkLoadBalancerRequest) (response CreateNetworkLoadBalancerResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -407,9 +412,10 @@ func (client NetworkLoadBalancerClient) createNetworkLoadBalancer(ctx context.Co // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/DeleteBackend.go.html to see an example of how to use DeleteBackend API. +// A default retry strategy applies to this operation DeleteBackend() func (client NetworkLoadBalancerClient) DeleteBackend(ctx context.Context, request DeleteBackendRequest) (response DeleteBackendResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -465,9 +471,10 @@ func (client NetworkLoadBalancerClient) deleteBackend(ctx context.Context, reque // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/DeleteBackendSet.go.html to see an example of how to use DeleteBackendSet API. +// A default retry strategy applies to this operation DeleteBackendSet() func (client NetworkLoadBalancerClient) DeleteBackendSet(ctx context.Context, request DeleteBackendSetRequest) (response DeleteBackendSetResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -522,9 +529,10 @@ func (client NetworkLoadBalancerClient) deleteBackendSet(ctx context.Context, re // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/DeleteListener.go.html to see an example of how to use DeleteListener API. +// A default retry strategy applies to this operation DeleteListener() func (client NetworkLoadBalancerClient) DeleteListener(ctx context.Context, request DeleteListenerRequest) (response DeleteListenerResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -579,9 +587,10 @@ func (client NetworkLoadBalancerClient) deleteListener(ctx context.Context, requ // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/DeleteNetworkLoadBalancer.go.html to see an example of how to use DeleteNetworkLoadBalancer API. +// A default retry strategy applies to this operation DeleteNetworkLoadBalancer() func (client NetworkLoadBalancerClient) DeleteNetworkLoadBalancer(ctx context.Context, request DeleteNetworkLoadBalancerRequest) (response DeleteNetworkLoadBalancerResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -636,9 +645,10 @@ func (client NetworkLoadBalancerClient) deleteNetworkLoadBalancer(ctx context.Co // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/GetBackend.go.html to see an example of how to use GetBackend API. +// A default retry strategy applies to this operation GetBackend() func (client NetworkLoadBalancerClient) GetBackend(ctx context.Context, request GetBackendRequest) (response GetBackendResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -693,9 +703,10 @@ func (client NetworkLoadBalancerClient) getBackend(ctx context.Context, request // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/GetBackendHealth.go.html to see an example of how to use GetBackendHealth API. +// A default retry strategy applies to this operation GetBackendHealth() func (client NetworkLoadBalancerClient) GetBackendHealth(ctx context.Context, request GetBackendHealthRequest) (response GetBackendHealthResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -750,9 +761,10 @@ func (client NetworkLoadBalancerClient) getBackendHealth(ctx context.Context, re // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/GetBackendSet.go.html to see an example of how to use GetBackendSet API. +// A default retry strategy applies to this operation GetBackendSet() func (client NetworkLoadBalancerClient) GetBackendSet(ctx context.Context, request GetBackendSetRequest) (response GetBackendSetResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -807,9 +819,10 @@ func (client NetworkLoadBalancerClient) getBackendSet(ctx context.Context, reque // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/GetBackendSetHealth.go.html to see an example of how to use GetBackendSetHealth API. +// A default retry strategy applies to this operation GetBackendSetHealth() func (client NetworkLoadBalancerClient) GetBackendSetHealth(ctx context.Context, request GetBackendSetHealthRequest) (response GetBackendSetHealthResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -864,9 +877,10 @@ func (client NetworkLoadBalancerClient) getBackendSetHealth(ctx context.Context, // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/GetHealthChecker.go.html to see an example of how to use GetHealthChecker API. +// A default retry strategy applies to this operation GetHealthChecker() func (client NetworkLoadBalancerClient) GetHealthChecker(ctx context.Context, request GetHealthCheckerRequest) (response GetHealthCheckerResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -926,9 +940,10 @@ func (client NetworkLoadBalancerClient) getHealthChecker(ctx context.Context, re // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/GetListener.go.html to see an example of how to use GetListener API. +// A default retry strategy applies to this operation GetListener() func (client NetworkLoadBalancerClient) GetListener(ctx context.Context, request GetListenerRequest) (response GetListenerResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -983,9 +998,10 @@ func (client NetworkLoadBalancerClient) getListener(ctx context.Context, request // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/GetNetworkLoadBalancer.go.html to see an example of how to use GetNetworkLoadBalancer API. +// A default retry strategy applies to this operation GetNetworkLoadBalancer() func (client NetworkLoadBalancerClient) GetNetworkLoadBalancer(ctx context.Context, request GetNetworkLoadBalancerRequest) (response GetNetworkLoadBalancerResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1040,9 +1056,10 @@ func (client NetworkLoadBalancerClient) getNetworkLoadBalancer(ctx context.Conte // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/GetNetworkLoadBalancerHealth.go.html to see an example of how to use GetNetworkLoadBalancerHealth API. +// A default retry strategy applies to this operation GetNetworkLoadBalancerHealth() func (client NetworkLoadBalancerClient) GetNetworkLoadBalancerHealth(ctx context.Context, request GetNetworkLoadBalancerHealthRequest) (response GetNetworkLoadBalancerHealthResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1097,9 +1114,10 @@ func (client NetworkLoadBalancerClient) getNetworkLoadBalancerHealth(ctx context // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() func (client NetworkLoadBalancerClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1154,9 +1172,10 @@ func (client NetworkLoadBalancerClient) getWorkRequest(ctx context.Context, requ // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ListBackendSets.go.html to see an example of how to use ListBackendSets API. +// A default retry strategy applies to this operation ListBackendSets() func (client NetworkLoadBalancerClient) ListBackendSets(ctx context.Context, request ListBackendSetsRequest) (response ListBackendSetsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1211,9 +1230,10 @@ func (client NetworkLoadBalancerClient) listBackendSets(ctx context.Context, req // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ListBackends.go.html to see an example of how to use ListBackends API. +// A default retry strategy applies to this operation ListBackends() func (client NetworkLoadBalancerClient) ListBackends(ctx context.Context, request ListBackendsRequest) (response ListBackendsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1268,9 +1288,10 @@ func (client NetworkLoadBalancerClient) listBackends(ctx context.Context, reques // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ListListeners.go.html to see an example of how to use ListListeners API. +// A default retry strategy applies to this operation ListListeners() func (client NetworkLoadBalancerClient) ListListeners(ctx context.Context, request ListListenersRequest) (response ListListenersResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1325,9 +1346,10 @@ func (client NetworkLoadBalancerClient) listListeners(ctx context.Context, reque // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ListNetworkLoadBalancerHealths.go.html to see an example of how to use ListNetworkLoadBalancerHealths API. +// A default retry strategy applies to this operation ListNetworkLoadBalancerHealths() func (client NetworkLoadBalancerClient) ListNetworkLoadBalancerHealths(ctx context.Context, request ListNetworkLoadBalancerHealthsRequest) (response ListNetworkLoadBalancerHealthsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1382,9 +1404,10 @@ func (client NetworkLoadBalancerClient) listNetworkLoadBalancerHealths(ctx conte // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ListNetworkLoadBalancers.go.html to see an example of how to use ListNetworkLoadBalancers API. +// A default retry strategy applies to this operation ListNetworkLoadBalancers() func (client NetworkLoadBalancerClient) ListNetworkLoadBalancers(ctx context.Context, request ListNetworkLoadBalancersRequest) (response ListNetworkLoadBalancersResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1439,9 +1462,10 @@ func (client NetworkLoadBalancerClient) listNetworkLoadBalancers(ctx context.Con // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ListNetworkLoadBalancersPolicies.go.html to see an example of how to use ListNetworkLoadBalancersPolicies API. +// A default retry strategy applies to this operation ListNetworkLoadBalancersPolicies() func (client NetworkLoadBalancerClient) ListNetworkLoadBalancersPolicies(ctx context.Context, request ListNetworkLoadBalancersPoliciesRequest) (response ListNetworkLoadBalancersPoliciesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1497,9 +1521,10 @@ func (client NetworkLoadBalancerClient) listNetworkLoadBalancersPolicies(ctx con // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ListNetworkLoadBalancersProtocols.go.html to see an example of how to use ListNetworkLoadBalancersProtocols API. +// A default retry strategy applies to this operation ListNetworkLoadBalancersProtocols() func (client NetworkLoadBalancerClient) ListNetworkLoadBalancersProtocols(ctx context.Context, request ListNetworkLoadBalancersProtocolsRequest) (response ListNetworkLoadBalancersProtocolsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1554,9 +1579,10 @@ func (client NetworkLoadBalancerClient) listNetworkLoadBalancersProtocols(ctx co // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() func (client NetworkLoadBalancerClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1611,9 +1637,10 @@ func (client NetworkLoadBalancerClient) listWorkRequestErrors(ctx context.Contex // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() func (client NetworkLoadBalancerClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1668,9 +1695,10 @@ func (client NetworkLoadBalancerClient) listWorkRequestLogs(ctx context.Context, // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() func (client NetworkLoadBalancerClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1725,9 +1753,10 @@ func (client NetworkLoadBalancerClient) listWorkRequests(ctx context.Context, re // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/UpdateBackend.go.html to see an example of how to use UpdateBackend API. +// A default retry strategy applies to this operation UpdateBackend() func (client NetworkLoadBalancerClient) UpdateBackend(ctx context.Context, request UpdateBackendRequest) (response UpdateBackendResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1787,9 +1816,10 @@ func (client NetworkLoadBalancerClient) updateBackend(ctx context.Context, reque // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/UpdateBackendSet.go.html to see an example of how to use UpdateBackendSet API. +// A default retry strategy applies to this operation UpdateBackendSet() func (client NetworkLoadBalancerClient) UpdateBackendSet(ctx context.Context, request UpdateBackendSetRequest) (response UpdateBackendSetResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1849,9 +1879,10 @@ func (client NetworkLoadBalancerClient) updateBackendSet(ctx context.Context, re // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/UpdateHealthChecker.go.html to see an example of how to use UpdateHealthChecker API. +// A default retry strategy applies to this operation UpdateHealthChecker() func (client NetworkLoadBalancerClient) UpdateHealthChecker(ctx context.Context, request UpdateHealthCheckerRequest) (response UpdateHealthCheckerResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1911,9 +1942,10 @@ func (client NetworkLoadBalancerClient) updateHealthChecker(ctx context.Context, // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/UpdateListener.go.html to see an example of how to use UpdateListener API. +// A default retry strategy applies to this operation UpdateListener() func (client NetworkLoadBalancerClient) UpdateListener(ctx context.Context, request UpdateListenerRequest) (response UpdateListenerResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1973,9 +2005,10 @@ func (client NetworkLoadBalancerClient) updateListener(ctx context.Context, requ // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/UpdateNetworkLoadBalancer.go.html to see an example of how to use UpdateNetworkLoadBalancer API. +// A default retry strategy applies to this operation UpdateNetworkLoadBalancer() func (client NetworkLoadBalancerClient) UpdateNetworkLoadBalancer(ctx context.Context, request UpdateNetworkLoadBalancerRequest) (response UpdateNetworkLoadBalancerResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -2030,9 +2063,10 @@ func (client NetworkLoadBalancerClient) updateNetworkLoadBalancer(ctx context.Co // # See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/networkloadbalancer/UpdateNetworkSecurityGroups.go.html to see an example of how to use UpdateNetworkSecurityGroups API. +// A default retry strategy applies to this operation UpdateNetworkSecurityGroups() func (client NetworkLoadBalancerClient) UpdateNetworkSecurityGroups(ctx context.Context, request UpdateNetworkSecurityGroupsRequest) (response UpdateNetworkSecurityGroupsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } diff --git a/networkloadbalancer/operation_type.go b/networkloadbalancer/operation_type.go index b1e9ef46f6..7f28e45daa 100644 --- a/networkloadbalancer/operation_type.go +++ b/networkloadbalancer/operation_type.go @@ -35,6 +35,7 @@ const ( OperationTypeChangeCompartment OperationTypeEnum = "CHANGE_COMPARTMENT" OperationTypeAttachNlbToPod OperationTypeEnum = "ATTACH_NLB_TO_POD" OperationTypeDetachNlbFromPod OperationTypeEnum = "DETACH_NLB_FROM_POD" + OperationTypeLiveMigration OperationTypeEnum = "LIVE_MIGRATION" ) var mappingOperationTypeEnum = map[string]OperationTypeEnum{ @@ -55,6 +56,7 @@ var mappingOperationTypeEnum = map[string]OperationTypeEnum{ "CHANGE_COMPARTMENT": OperationTypeChangeCompartment, "ATTACH_NLB_TO_POD": OperationTypeAttachNlbToPod, "DETACH_NLB_FROM_POD": OperationTypeDetachNlbFromPod, + "LIVE_MIGRATION": OperationTypeLiveMigration, } var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ @@ -75,6 +77,7 @@ var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ "change_compartment": OperationTypeChangeCompartment, "attach_nlb_to_pod": OperationTypeAttachNlbToPod, "detach_nlb_from_pod": OperationTypeDetachNlbFromPod, + "live_migration": OperationTypeLiveMigration, } // GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum @@ -106,6 +109,7 @@ func GetOperationTypeEnumStringValues() []string { "CHANGE_COMPARTMENT", "ATTACH_NLB_TO_POD", "DETACH_NLB_FROM_POD", + "LIVE_MIGRATION", } } diff --git a/networkloadbalancer/update_backend_details.go b/networkloadbalancer/update_backend_details.go index 8b2d0e942a..8103585095 100644 --- a/networkloadbalancer/update_backend_details.go +++ b/networkloadbalancer/update_backend_details.go @@ -22,7 +22,7 @@ type UpdateBackendDetails struct { // proportion of incoming traffic. For example, a server weighted '3' receives three times the number of new connections // as a server weighted '1'. // For more information about load balancing policies, see - // How Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm). + // How Network Load Balancing Policies Work (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/introducton.htm#Policies). // Example: `3` Weight *int `mandatory:"false" json:"weight"` diff --git a/networkloadbalancer/update_backend_set_details.go b/networkloadbalancer/update_backend_set_details.go index 9a0385715b..265a19d956 100644 --- a/networkloadbalancer/update_backend_set_details.go +++ b/networkloadbalancer/update_backend_set_details.go @@ -17,7 +17,7 @@ import ( // UpdateBackendSetDetails The configuration details for updating a load balancer backend set. // For more information about backend set configuration, see -// Managing Backend Sets (https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendsets.htm). +// Managing Backend Sets (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/BackendSets/backend-set-management.htm). // **Caution:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. type UpdateBackendSetDetails struct { diff --git a/networkloadbalancer/update_listener_details.go b/networkloadbalancer/update_listener_details.go index e77f7c478b..ed687e7124 100644 --- a/networkloadbalancer/update_listener_details.go +++ b/networkloadbalancer/update_listener_details.go @@ -17,7 +17,7 @@ import ( // UpdateListenerDetails The configuration of the listener. // For more information about backend set configuration, see -// Managing Network Load Balancer Listeners (https://docs.cloud.oracle.com/Content/Balance/Tasks/managinglisteners.htm). +// Managing Network Load Balancer Listeners (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/Listeners/listener-management.htm). type UpdateListenerDetails struct { // The name of the associated backend set. @@ -29,10 +29,9 @@ type UpdateListenerDetails struct { Port *int `mandatory:"false" json:"port"` // The protocol on which the listener accepts connection requests. - // For public network load balancers, ANY protocol refers to TCP/UDP. + // For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. // For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). - // To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols - // operation. + // "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. // Example: `TCP` Protocol ListenerProtocolsEnum `mandatory:"false" json:"protocol,omitempty"` diff --git a/networkloadbalancer/update_network_load_balancer_details.go b/networkloadbalancer/update_network_load_balancer_details.go index ecd63537d9..bb29d932b1 100644 --- a/networkloadbalancer/update_network_load_balancer_details.go +++ b/networkloadbalancer/update_network_load_balancer_details.go @@ -28,6 +28,10 @@ type UpdateNetworkLoadBalancerDetails struct { // enabled on the load balancer VNIC, and packets are sent to the backend with the entire IP header intact. IsPreserveSourceDestination *bool `mandatory:"false" json:"isPreserveSourceDestination"` + // This can only be enabled when NLB is working in transparent mode with source destination header preservation enabled. + // This removes the additional dependency from NLB backends(like Firewalls) to perform SNAT. + IsSymmetricHashEnabled *bool `mandatory:"false" json:"isSymmetricHashEnabled"` + // IP version associated with the NLB. NlbIpVersion NlbIpVersionEnum `mandatory:"false" json:"nlbIpVersion,omitempty"`