From 3c73de945ddb41f57a91c16cb08319f8ec0f08df Mon Sep 17 00:00:00 2001 From: DEXREQ Automation Date: Mon, 20 May 2024 17:48:34 +0000 Subject: [PATCH] Pull request #2756: Releasing Version 65.65.3 Merge in SDK/oci-go-sdk from merge_to_github2024-05-20 to github Squashed commit of the following: commit 14a2364230a89c7f982a23830423465bfedcd1f3 Author: oci-dex-release-bot Date: Mon May 20 17:01:37 2024 +0000 Releasing version 65 65 3 --- CHANGELOG.md | 8 + Makefile | 2 +- bds/backup_node_details.go | 71 ++ bds/backup_node_request_response.go | 107 ++ bds/bds_client.go | 1048 +++++++++++++++-- ...reate_node_backup_configuration_details.go | 95 ++ ...e_backup_configuration_request_response.go | 100 ++ ...eate_node_replace_configuration_details.go | 89 ++ ..._replace_configuration_request_response.go | 100 ++ ...e_backup_configuration_request_response.go | 100 ++ bds/delete_node_backup_request_response.go | 100 ++ ...e_backup_configuration_request_response.go | 96 ++ bds/get_node_backup_request_response.go | 96 ++ ..._replace_configuration_request_response.go | 96 ++ bds/level_type_details.go | 123 ++ ..._backup_configurations_request_response.go | 206 ++++ bds/list_node_backups_request_response.go | 209 ++++ ...replace_configurations_request_response.go | 206 ++++ bds/node.go | 6 + bds/node_backup.go | 218 ++++ bds/node_backup_configuration.go | 187 +++ bds/node_backup_configuration_summary.go | 102 ++ bds/node_backup_summary.go | 69 ++ bds/node_level_details.go | 54 + bds/node_replace_configuration.go | 217 ++++ bds/node_replace_configuration_summary.go | 102 ++ bds/node_type_level_details.go | 57 + bds/operation_types.go | 36 + ...move_node_replace_configuration_details.go | 39 + ..._replace_configuration_request_response.go | 110 ++ bds/replace_node_details.go | 48 + bds/replace_node_request_response.go | 107 ++ ...pdate_node_backup_configuration_details.go | 95 ++ ...e_backup_configuration_request_response.go | 110 ++ ...date_node_replace_configuration_details.go | 83 ++ ..._replace_configuration_request_response.go | 110 ++ ...tgroups_clusterplacementgroupscp_client.go | 26 +- common/version.go | 2 +- .../cancel_pipeline_run_request_response.go | 3 + .../create_job_run_request_response.go | 3 + ...reate_model_deployment_request_response.go | 3 + .../create_pipeline_run_request_response.go | 3 + datascience/fast_launch_job_config_summary.go | 4 + datascience/job_shape_summary.go | 4 + datascience/model_deployment_shape_series.go | 4 + datascience/notebook_session_shape_series.go | 4 + ...ipeline_container_configuration_details.go | 115 ++ .../pipeline_container_step_details.go | 131 +++ datascience/pipeline_container_step_run.go | 94 ++ .../pipeline_container_step_update_details.go | 76 ++ ...eline_custom_script_step_update_details.go | 2 + ...ne_infrastructure_configuration_details.go | 3 + ...ne_ocir_container_configuration_details.go | 72 ++ datascience/pipeline_step_details.go | 8 + datascience/pipeline_step_override_details.go | 33 + datascience/pipeline_step_run.go | 8 + datascience/pipeline_step_update_details.go | 8 + datascience/update_pipeline_details.go | 21 +- resourcescheduler/action_type.go | 72 ++ .../activate_schedule_request_response.go | 109 ++ .../cancel_work_request_request_response.go | 96 ++ .../compartment_id_resource_filter.go | 57 + resourcescheduler/create_schedule_details.go | 229 ++++ .../create_schedule_request_response.go | 113 ++ .../deactivate_schedule_request_response.go | 109 ++ resourcescheduler/defined_tag_filter_value.go | 45 + .../defined_tags_resource_filter.go | 54 + .../delete_schedule_request_response.go | 96 ++ .../get_schedule_request_response.go | 96 ++ .../get_work_request_request_response.go | 99 ++ .../lifecycle_state_resource_filter.go | 54 + .../list_resource_types_request_response.go | 107 ++ .../list_schedules_request_response.go | 225 ++++ ...st_work_request_errors_request_response.go | 199 ++++ ...list_work_request_logs_request_response.go | 199 ++++ .../list_work_requests_request_response.go | 280 +++++ resourcescheduler/operation_status.go | 80 ++ resourcescheduler/operation_type.go | 68 ++ resourcescheduler/resource.go | 50 + resourcescheduler/resource_filter.go | 147 +++ resourcescheduler/resource_type.go | 39 + resourcescheduler/resource_type_collection.go | 39 + .../resource_type_resource_filter.go | 54 + .../resourcescheduler_schedule_client.go | 861 ++++++++++++++ resourcescheduler/schedule.go | 345 ++++++ resourcescheduler/schedule_collection.go | 39 + resourcescheduler/schedule_summary.go | 288 +++++ resourcescheduler/sort_order.go | 56 + .../time_created_resource_filter.go | 106 ++ resourcescheduler/update_schedule_details.go | 223 ++++ .../update_schedule_request_response.go | 103 ++ resourcescheduler/work_request.go | 79 ++ resourcescheduler/work_request_error.go | 47 + .../work_request_error_collection.go | 39 + resourcescheduler/work_request_log_entry.go | 43 + .../work_request_log_entry_collection.go | 39 + resourcescheduler/work_request_resource.go | 54 + resourcescheduler/work_request_summary.go | 77 ++ .../work_request_summary_collection.go | 39 + 99 files changed, 10281 insertions(+), 102 deletions(-) create mode 100644 bds/backup_node_details.go create mode 100644 bds/backup_node_request_response.go create mode 100644 bds/create_node_backup_configuration_details.go create mode 100644 bds/create_node_backup_configuration_request_response.go create mode 100644 bds/create_node_replace_configuration_details.go create mode 100644 bds/create_node_replace_configuration_request_response.go create mode 100644 bds/delete_node_backup_configuration_request_response.go create mode 100644 bds/delete_node_backup_request_response.go create mode 100644 bds/get_node_backup_configuration_request_response.go create mode 100644 bds/get_node_backup_request_response.go create mode 100644 bds/get_node_replace_configuration_request_response.go create mode 100644 bds/level_type_details.go create mode 100644 bds/list_node_backup_configurations_request_response.go create mode 100644 bds/list_node_backups_request_response.go create mode 100644 bds/list_node_replace_configurations_request_response.go create mode 100644 bds/node_backup.go create mode 100644 bds/node_backup_configuration.go create mode 100644 bds/node_backup_configuration_summary.go create mode 100644 bds/node_backup_summary.go create mode 100644 bds/node_level_details.go create mode 100644 bds/node_replace_configuration.go create mode 100644 bds/node_replace_configuration_summary.go create mode 100644 bds/node_type_level_details.go create mode 100644 bds/remove_node_replace_configuration_details.go create mode 100644 bds/remove_node_replace_configuration_request_response.go create mode 100644 bds/replace_node_details.go create mode 100644 bds/replace_node_request_response.go create mode 100644 bds/update_node_backup_configuration_details.go create mode 100644 bds/update_node_backup_configuration_request_response.go create mode 100644 bds/update_node_replace_configuration_details.go create mode 100644 bds/update_node_replace_configuration_request_response.go create mode 100644 datascience/pipeline_container_configuration_details.go create mode 100644 datascience/pipeline_container_step_details.go create mode 100644 datascience/pipeline_container_step_run.go create mode 100644 datascience/pipeline_container_step_update_details.go create mode 100644 datascience/pipeline_ocir_container_configuration_details.go create mode 100644 resourcescheduler/action_type.go create mode 100644 resourcescheduler/activate_schedule_request_response.go create mode 100644 resourcescheduler/cancel_work_request_request_response.go create mode 100644 resourcescheduler/compartment_id_resource_filter.go create mode 100644 resourcescheduler/create_schedule_details.go create mode 100644 resourcescheduler/create_schedule_request_response.go create mode 100644 resourcescheduler/deactivate_schedule_request_response.go create mode 100644 resourcescheduler/defined_tag_filter_value.go create mode 100644 resourcescheduler/defined_tags_resource_filter.go create mode 100644 resourcescheduler/delete_schedule_request_response.go create mode 100644 resourcescheduler/get_schedule_request_response.go create mode 100644 resourcescheduler/get_work_request_request_response.go create mode 100644 resourcescheduler/lifecycle_state_resource_filter.go create mode 100644 resourcescheduler/list_resource_types_request_response.go create mode 100644 resourcescheduler/list_schedules_request_response.go create mode 100644 resourcescheduler/list_work_request_errors_request_response.go create mode 100644 resourcescheduler/list_work_request_logs_request_response.go create mode 100644 resourcescheduler/list_work_requests_request_response.go create mode 100644 resourcescheduler/operation_status.go create mode 100644 resourcescheduler/operation_type.go create mode 100644 resourcescheduler/resource.go create mode 100644 resourcescheduler/resource_filter.go create mode 100644 resourcescheduler/resource_type.go create mode 100644 resourcescheduler/resource_type_collection.go create mode 100644 resourcescheduler/resource_type_resource_filter.go create mode 100644 resourcescheduler/resourcescheduler_schedule_client.go create mode 100644 resourcescheduler/schedule.go create mode 100644 resourcescheduler/schedule_collection.go create mode 100644 resourcescheduler/schedule_summary.go create mode 100644 resourcescheduler/sort_order.go create mode 100644 resourcescheduler/time_created_resource_filter.go create mode 100644 resourcescheduler/update_schedule_details.go create mode 100644 resourcescheduler/update_schedule_request_response.go create mode 100644 resourcescheduler/work_request.go create mode 100644 resourcescheduler/work_request_error.go create mode 100644 resourcescheduler/work_request_error_collection.go create mode 100644 resourcescheduler/work_request_log_entry.go create mode 100644 resourcescheduler/work_request_log_entry_collection.go create mode 100644 resourcescheduler/work_request_resource.go create mode 100644 resourcescheduler/work_request_summary.go create mode 100644 resourcescheduler/work_request_summary_collection.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c249909aa..6797bee22b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.65.3 - 2024-05-21 +### Added +- Support for the Resource Scheduler service +- Support for Bring Your Own Container (BYOC), custom networking and graceful termination of pipelines in the Data Science service +- Support for backup and replacement of master, utility, and edge nodes in the Big Data service +- Support for nested resource principal in the Data Science service + + ## 65.65.2 - 2024-05-14 ### Added - Support for the Marketplace Private Offer service diff --git a/Makefile b/Makefile index 93b6f550cb..72a3540da4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DOC_SERVER_URL=https:\/\/docs.cloud.oracle.com -GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument queue recovery vbsinst identitydomains accessgovernancecp ocicontrolcenter osmanagementhub fleetsoftwareupdate computecloudatcustomer marketplacepublisher redis jmsjavadownloads psql generativeai generativeaiinference capacitymanagement globallydistributeddatabase desktops emaildataplane clusterplacementgroups marketplaceprivateoffer ##SPECNAME## +GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument queue recovery vbsinst identitydomains accessgovernancecp ocicontrolcenter osmanagementhub fleetsoftwareupdate computecloudatcustomer marketplacepublisher redis jmsjavadownloads psql generativeai generativeaiinference capacitymanagement globallydistributeddatabase desktops emaildataplane clusterplacementgroups marketplaceprivateoffer resourcescheduler ##SPECNAME## NON_GEN_TARGETS = common common/auth objectstorage/transfer example TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS) diff --git a/bds/backup_node_details.go b/bds/backup_node_details.go new file mode 100644 index 0000000000..9268ec57cd --- /dev/null +++ b/bds/backup_node_details.go @@ -0,0 +1,71 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BackupNodeDetails The information about the nodes to backup. +type BackupNodeDetails struct { + LevelTypeDetails LevelTypeDetails `mandatory:"true" json:"levelTypeDetails"` + + // Incremental backup type includes only the changes since the last backup. Full backup type includes all changes since the volume was created. + BackupType NodeBackupBackupTypeEnum `mandatory:"false" json:"backupType,omitempty"` +} + +func (m BackupNodeDetails) 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 BackupNodeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingNodeBackupBackupTypeEnum(string(m.BackupType)); !ok && m.BackupType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackupType: %s. Supported values are: %s.", m.BackupType, strings.Join(GetNodeBackupBackupTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *BackupNodeDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + BackupType NodeBackupBackupTypeEnum `json:"backupType"` + LevelTypeDetails leveltypedetails `json:"levelTypeDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.BackupType = model.BackupType + + nn, e = model.LevelTypeDetails.UnmarshalPolymorphicJSON(model.LevelTypeDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.LevelTypeDetails = nn.(LevelTypeDetails) + } else { + m.LevelTypeDetails = nil + } + + return +} diff --git a/bds/backup_node_request_response.go b/bds/backup_node_request_response.go new file mode 100644 index 0000000000..f7fb234c7c --- /dev/null +++ b/bds/backup_node_request_response.go @@ -0,0 +1,107 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// BackupNodeRequest wrapper for the BackupNode operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/BackupNode.go.html to see an example of how to use BackupNodeRequest. +type BackupNodeRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Details for Taking the node's backup + BackupNodeDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error, without risk of executing that same action again. Retry tokens expire after 24 + // hours but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 BackupNodeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request BackupNodeRequest) 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 BackupNodeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request BackupNodeRequest) 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 BackupNodeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BackupNodeResponse wrapper for the BackupNode operation +type BackupNodeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response BackupNodeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response BackupNodeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/bds_client.go b/bds/bds_client.go index eb33029cf9..7c01912b72 100644 --- a/bds/bds_client.go +++ b/bds/bds_client.go @@ -587,6 +587,68 @@ func (client BdsClient) addWorkerNodes(ctx context.Context, request common.OCIRe return response, err } +// BackupNode Takes a backup of of given nodes. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/BackupNode.go.html to see an example of how to use BackupNode API. +func (client BdsClient) BackupNode(ctx context.Context, request BackupNodeRequest) (response BackupNodeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.backupNode, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = BackupNodeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = BackupNodeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(BackupNodeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into BackupNodeResponse") + } + return +} + +// backupNode implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) backupNode(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/bdsInstances/{bdsInstanceId}/actions/backupNodes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response BackupNodeResponse + 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/bigdata/20190531/BdsInstance/BackupNode" + err = common.PostProcessServiceError(err, "Bds", "BackupNode", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CertificateServiceInfo A list of services and their certificate details. // // # See also @@ -959,6 +1021,130 @@ func (client BdsClient) createBdsMetastoreConfiguration(ctx context.Context, req return response, err } +// CreateNodeBackupConfiguration Add a node volume backup configuration to the cluster for an indicated node type or node. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/CreateNodeBackupConfiguration.go.html to see an example of how to use CreateNodeBackupConfiguration API. +func (client BdsClient) CreateNodeBackupConfiguration(ctx context.Context, request CreateNodeBackupConfigurationRequest) (response CreateNodeBackupConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createNodeBackupConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateNodeBackupConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateNodeBackupConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateNodeBackupConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateNodeBackupConfigurationResponse") + } + return +} + +// createNodeBackupConfiguration implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) createNodeBackupConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/bdsInstances/{bdsInstanceId}/nodeBackupConfigurations", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateNodeBackupConfigurationResponse + 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/bigdata/20190531/BdsInstance/CreateNodeBackupConfiguration" + err = common.PostProcessServiceError(err, "Bds", "CreateNodeBackupConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateNodeReplaceConfiguration Add a nodeReplaceConfigurations to the cluster. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/CreateNodeReplaceConfiguration.go.html to see an example of how to use CreateNodeReplaceConfiguration API. +func (client BdsClient) CreateNodeReplaceConfiguration(ctx context.Context, request CreateNodeReplaceConfigurationRequest) (response CreateNodeReplaceConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createNodeReplaceConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateNodeReplaceConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateNodeReplaceConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateNodeReplaceConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateNodeReplaceConfigurationResponse") + } + return +} + +// createNodeReplaceConfiguration implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) createNodeReplaceConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/bdsInstances/{bdsInstanceId}/nodeReplaceConfigurations", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateNodeReplaceConfigurationResponse + 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/bigdata/20190531/BdsInstance/CreateNodeReplaceConfiguration" + err = common.PostProcessServiceError(err, "Bds", "CreateNodeReplaceConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteBdsApiKey Deletes the user's API key represented by the provided ID. // // # See also @@ -1130,6 +1316,120 @@ func (client BdsClient) deleteBdsMetastoreConfiguration(ctx context.Context, req return response, err } +// DeleteNodeBackup Delete the NodeBackup represented by the provided ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/DeleteNodeBackup.go.html to see an example of how to use DeleteNodeBackup API. +func (client BdsClient) DeleteNodeBackup(ctx context.Context, request DeleteNodeBackupRequest) (response DeleteNodeBackupResponse, 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.deleteNodeBackup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteNodeBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteNodeBackupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteNodeBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteNodeBackupResponse") + } + return +} + +// deleteNodeBackup implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) deleteNodeBackup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/bdsInstances/{bdsInstanceId}/nodeBackups/{nodeBackupId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteNodeBackupResponse + 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/bigdata/20190531/NodeBackup/DeleteNodeBackup" + err = common.PostProcessServiceError(err, "Bds", "DeleteNodeBackup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteNodeBackupConfiguration Delete the NodeBackupConfiguration represented by the provided ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/DeleteNodeBackupConfiguration.go.html to see an example of how to use DeleteNodeBackupConfiguration API. +func (client BdsClient) DeleteNodeBackupConfiguration(ctx context.Context, request DeleteNodeBackupConfigurationRequest) (response DeleteNodeBackupConfigurationResponse, 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.deleteNodeBackupConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteNodeBackupConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteNodeBackupConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteNodeBackupConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteNodeBackupConfigurationResponse") + } + return +} + +// deleteNodeBackupConfiguration implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) deleteNodeBackupConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/bdsInstances/{bdsInstanceId}/nodeBackupConfigurations/{nodeBackupConfigurationId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteNodeBackupConfigurationResponse + 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/bigdata/20190531/NodeBackupConfiguration/DeleteNodeBackupConfiguration" + err = common.PostProcessServiceError(err, "Bds", "DeleteNodeBackupConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DisableCertificate Disabling TLS/SSL for various ODH services running on the BDS cluster. // // # See also @@ -1544,12 +1844,12 @@ func (client BdsClient) getBdsMetastoreConfiguration(ctx context.Context, reques return response, err } -// GetOsPatchDetails Get the details of an os patch +// GetNodeBackup Returns details of NodeBackup identified by the given ID. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/GetOsPatchDetails.go.html to see an example of how to use GetOsPatchDetails API. -func (client BdsClient) GetOsPatchDetails(ctx context.Context, request GetOsPatchDetailsRequest) (response GetOsPatchDetailsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/GetNodeBackup.go.html to see an example of how to use GetNodeBackup API. +func (client BdsClient) GetNodeBackup(ctx context.Context, request GetNodeBackupRequest) (response GetNodeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -1558,47 +1858,42 @@ func (client BdsClient) GetOsPatchDetails(ctx context.Context, request GetOsPatc if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - - if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { - request.OpcRetryToken = common.String(common.RetryToken()) - } - - ociResponse, err = common.Retry(ctx, request, client.getOsPatchDetails, policy) + ociResponse, err = common.Retry(ctx, request, client.getNodeBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetOsPatchDetailsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetNodeBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetOsPatchDetailsResponse{} + response = GetNodeBackupResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetOsPatchDetailsResponse); ok { + if convertedResponse, ok := ociResponse.(GetNodeBackupResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetOsPatchDetailsResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetNodeBackupResponse") } return } -// getOsPatchDetails implements the OCIOperation interface (enables retrying operations) -func (client BdsClient) getOsPatchDetails(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getNodeBackup implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) getNodeBackup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/bdsInstances/{bdsInstanceId}/actions/getOsPatch", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/nodeBackups/{nodeBackupId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetOsPatchDetailsResponse + var response GetNodeBackupResponse 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/bigdata/20190531/BdsInstance/GetOsPatchDetails" - err = common.PostProcessServiceError(err, "Bds", "GetOsPatchDetails", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/bigdata/20190531/BdsInstance/GetNodeBackup" + err = common.PostProcessServiceError(err, "Bds", "GetNodeBackup", apiReferenceLink) return response, err } @@ -1606,12 +1901,12 @@ func (client BdsClient) getOsPatchDetails(ctx context.Context, request common.OC return response, err } -// GetWorkRequest Returns the status of the work request identified by the given ID. +// GetNodeBackupConfiguration Returns details of the NodeBackupConfiguration identified by the given ID. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. -func (client BdsClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/GetNodeBackupConfiguration.go.html to see an example of how to use GetNodeBackupConfiguration API. +func (client BdsClient) GetNodeBackupConfiguration(ctx context.Context, request GetNodeBackupConfigurationRequest) (response GetNodeBackupConfigurationResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -1620,19 +1915,195 @@ func (client BdsClient) GetWorkRequest(ctx context.Context, request GetWorkReque if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + ociResponse, err = common.Retry(ctx, request, client.getNodeBackupConfiguration, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetNodeBackupConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetWorkRequestResponse{} + response = GetNodeBackupConfigurationResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + if convertedResponse, ok := ociResponse.(GetNodeBackupConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNodeBackupConfigurationResponse") + } + return +} + +// getNodeBackupConfiguration implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) getNodeBackupConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/nodeBackupConfigurations/{nodeBackupConfigurationId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetNodeBackupConfigurationResponse + 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/bigdata/20190531/BdsInstance/GetNodeBackupConfiguration" + err = common.PostProcessServiceError(err, "Bds", "GetNodeBackupConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetNodeReplaceConfiguration Returns details of the nodeReplaceConfiguration identified by the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/GetNodeReplaceConfiguration.go.html to see an example of how to use GetNodeReplaceConfiguration API. +func (client BdsClient) GetNodeReplaceConfiguration(ctx context.Context, request GetNodeReplaceConfigurationRequest) (response GetNodeReplaceConfigurationResponse, 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.getNodeReplaceConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetNodeReplaceConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetNodeReplaceConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetNodeReplaceConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNodeReplaceConfigurationResponse") + } + return +} + +// getNodeReplaceConfiguration implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) getNodeReplaceConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/nodeReplaceConfigurations/{nodeReplaceConfigurationId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetNodeReplaceConfigurationResponse + 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/bigdata/20190531/BdsInstance/GetNodeReplaceConfiguration" + err = common.PostProcessServiceError(err, "Bds", "GetNodeReplaceConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetOsPatchDetails Get the details of an os patch +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/GetOsPatchDetails.go.html to see an example of how to use GetOsPatchDetails API. +func (client BdsClient) GetOsPatchDetails(ctx context.Context, request GetOsPatchDetailsRequest) (response GetOsPatchDetailsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.getOsPatchDetails, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetOsPatchDetailsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetOsPatchDetailsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetOsPatchDetailsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetOsPatchDetailsResponse") + } + return +} + +// getOsPatchDetails implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) getOsPatchDetails(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/bdsInstances/{bdsInstanceId}/actions/getOsPatch", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetOsPatchDetailsResponse + 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/bigdata/20190531/BdsInstance/GetOsPatchDetails" + err = common.PostProcessServiceError(err, "Bds", "GetOsPatchDetails", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Returns the status of the work request identified by the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +func (client BdsClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, 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.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") @@ -1801,42 +2272,213 @@ func (client BdsClient) ListAutoScalingConfigurations(ctx context.Context, reque if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listAutoScalingConfigurations, policy) + ociResponse, err = common.Retry(ctx, request, client.listAutoScalingConfigurations, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListAutoScalingConfigurationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListAutoScalingConfigurationsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListAutoScalingConfigurationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAutoScalingConfigurationsResponse") + } + return +} + +// listAutoScalingConfigurations implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) listAutoScalingConfigurations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/autoScalingConfiguration", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListAutoScalingConfigurationsResponse + 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/bigdata/20190531/BdsInstance/ListAutoScalingConfigurations" + err = common.PostProcessServiceError(err, "Bds", "ListAutoScalingConfigurations", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListBdsApiKeys Returns a list of all API keys associated with this Big Data Service cluster. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListBdsApiKeys.go.html to see an example of how to use ListBdsApiKeys API. +func (client BdsClient) ListBdsApiKeys(ctx context.Context, request ListBdsApiKeysRequest) (response ListBdsApiKeysResponse, 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.listBdsApiKeys, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListBdsApiKeysResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListBdsApiKeysResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListBdsApiKeysResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListBdsApiKeysResponse") + } + return +} + +// listBdsApiKeys implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) listBdsApiKeys(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/apiKeys", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListBdsApiKeysResponse + 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/bigdata/20190531/BdsApiKey/ListBdsApiKeys" + err = common.PostProcessServiceError(err, "Bds", "ListBdsApiKeys", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListBdsInstances Returns a list of all Big Data Service clusters in a compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListBdsInstances.go.html to see an example of how to use ListBdsInstances API. +func (client BdsClient) ListBdsInstances(ctx context.Context, request ListBdsInstancesRequest) (response ListBdsInstancesResponse, 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.listBdsInstances, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListBdsInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListBdsInstancesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListBdsInstancesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListBdsInstancesResponse") + } + return +} + +// listBdsInstances implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) listBdsInstances(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListBdsInstancesResponse + 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/bigdata/20190531/BdsInstanceSummary/ListBdsInstances" + err = common.PostProcessServiceError(err, "Bds", "ListBdsInstances", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListBdsMetastoreConfigurations Returns a list of metastore configurations ssociated with this Big Data Service cluster. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListBdsMetastoreConfigurations.go.html to see an example of how to use ListBdsMetastoreConfigurations API. +func (client BdsClient) ListBdsMetastoreConfigurations(ctx context.Context, request ListBdsMetastoreConfigurationsRequest) (response ListBdsMetastoreConfigurationsResponse, 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.listBdsMetastoreConfigurations, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListAutoScalingConfigurationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListBdsMetastoreConfigurationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListAutoScalingConfigurationsResponse{} + response = ListBdsMetastoreConfigurationsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListAutoScalingConfigurationsResponse); ok { + if convertedResponse, ok := ociResponse.(ListBdsMetastoreConfigurationsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListAutoScalingConfigurationsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListBdsMetastoreConfigurationsResponse") } return } -// listAutoScalingConfigurations implements the OCIOperation interface (enables retrying operations) -func (client BdsClient) listAutoScalingConfigurations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listBdsMetastoreConfigurations implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) listBdsMetastoreConfigurations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/autoScalingConfiguration", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/metastoreConfigs", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListAutoScalingConfigurationsResponse + var response ListBdsMetastoreConfigurationsResponse 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/bigdata/20190531/BdsInstance/ListAutoScalingConfigurations" - err = common.PostProcessServiceError(err, "Bds", "ListAutoScalingConfigurations", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/bigdata/20190531/BdsMetastoreConfiguration/ListBdsMetastoreConfigurations" + err = common.PostProcessServiceError(err, "Bds", "ListBdsMetastoreConfigurations", apiReferenceLink) return response, err } @@ -1844,12 +2486,12 @@ func (client BdsClient) listAutoScalingConfigurations(ctx context.Context, reque return response, err } -// ListBdsApiKeys Returns a list of all API keys associated with this Big Data Service cluster. +// ListNodeBackupConfigurations Returns information about the NodeBackupConfigurations. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListBdsApiKeys.go.html to see an example of how to use ListBdsApiKeys API. -func (client BdsClient) ListBdsApiKeys(ctx context.Context, request ListBdsApiKeysRequest) (response ListBdsApiKeysResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListNodeBackupConfigurations.go.html to see an example of how to use ListNodeBackupConfigurations API. +func (client BdsClient) ListNodeBackupConfigurations(ctx context.Context, request ListNodeBackupConfigurationsRequest) (response ListNodeBackupConfigurationsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -1858,42 +2500,42 @@ func (client BdsClient) ListBdsApiKeys(ctx context.Context, request ListBdsApiKe if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listBdsApiKeys, policy) + ociResponse, err = common.Retry(ctx, request, client.listNodeBackupConfigurations, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListBdsApiKeysResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListNodeBackupConfigurationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListBdsApiKeysResponse{} + response = ListNodeBackupConfigurationsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListBdsApiKeysResponse); ok { + if convertedResponse, ok := ociResponse.(ListNodeBackupConfigurationsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListBdsApiKeysResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListNodeBackupConfigurationsResponse") } return } -// listBdsApiKeys implements the OCIOperation interface (enables retrying operations) -func (client BdsClient) listBdsApiKeys(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listNodeBackupConfigurations implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) listNodeBackupConfigurations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/apiKeys", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/nodeBackupConfigurations", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListBdsApiKeysResponse + var response ListNodeBackupConfigurationsResponse 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/bigdata/20190531/BdsApiKey/ListBdsApiKeys" - err = common.PostProcessServiceError(err, "Bds", "ListBdsApiKeys", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/bigdata/20190531/BdsInstance/ListNodeBackupConfigurations" + err = common.PostProcessServiceError(err, "Bds", "ListNodeBackupConfigurations", apiReferenceLink) return response, err } @@ -1901,12 +2543,12 @@ func (client BdsClient) listBdsApiKeys(ctx context.Context, request common.OCIRe return response, err } -// ListBdsInstances Returns a list of all Big Data Service clusters in a compartment. +// ListNodeBackups Returns information about the node Backups. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListBdsInstances.go.html to see an example of how to use ListBdsInstances API. -func (client BdsClient) ListBdsInstances(ctx context.Context, request ListBdsInstancesRequest) (response ListBdsInstancesResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListNodeBackups.go.html to see an example of how to use ListNodeBackups API. +func (client BdsClient) ListNodeBackups(ctx context.Context, request ListNodeBackupsRequest) (response ListNodeBackupsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -1915,42 +2557,42 @@ func (client BdsClient) ListBdsInstances(ctx context.Context, request ListBdsIns if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listBdsInstances, policy) + ociResponse, err = common.Retry(ctx, request, client.listNodeBackups, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListBdsInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListNodeBackupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListBdsInstancesResponse{} + response = ListNodeBackupsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListBdsInstancesResponse); ok { + if convertedResponse, ok := ociResponse.(ListNodeBackupsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListBdsInstancesResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListNodeBackupsResponse") } return } -// listBdsInstances implements the OCIOperation interface (enables retrying operations) -func (client BdsClient) listBdsInstances(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listNodeBackups implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) listNodeBackups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/nodeBackups", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListBdsInstancesResponse + var response ListNodeBackupsResponse 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/bigdata/20190531/BdsInstanceSummary/ListBdsInstances" - err = common.PostProcessServiceError(err, "Bds", "ListBdsInstances", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/bigdata/20190531/BdsInstance/ListNodeBackups" + err = common.PostProcessServiceError(err, "Bds", "ListNodeBackups", apiReferenceLink) return response, err } @@ -1958,12 +2600,12 @@ func (client BdsClient) listBdsInstances(ctx context.Context, request common.OCI return response, err } -// ListBdsMetastoreConfigurations Returns a list of metastore configurations ssociated with this Big Data Service cluster. +// ListNodeReplaceConfigurations Returns information about the NodeReplaceConfiguration. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListBdsMetastoreConfigurations.go.html to see an example of how to use ListBdsMetastoreConfigurations API. -func (client BdsClient) ListBdsMetastoreConfigurations(ctx context.Context, request ListBdsMetastoreConfigurationsRequest) (response ListBdsMetastoreConfigurationsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListNodeReplaceConfigurations.go.html to see an example of how to use ListNodeReplaceConfigurations API. +func (client BdsClient) ListNodeReplaceConfigurations(ctx context.Context, request ListNodeReplaceConfigurationsRequest) (response ListNodeReplaceConfigurationsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -1972,42 +2614,42 @@ func (client BdsClient) ListBdsMetastoreConfigurations(ctx context.Context, requ if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listBdsMetastoreConfigurations, policy) + ociResponse, err = common.Retry(ctx, request, client.listNodeReplaceConfigurations, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListBdsMetastoreConfigurationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListNodeReplaceConfigurationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListBdsMetastoreConfigurationsResponse{} + response = ListNodeReplaceConfigurationsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListBdsMetastoreConfigurationsResponse); ok { + if convertedResponse, ok := ociResponse.(ListNodeReplaceConfigurationsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListBdsMetastoreConfigurationsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListNodeReplaceConfigurationsResponse") } return } -// listBdsMetastoreConfigurations implements the OCIOperation interface (enables retrying operations) -func (client BdsClient) listBdsMetastoreConfigurations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listNodeReplaceConfigurations implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) listNodeReplaceConfigurations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/metastoreConfigs", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/bdsInstances/{bdsInstanceId}/nodeReplaceConfigurations", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListBdsMetastoreConfigurationsResponse + var response ListNodeReplaceConfigurationsResponse 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/bigdata/20190531/BdsMetastoreConfiguration/ListBdsMetastoreConfigurations" - err = common.PostProcessServiceError(err, "Bds", "ListBdsMetastoreConfigurations", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/bigdata/20190531/BdsInstance/ListNodeReplaceConfigurations" + err = common.PostProcessServiceError(err, "Bds", "ListNodeReplaceConfigurations", apiReferenceLink) return response, err } @@ -2605,6 +3247,68 @@ func (client BdsClient) removeNode(ctx context.Context, request common.OCIReques return response, err } +// RemoveNodeReplaceConfiguration Deletes a nodeReplaceConfiguration +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/RemoveNodeReplaceConfiguration.go.html to see an example of how to use RemoveNodeReplaceConfiguration API. +func (client BdsClient) RemoveNodeReplaceConfiguration(ctx context.Context, request RemoveNodeReplaceConfigurationRequest) (response RemoveNodeReplaceConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.removeNodeReplaceConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveNodeReplaceConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveNodeReplaceConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveNodeReplaceConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveNodeReplaceConfigurationResponse") + } + return +} + +// removeNodeReplaceConfiguration implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) removeNodeReplaceConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/bdsInstances/{bdsInstanceId}/nodeReplaceConfigurations/{nodeReplaceConfigurationId}/actions/remove", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveNodeReplaceConfigurationResponse + 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/bigdata/20190531/NodeReplaceConfiguration/RemoveNodeReplaceConfiguration" + err = common.PostProcessServiceError(err, "Bds", "RemoveNodeReplaceConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // RenewCertificate Renewing TLS/SSL for various ODH services running on the BDS cluster. // // # See also @@ -2667,6 +3371,68 @@ func (client BdsClient) renewCertificate(ctx context.Context, request common.OCI return response, err } +// ReplaceNode Replaces a node of a Big Data Service cluster from backup. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ReplaceNode.go.html to see an example of how to use ReplaceNode API. +func (client BdsClient) ReplaceNode(ctx context.Context, request ReplaceNodeRequest) (response ReplaceNodeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.replaceNode, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ReplaceNodeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ReplaceNodeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ReplaceNodeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ReplaceNodeResponse") + } + return +} + +// replaceNode implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) replaceNode(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/bdsInstances/{bdsInstanceId}/actions/replaceNode", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ReplaceNodeResponse + 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/bigdata/20190531/BdsInstance/ReplaceNode" + err = common.PostProcessServiceError(err, "Bds", "ReplaceNode", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // RestartNode Restarts a single node of a Big Data Service cluster // // # See also @@ -3132,3 +3898,127 @@ func (client BdsClient) updateBdsMetastoreConfiguration(ctx context.Context, req err = common.UnmarshalResponse(httpResponse, &response) return response, err } + +// UpdateNodeBackupConfiguration Updates fields on NodeBackupConfiguration, including the name, the schedule. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/UpdateNodeBackupConfiguration.go.html to see an example of how to use UpdateNodeBackupConfiguration API. +func (client BdsClient) UpdateNodeBackupConfiguration(ctx context.Context, request UpdateNodeBackupConfigurationRequest) (response UpdateNodeBackupConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateNodeBackupConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateNodeBackupConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateNodeBackupConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateNodeBackupConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateNodeBackupConfigurationResponse") + } + return +} + +// updateNodeBackupConfiguration implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) updateNodeBackupConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/bdsInstances/{bdsInstanceId}/nodeBackupConfigurations/{nodeBackupConfigurationId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateNodeBackupConfigurationResponse + 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/bigdata/20190531/BdsInstance/UpdateNodeBackupConfiguration" + err = common.PostProcessServiceError(err, "Bds", "UpdateNodeBackupConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateNodeReplaceConfiguration Updates fields on nodeReplaceConfigurations, including the name, the schedule +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/UpdateNodeReplaceConfiguration.go.html to see an example of how to use UpdateNodeReplaceConfiguration API. +func (client BdsClient) UpdateNodeReplaceConfiguration(ctx context.Context, request UpdateNodeReplaceConfigurationRequest) (response UpdateNodeReplaceConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateNodeReplaceConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateNodeReplaceConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateNodeReplaceConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateNodeReplaceConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateNodeReplaceConfigurationResponse") + } + return +} + +// updateNodeReplaceConfiguration implements the OCIOperation interface (enables retrying operations) +func (client BdsClient) updateNodeReplaceConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/bdsInstances/{bdsInstanceId}/nodeReplaceConfigurations/{nodeReplaceConfigurationId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateNodeReplaceConfigurationResponse + 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/bigdata/20190531/BdsInstance/UpdateNodeReplaceConfiguration" + err = common.PostProcessServiceError(err, "Bds", "UpdateNodeReplaceConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/bds/create_node_backup_configuration_details.go b/bds/create_node_backup_configuration_details.go new file mode 100644 index 0000000000..90827908f9 --- /dev/null +++ b/bds/create_node_backup_configuration_details.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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateNodeBackupConfigurationDetails The information about the NodeBackupConfiguration. +type CreateNodeBackupConfigurationDetails struct { + LevelTypeDetails LevelTypeDetails `mandatory:"true" json:"levelTypeDetails"` + + // Day/time recurrence (specified following RFC 5545) at which to trigger the backup process. Currently only DAILY, WEEKLY and MONTHLY frequency is supported. Days of the week are specified using BYDAY field. Time of the day is specified using BYHOUR. Other fields are not supported. + Schedule *string `mandatory:"true" json:"schedule"` + + // A user-friendly name. Only ASCII alphanumeric characters with no spaces allowed. The name does not have to be unique, and it may be changed. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The time zone of the execution schedule, in IANA time zone database name format + Timezone *string `mandatory:"false" json:"timezone"` + + // Number of backup copies to retain. + NumberOfBackupsToRetain *int `mandatory:"false" json:"numberOfBackupsToRetain"` + + // Incremental backup type includes only the changes since the last backup. Full backup type includes all changes since the volume was created. + BackupType NodeBackupBackupTypeEnum `mandatory:"false" json:"backupType,omitempty"` +} + +func (m CreateNodeBackupConfigurationDetails) 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 CreateNodeBackupConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingNodeBackupBackupTypeEnum(string(m.BackupType)); !ok && m.BackupType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackupType: %s. Supported values are: %s.", m.BackupType, strings.Join(GetNodeBackupBackupTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *CreateNodeBackupConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Timezone *string `json:"timezone"` + NumberOfBackupsToRetain *int `json:"numberOfBackupsToRetain"` + BackupType NodeBackupBackupTypeEnum `json:"backupType"` + LevelTypeDetails leveltypedetails `json:"levelTypeDetails"` + Schedule *string `json:"schedule"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Timezone = model.Timezone + + m.NumberOfBackupsToRetain = model.NumberOfBackupsToRetain + + m.BackupType = model.BackupType + + nn, e = model.LevelTypeDetails.UnmarshalPolymorphicJSON(model.LevelTypeDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.LevelTypeDetails = nn.(LevelTypeDetails) + } else { + m.LevelTypeDetails = nil + } + + m.Schedule = model.Schedule + + return +} diff --git a/bds/create_node_backup_configuration_request_response.go b/bds/create_node_backup_configuration_request_response.go new file mode 100644 index 0000000000..419b563d65 --- /dev/null +++ b/bds/create_node_backup_configuration_request_response.go @@ -0,0 +1,100 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateNodeBackupConfigurationRequest wrapper for the CreateNodeBackupConfiguration operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/CreateNodeBackupConfiguration.go.html to see an example of how to use CreateNodeBackupConfigurationRequest. +type CreateNodeBackupConfigurationRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Details for adding nodeBackupConfiguration to the BDS cluster. + CreateNodeBackupConfigurationDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error, without risk of executing that same action again. Retry tokens expire after 24 + // hours but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 CreateNodeBackupConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateNodeBackupConfigurationRequest) 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 CreateNodeBackupConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateNodeBackupConfigurationRequest) 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 CreateNodeBackupConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateNodeBackupConfigurationResponse wrapper for the CreateNodeBackupConfiguration operation +type CreateNodeBackupConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response CreateNodeBackupConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateNodeBackupConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/create_node_replace_configuration_details.go b/bds/create_node_replace_configuration_details.go new file mode 100644 index 0000000000..aeeaa9e6d1 --- /dev/null +++ b/bds/create_node_replace_configuration_details.go @@ -0,0 +1,89 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateNodeReplaceConfigurationDetails The information about the NodeReplaceConfiguration +type CreateNodeReplaceConfigurationDetails struct { + LevelTypeDetails LevelTypeDetails `mandatory:"true" json:"levelTypeDetails"` + + // Base-64 encoded password for the cluster admin user. + ClusterAdminPassword *string `mandatory:"true" json:"clusterAdminPassword"` + + // Type of compute instance health metric to use for node replacement + MetricType NodeReplaceConfigurationMetricTypeEnum `mandatory:"true" json:"metricType"` + + // This value is the minimum period of time to wait before triggering node replacement. The value is in minutes. + DurationInMinutes *int `mandatory:"true" json:"durationInMinutes"` + + // A user-friendly name. Only ASCII alphanumeric characters with no spaces allowed. The name does not have to be unique, and it may be changed. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m CreateNodeReplaceConfigurationDetails) 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 CreateNodeReplaceConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNodeReplaceConfigurationMetricTypeEnum(string(m.MetricType)); !ok && m.MetricType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for MetricType: %s. Supported values are: %s.", m.MetricType, strings.Join(GetNodeReplaceConfigurationMetricTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *CreateNodeReplaceConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + LevelTypeDetails leveltypedetails `json:"levelTypeDetails"` + ClusterAdminPassword *string `json:"clusterAdminPassword"` + MetricType NodeReplaceConfigurationMetricTypeEnum `json:"metricType"` + DurationInMinutes *int `json:"durationInMinutes"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + nn, e = model.LevelTypeDetails.UnmarshalPolymorphicJSON(model.LevelTypeDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.LevelTypeDetails = nn.(LevelTypeDetails) + } else { + m.LevelTypeDetails = nil + } + + m.ClusterAdminPassword = model.ClusterAdminPassword + + m.MetricType = model.MetricType + + m.DurationInMinutes = model.DurationInMinutes + + return +} diff --git a/bds/create_node_replace_configuration_request_response.go b/bds/create_node_replace_configuration_request_response.go new file mode 100644 index 0000000000..2be1f78323 --- /dev/null +++ b/bds/create_node_replace_configuration_request_response.go @@ -0,0 +1,100 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateNodeReplaceConfigurationRequest wrapper for the CreateNodeReplaceConfiguration operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/CreateNodeReplaceConfiguration.go.html to see an example of how to use CreateNodeReplaceConfigurationRequest. +type CreateNodeReplaceConfigurationRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Details for adding nodeReplaceConfiguration to the BDS cluster. + CreateNodeReplaceConfigurationDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error, without risk of executing that same action again. Retry tokens expire after 24 + // hours but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 CreateNodeReplaceConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateNodeReplaceConfigurationRequest) 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 CreateNodeReplaceConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateNodeReplaceConfigurationRequest) 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 CreateNodeReplaceConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateNodeReplaceConfigurationResponse wrapper for the CreateNodeReplaceConfiguration operation +type CreateNodeReplaceConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response CreateNodeReplaceConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateNodeReplaceConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/delete_node_backup_configuration_request_response.go b/bds/delete_node_backup_configuration_request_response.go new file mode 100644 index 0000000000..54c24015ef --- /dev/null +++ b/bds/delete_node_backup_configuration_request_response.go @@ -0,0 +1,100 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteNodeBackupConfigurationRequest wrapper for the DeleteNodeBackupConfiguration operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/DeleteNodeBackupConfiguration.go.html to see an example of how to use DeleteNodeBackupConfigurationRequest. +type DeleteNodeBackupConfigurationRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Unique Oracle-assigned identifier of the NodeBackupConfiguration. + NodeBackupConfigurationId *string `mandatory:"true" contributesTo:"path" name:"nodeBackupConfigurationId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // 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 DeleteNodeBackupConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteNodeBackupConfigurationRequest) 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 DeleteNodeBackupConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteNodeBackupConfigurationRequest) 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 DeleteNodeBackupConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteNodeBackupConfigurationResponse wrapper for the DeleteNodeBackupConfiguration operation +type DeleteNodeBackupConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response DeleteNodeBackupConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteNodeBackupConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/delete_node_backup_request_response.go b/bds/delete_node_backup_request_response.go new file mode 100644 index 0000000000..2cd84ab093 --- /dev/null +++ b/bds/delete_node_backup_request_response.go @@ -0,0 +1,100 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteNodeBackupRequest wrapper for the DeleteNodeBackup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/DeleteNodeBackup.go.html to see an example of how to use DeleteNodeBackupRequest. +type DeleteNodeBackupRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Unique assigned identifier of the nodeBackupId. + NodeBackupId *string `mandatory:"true" contributesTo:"path" name:"nodeBackupId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // 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 DeleteNodeBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteNodeBackupRequest) 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 DeleteNodeBackupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteNodeBackupRequest) 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 DeleteNodeBackupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteNodeBackupResponse wrapper for the DeleteNodeBackup operation +type DeleteNodeBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response DeleteNodeBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteNodeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/get_node_backup_configuration_request_response.go b/bds/get_node_backup_configuration_request_response.go new file mode 100644 index 0000000000..e081defd5b --- /dev/null +++ b/bds/get_node_backup_configuration_request_response.go @@ -0,0 +1,96 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetNodeBackupConfigurationRequest wrapper for the GetNodeBackupConfiguration operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/GetNodeBackupConfiguration.go.html to see an example of how to use GetNodeBackupConfigurationRequest. +type GetNodeBackupConfigurationRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Unique Oracle-assigned identifier of the NodeBackupConfiguration. + NodeBackupConfigurationId *string `mandatory:"true" contributesTo:"path" name:"nodeBackupConfigurationId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetNodeBackupConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetNodeBackupConfigurationRequest) 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 GetNodeBackupConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetNodeBackupConfigurationRequest) 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 GetNodeBackupConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetNodeBackupConfigurationResponse wrapper for the GetNodeBackupConfiguration operation +type GetNodeBackupConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NodeBackupConfiguration instance + NodeBackupConfiguration `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetNodeBackupConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetNodeBackupConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/get_node_backup_request_response.go b/bds/get_node_backup_request_response.go new file mode 100644 index 0000000000..fb911e62a5 --- /dev/null +++ b/bds/get_node_backup_request_response.go @@ -0,0 +1,96 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetNodeBackupRequest wrapper for the GetNodeBackup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/GetNodeBackup.go.html to see an example of how to use GetNodeBackupRequest. +type GetNodeBackupRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Unique assigned identifier of the nodeBackupId. + NodeBackupId *string `mandatory:"true" contributesTo:"path" name:"nodeBackupId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetNodeBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetNodeBackupRequest) 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 GetNodeBackupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetNodeBackupRequest) 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 GetNodeBackupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetNodeBackupResponse wrapper for the GetNodeBackup operation +type GetNodeBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NodeBackup instance + NodeBackup `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetNodeBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetNodeBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/get_node_replace_configuration_request_response.go b/bds/get_node_replace_configuration_request_response.go new file mode 100644 index 0000000000..3478ea49df --- /dev/null +++ b/bds/get_node_replace_configuration_request_response.go @@ -0,0 +1,96 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetNodeReplaceConfigurationRequest wrapper for the GetNodeReplaceConfiguration operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/GetNodeReplaceConfiguration.go.html to see an example of how to use GetNodeReplaceConfigurationRequest. +type GetNodeReplaceConfigurationRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Unique Oracle-assigned identifier of the NodeReplaceConfiguration. + NodeReplaceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"nodeReplaceConfigurationId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetNodeReplaceConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetNodeReplaceConfigurationRequest) 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 GetNodeReplaceConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetNodeReplaceConfigurationRequest) 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 GetNodeReplaceConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetNodeReplaceConfigurationResponse wrapper for the GetNodeReplaceConfiguration operation +type GetNodeReplaceConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NodeReplaceConfiguration instance + NodeReplaceConfiguration `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetNodeReplaceConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetNodeReplaceConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/level_type_details.go b/bds/level_type_details.go new file mode 100644 index 0000000000..371fab07a0 --- /dev/null +++ b/bds/level_type_details.go @@ -0,0 +1,123 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LevelTypeDetails Details of the type of level used to trigger the creation of a new node backup configuration or node replacement configuration. +type LevelTypeDetails interface { +} + +type leveltypedetails struct { + JsonData []byte + LevelType string `json:"levelType"` +} + +// UnmarshalJSON unmarshals json +func (m *leveltypedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerleveltypedetails leveltypedetails + s := struct { + Model Unmarshalerleveltypedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.LevelType = s.Model.LevelType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *leveltypedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.LevelType { + case "NODE_TYPE_LEVEL": + mm := NodeTypeLevelDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NODE_LEVEL": + mm := NodeLevelDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for LevelTypeDetails: %s.", m.LevelType) + return *m, nil + } +} + +func (m leveltypedetails) 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 leveltypedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// LevelTypeDetailsLevelTypeEnum Enum with underlying type: string +type LevelTypeDetailsLevelTypeEnum string + +// Set of constants representing the allowable values for LevelTypeDetailsLevelTypeEnum +const ( + LevelTypeDetailsLevelTypeLevel LevelTypeDetailsLevelTypeEnum = "NODE_LEVEL" + LevelTypeDetailsLevelTypeTypeLevel LevelTypeDetailsLevelTypeEnum = "NODE_TYPE_LEVEL" +) + +var mappingLevelTypeDetailsLevelTypeEnum = map[string]LevelTypeDetailsLevelTypeEnum{ + "NODE_LEVEL": LevelTypeDetailsLevelTypeLevel, + "NODE_TYPE_LEVEL": LevelTypeDetailsLevelTypeTypeLevel, +} + +var mappingLevelTypeDetailsLevelTypeEnumLowerCase = map[string]LevelTypeDetailsLevelTypeEnum{ + "node_level": LevelTypeDetailsLevelTypeLevel, + "node_type_level": LevelTypeDetailsLevelTypeTypeLevel, +} + +// GetLevelTypeDetailsLevelTypeEnumValues Enumerates the set of values for LevelTypeDetailsLevelTypeEnum +func GetLevelTypeDetailsLevelTypeEnumValues() []LevelTypeDetailsLevelTypeEnum { + values := make([]LevelTypeDetailsLevelTypeEnum, 0) + for _, v := range mappingLevelTypeDetailsLevelTypeEnum { + values = append(values, v) + } + return values +} + +// GetLevelTypeDetailsLevelTypeEnumStringValues Enumerates the set of values in String for LevelTypeDetailsLevelTypeEnum +func GetLevelTypeDetailsLevelTypeEnumStringValues() []string { + return []string{ + "NODE_LEVEL", + "NODE_TYPE_LEVEL", + } +} + +// GetMappingLevelTypeDetailsLevelTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingLevelTypeDetailsLevelTypeEnum(val string) (LevelTypeDetailsLevelTypeEnum, bool) { + enum, ok := mappingLevelTypeDetailsLevelTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/bds/list_node_backup_configurations_request_response.go b/bds/list_node_backup_configurations_request_response.go new file mode 100644 index 0000000000..3758409a06 --- /dev/null +++ b/bds/list_node_backup_configurations_request_response.go @@ -0,0 +1,206 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListNodeBackupConfigurationsRequest wrapper for the ListNodeBackupConfigurations operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListNodeBackupConfigurations.go.html to see an example of how to use ListNodeBackupConfigurationsRequest. +type ListNodeBackupConfigurationsRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. + SortBy ListNodeBackupConfigurationsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListNodeBackupConfigurationsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The state of the NodeBackupConfiguration configuration. + LifecycleState NodeBackupConfigurationLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 ListNodeBackupConfigurationsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListNodeBackupConfigurationsRequest) 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 ListNodeBackupConfigurationsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListNodeBackupConfigurationsRequest) 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 ListNodeBackupConfigurationsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListNodeBackupConfigurationsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListNodeBackupConfigurationsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListNodeBackupConfigurationsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListNodeBackupConfigurationsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingNodeBackupConfigurationLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetNodeBackupConfigurationLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListNodeBackupConfigurationsResponse wrapper for the ListNodeBackupConfigurations operation +type ListNodeBackupConfigurationsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []NodeBackupConfigurationSummary instances + Items []NodeBackupConfigurationSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListNodeBackupConfigurationsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListNodeBackupConfigurationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListNodeBackupConfigurationsSortByEnum Enum with underlying type: string +type ListNodeBackupConfigurationsSortByEnum string + +// Set of constants representing the allowable values for ListNodeBackupConfigurationsSortByEnum +const ( + ListNodeBackupConfigurationsSortByTimecreated ListNodeBackupConfigurationsSortByEnum = "timeCreated" + ListNodeBackupConfigurationsSortByDisplayname ListNodeBackupConfigurationsSortByEnum = "displayName" +) + +var mappingListNodeBackupConfigurationsSortByEnum = map[string]ListNodeBackupConfigurationsSortByEnum{ + "timeCreated": ListNodeBackupConfigurationsSortByTimecreated, + "displayName": ListNodeBackupConfigurationsSortByDisplayname, +} + +var mappingListNodeBackupConfigurationsSortByEnumLowerCase = map[string]ListNodeBackupConfigurationsSortByEnum{ + "timecreated": ListNodeBackupConfigurationsSortByTimecreated, + "displayname": ListNodeBackupConfigurationsSortByDisplayname, +} + +// GetListNodeBackupConfigurationsSortByEnumValues Enumerates the set of values for ListNodeBackupConfigurationsSortByEnum +func GetListNodeBackupConfigurationsSortByEnumValues() []ListNodeBackupConfigurationsSortByEnum { + values := make([]ListNodeBackupConfigurationsSortByEnum, 0) + for _, v := range mappingListNodeBackupConfigurationsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListNodeBackupConfigurationsSortByEnumStringValues Enumerates the set of values in String for ListNodeBackupConfigurationsSortByEnum +func GetListNodeBackupConfigurationsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListNodeBackupConfigurationsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNodeBackupConfigurationsSortByEnum(val string) (ListNodeBackupConfigurationsSortByEnum, bool) { + enum, ok := mappingListNodeBackupConfigurationsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListNodeBackupConfigurationsSortOrderEnum Enum with underlying type: string +type ListNodeBackupConfigurationsSortOrderEnum string + +// Set of constants representing the allowable values for ListNodeBackupConfigurationsSortOrderEnum +const ( + ListNodeBackupConfigurationsSortOrderAsc ListNodeBackupConfigurationsSortOrderEnum = "ASC" + ListNodeBackupConfigurationsSortOrderDesc ListNodeBackupConfigurationsSortOrderEnum = "DESC" +) + +var mappingListNodeBackupConfigurationsSortOrderEnum = map[string]ListNodeBackupConfigurationsSortOrderEnum{ + "ASC": ListNodeBackupConfigurationsSortOrderAsc, + "DESC": ListNodeBackupConfigurationsSortOrderDesc, +} + +var mappingListNodeBackupConfigurationsSortOrderEnumLowerCase = map[string]ListNodeBackupConfigurationsSortOrderEnum{ + "asc": ListNodeBackupConfigurationsSortOrderAsc, + "desc": ListNodeBackupConfigurationsSortOrderDesc, +} + +// GetListNodeBackupConfigurationsSortOrderEnumValues Enumerates the set of values for ListNodeBackupConfigurationsSortOrderEnum +func GetListNodeBackupConfigurationsSortOrderEnumValues() []ListNodeBackupConfigurationsSortOrderEnum { + values := make([]ListNodeBackupConfigurationsSortOrderEnum, 0) + for _, v := range mappingListNodeBackupConfigurationsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListNodeBackupConfigurationsSortOrderEnumStringValues Enumerates the set of values in String for ListNodeBackupConfigurationsSortOrderEnum +func GetListNodeBackupConfigurationsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListNodeBackupConfigurationsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNodeBackupConfigurationsSortOrderEnum(val string) (ListNodeBackupConfigurationsSortOrderEnum, bool) { + enum, ok := mappingListNodeBackupConfigurationsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/bds/list_node_backups_request_response.go b/bds/list_node_backups_request_response.go new file mode 100644 index 0000000000..b9f3a559a2 --- /dev/null +++ b/bds/list_node_backups_request_response.go @@ -0,0 +1,209 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListNodeBackupsRequest wrapper for the ListNodeBackups operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListNodeBackups.go.html to see an example of how to use ListNodeBackupsRequest. +type ListNodeBackupsRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. + SortBy ListNodeBackupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListNodeBackupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The node host name belonged to a node that has a node backup. + NodeHostName *string `mandatory:"false" contributesTo:"query" name:"nodeHostName"` + + // The state of the Node's Backup. + LifecycleState NodeBackupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The display name belonged to the node backup. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // 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 ListNodeBackupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListNodeBackupsRequest) 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 ListNodeBackupsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListNodeBackupsRequest) 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 ListNodeBackupsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListNodeBackupsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListNodeBackupsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListNodeBackupsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListNodeBackupsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingNodeBackupLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetNodeBackupLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListNodeBackupsResponse wrapper for the ListNodeBackups operation +type ListNodeBackupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []NodeBackupSummary instances + Items []NodeBackupSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListNodeBackupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListNodeBackupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListNodeBackupsSortByEnum Enum with underlying type: string +type ListNodeBackupsSortByEnum string + +// Set of constants representing the allowable values for ListNodeBackupsSortByEnum +const ( + ListNodeBackupsSortByTimecreated ListNodeBackupsSortByEnum = "timeCreated" + ListNodeBackupsSortByDisplayname ListNodeBackupsSortByEnum = "displayName" +) + +var mappingListNodeBackupsSortByEnum = map[string]ListNodeBackupsSortByEnum{ + "timeCreated": ListNodeBackupsSortByTimecreated, + "displayName": ListNodeBackupsSortByDisplayname, +} + +var mappingListNodeBackupsSortByEnumLowerCase = map[string]ListNodeBackupsSortByEnum{ + "timecreated": ListNodeBackupsSortByTimecreated, + "displayname": ListNodeBackupsSortByDisplayname, +} + +// GetListNodeBackupsSortByEnumValues Enumerates the set of values for ListNodeBackupsSortByEnum +func GetListNodeBackupsSortByEnumValues() []ListNodeBackupsSortByEnum { + values := make([]ListNodeBackupsSortByEnum, 0) + for _, v := range mappingListNodeBackupsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListNodeBackupsSortByEnumStringValues Enumerates the set of values in String for ListNodeBackupsSortByEnum +func GetListNodeBackupsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListNodeBackupsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNodeBackupsSortByEnum(val string) (ListNodeBackupsSortByEnum, bool) { + enum, ok := mappingListNodeBackupsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListNodeBackupsSortOrderEnum Enum with underlying type: string +type ListNodeBackupsSortOrderEnum string + +// Set of constants representing the allowable values for ListNodeBackupsSortOrderEnum +const ( + ListNodeBackupsSortOrderAsc ListNodeBackupsSortOrderEnum = "ASC" + ListNodeBackupsSortOrderDesc ListNodeBackupsSortOrderEnum = "DESC" +) + +var mappingListNodeBackupsSortOrderEnum = map[string]ListNodeBackupsSortOrderEnum{ + "ASC": ListNodeBackupsSortOrderAsc, + "DESC": ListNodeBackupsSortOrderDesc, +} + +var mappingListNodeBackupsSortOrderEnumLowerCase = map[string]ListNodeBackupsSortOrderEnum{ + "asc": ListNodeBackupsSortOrderAsc, + "desc": ListNodeBackupsSortOrderDesc, +} + +// GetListNodeBackupsSortOrderEnumValues Enumerates the set of values for ListNodeBackupsSortOrderEnum +func GetListNodeBackupsSortOrderEnumValues() []ListNodeBackupsSortOrderEnum { + values := make([]ListNodeBackupsSortOrderEnum, 0) + for _, v := range mappingListNodeBackupsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListNodeBackupsSortOrderEnumStringValues Enumerates the set of values in String for ListNodeBackupsSortOrderEnum +func GetListNodeBackupsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListNodeBackupsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNodeBackupsSortOrderEnum(val string) (ListNodeBackupsSortOrderEnum, bool) { + enum, ok := mappingListNodeBackupsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/bds/list_node_replace_configurations_request_response.go b/bds/list_node_replace_configurations_request_response.go new file mode 100644 index 0000000000..8d1709fc57 --- /dev/null +++ b/bds/list_node_replace_configurations_request_response.go @@ -0,0 +1,206 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListNodeReplaceConfigurationsRequest wrapper for the ListNodeReplaceConfigurations operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ListNodeReplaceConfigurations.go.html to see an example of how to use ListNodeReplaceConfigurationsRequest. +type ListNodeReplaceConfigurationsRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. + SortBy ListNodeReplaceConfigurationsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListNodeReplaceConfigurationsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The state of the NodeReplaceConfiguration. + LifecycleState NodeReplaceConfigurationLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 ListNodeReplaceConfigurationsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListNodeReplaceConfigurationsRequest) 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 ListNodeReplaceConfigurationsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListNodeReplaceConfigurationsRequest) 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 ListNodeReplaceConfigurationsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListNodeReplaceConfigurationsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListNodeReplaceConfigurationsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListNodeReplaceConfigurationsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListNodeReplaceConfigurationsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingNodeReplaceConfigurationLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetNodeReplaceConfigurationLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListNodeReplaceConfigurationsResponse wrapper for the ListNodeReplaceConfigurations operation +type ListNodeReplaceConfigurationsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []NodeReplaceConfigurationSummary instances + Items []NodeReplaceConfigurationSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListNodeReplaceConfigurationsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListNodeReplaceConfigurationsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListNodeReplaceConfigurationsSortByEnum Enum with underlying type: string +type ListNodeReplaceConfigurationsSortByEnum string + +// Set of constants representing the allowable values for ListNodeReplaceConfigurationsSortByEnum +const ( + ListNodeReplaceConfigurationsSortByTimecreated ListNodeReplaceConfigurationsSortByEnum = "timeCreated" + ListNodeReplaceConfigurationsSortByDisplayname ListNodeReplaceConfigurationsSortByEnum = "displayName" +) + +var mappingListNodeReplaceConfigurationsSortByEnum = map[string]ListNodeReplaceConfigurationsSortByEnum{ + "timeCreated": ListNodeReplaceConfigurationsSortByTimecreated, + "displayName": ListNodeReplaceConfigurationsSortByDisplayname, +} + +var mappingListNodeReplaceConfigurationsSortByEnumLowerCase = map[string]ListNodeReplaceConfigurationsSortByEnum{ + "timecreated": ListNodeReplaceConfigurationsSortByTimecreated, + "displayname": ListNodeReplaceConfigurationsSortByDisplayname, +} + +// GetListNodeReplaceConfigurationsSortByEnumValues Enumerates the set of values for ListNodeReplaceConfigurationsSortByEnum +func GetListNodeReplaceConfigurationsSortByEnumValues() []ListNodeReplaceConfigurationsSortByEnum { + values := make([]ListNodeReplaceConfigurationsSortByEnum, 0) + for _, v := range mappingListNodeReplaceConfigurationsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListNodeReplaceConfigurationsSortByEnumStringValues Enumerates the set of values in String for ListNodeReplaceConfigurationsSortByEnum +func GetListNodeReplaceConfigurationsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListNodeReplaceConfigurationsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNodeReplaceConfigurationsSortByEnum(val string) (ListNodeReplaceConfigurationsSortByEnum, bool) { + enum, ok := mappingListNodeReplaceConfigurationsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListNodeReplaceConfigurationsSortOrderEnum Enum with underlying type: string +type ListNodeReplaceConfigurationsSortOrderEnum string + +// Set of constants representing the allowable values for ListNodeReplaceConfigurationsSortOrderEnum +const ( + ListNodeReplaceConfigurationsSortOrderAsc ListNodeReplaceConfigurationsSortOrderEnum = "ASC" + ListNodeReplaceConfigurationsSortOrderDesc ListNodeReplaceConfigurationsSortOrderEnum = "DESC" +) + +var mappingListNodeReplaceConfigurationsSortOrderEnum = map[string]ListNodeReplaceConfigurationsSortOrderEnum{ + "ASC": ListNodeReplaceConfigurationsSortOrderAsc, + "DESC": ListNodeReplaceConfigurationsSortOrderDesc, +} + +var mappingListNodeReplaceConfigurationsSortOrderEnumLowerCase = map[string]ListNodeReplaceConfigurationsSortOrderEnum{ + "asc": ListNodeReplaceConfigurationsSortOrderAsc, + "desc": ListNodeReplaceConfigurationsSortOrderDesc, +} + +// GetListNodeReplaceConfigurationsSortOrderEnumValues Enumerates the set of values for ListNodeReplaceConfigurationsSortOrderEnum +func GetListNodeReplaceConfigurationsSortOrderEnumValues() []ListNodeReplaceConfigurationsSortOrderEnum { + values := make([]ListNodeReplaceConfigurationsSortOrderEnum, 0) + for _, v := range mappingListNodeReplaceConfigurationsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListNodeReplaceConfigurationsSortOrderEnumStringValues Enumerates the set of values in String for ListNodeReplaceConfigurationsSortOrderEnum +func GetListNodeReplaceConfigurationsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListNodeReplaceConfigurationsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNodeReplaceConfigurationsSortOrderEnum(val string) (ListNodeReplaceConfigurationsSortOrderEnum, bool) { + enum, ok := mappingListNodeReplaceConfigurationsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/bds/node.go b/bds/node.go index 93f4f5eafa..775b622de8 100644 --- a/bds/node.go +++ b/bds/node.go @@ -83,6 +83,12 @@ type Node struct { // Indicates if the node requires a reboot to either reflect the latest os kernel or take actions for maintenance reboot. IsRebootRequired *bool `mandatory:"false" json:"isRebootRequired"` + + // The date and time the instance was replaced by a new vm with a node backup. + TimeReplaced *common.SDKTime `mandatory:"false" json:"timeReplaced"` + + // The node back id that was used for replacing the node. + NodeBackupId *string `mandatory:"false" json:"nodeBackupId"` } func (m Node) String() string { diff --git a/bds/node_backup.go b/bds/node_backup.go new file mode 100644 index 0000000000..ab47a1ede9 --- /dev/null +++ b/bds/node_backup.go @@ -0,0 +1,218 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NodeBackup The information about the Node's backup. +type NodeBackup struct { + + // The id of the node backup. + Id *string `mandatory:"true" json:"id"` + + // BDS generated name for the backup. Format is nodeHostName_timeCreated + DisplayName *string `mandatory:"true" json:"displayName"` + + // The instance OCID of the node, which is the resource from which the node backup was acquired. + NodeInstanceId *string `mandatory:"true" json:"nodeInstanceId"` + + // Host name of the node to which this backup belongs. + NodeHostName *string `mandatory:"true" json:"nodeHostName"` + + // type based on how backup action was initiated. + BackupTriggerType NodeBackupBackupTriggerTypeEnum `mandatory:"true" json:"backupTriggerType"` + + // Incremental backup type includes only the changes since the last backup. Full backup type includes all changes since the volume was created. + BackupType NodeBackupBackupTypeEnum `mandatory:"true" json:"backupType"` + + // The state of the NodeBackup. + LifecycleState NodeBackupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the cluster was created, shown as an RFC 3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The ID of the nodeBackupConfiguration if the NodeBackup is automatically created by applying the configuration. + NodeBackupConfigId *string `mandatory:"false" json:"nodeBackupConfigId"` +} + +func (m NodeBackup) 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 NodeBackup) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNodeBackupBackupTriggerTypeEnum(string(m.BackupTriggerType)); !ok && m.BackupTriggerType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackupTriggerType: %s. Supported values are: %s.", m.BackupTriggerType, strings.Join(GetNodeBackupBackupTriggerTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingNodeBackupBackupTypeEnum(string(m.BackupType)); !ok && m.BackupType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackupType: %s. Supported values are: %s.", m.BackupType, strings.Join(GetNodeBackupBackupTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingNodeBackupLifecycleStateEnum(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(GetNodeBackupLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// NodeBackupBackupTriggerTypeEnum Enum with underlying type: string +type NodeBackupBackupTriggerTypeEnum string + +// Set of constants representing the allowable values for NodeBackupBackupTriggerTypeEnum +const ( + NodeBackupBackupTriggerTypeManual NodeBackupBackupTriggerTypeEnum = "MANUAL" + NodeBackupBackupTriggerTypeScheduled NodeBackupBackupTriggerTypeEnum = "SCHEDULED" +) + +var mappingNodeBackupBackupTriggerTypeEnum = map[string]NodeBackupBackupTriggerTypeEnum{ + "MANUAL": NodeBackupBackupTriggerTypeManual, + "SCHEDULED": NodeBackupBackupTriggerTypeScheduled, +} + +var mappingNodeBackupBackupTriggerTypeEnumLowerCase = map[string]NodeBackupBackupTriggerTypeEnum{ + "manual": NodeBackupBackupTriggerTypeManual, + "scheduled": NodeBackupBackupTriggerTypeScheduled, +} + +// GetNodeBackupBackupTriggerTypeEnumValues Enumerates the set of values for NodeBackupBackupTriggerTypeEnum +func GetNodeBackupBackupTriggerTypeEnumValues() []NodeBackupBackupTriggerTypeEnum { + values := make([]NodeBackupBackupTriggerTypeEnum, 0) + for _, v := range mappingNodeBackupBackupTriggerTypeEnum { + values = append(values, v) + } + return values +} + +// GetNodeBackupBackupTriggerTypeEnumStringValues Enumerates the set of values in String for NodeBackupBackupTriggerTypeEnum +func GetNodeBackupBackupTriggerTypeEnumStringValues() []string { + return []string{ + "MANUAL", + "SCHEDULED", + } +} + +// GetMappingNodeBackupBackupTriggerTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNodeBackupBackupTriggerTypeEnum(val string) (NodeBackupBackupTriggerTypeEnum, bool) { + enum, ok := mappingNodeBackupBackupTriggerTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// NodeBackupBackupTypeEnum Enum with underlying type: string +type NodeBackupBackupTypeEnum string + +// Set of constants representing the allowable values for NodeBackupBackupTypeEnum +const ( + NodeBackupBackupTypeFull NodeBackupBackupTypeEnum = "FULL" + NodeBackupBackupTypeIncremental NodeBackupBackupTypeEnum = "INCREMENTAL" +) + +var mappingNodeBackupBackupTypeEnum = map[string]NodeBackupBackupTypeEnum{ + "FULL": NodeBackupBackupTypeFull, + "INCREMENTAL": NodeBackupBackupTypeIncremental, +} + +var mappingNodeBackupBackupTypeEnumLowerCase = map[string]NodeBackupBackupTypeEnum{ + "full": NodeBackupBackupTypeFull, + "incremental": NodeBackupBackupTypeIncremental, +} + +// GetNodeBackupBackupTypeEnumValues Enumerates the set of values for NodeBackupBackupTypeEnum +func GetNodeBackupBackupTypeEnumValues() []NodeBackupBackupTypeEnum { + values := make([]NodeBackupBackupTypeEnum, 0) + for _, v := range mappingNodeBackupBackupTypeEnum { + values = append(values, v) + } + return values +} + +// GetNodeBackupBackupTypeEnumStringValues Enumerates the set of values in String for NodeBackupBackupTypeEnum +func GetNodeBackupBackupTypeEnumStringValues() []string { + return []string{ + "FULL", + "INCREMENTAL", + } +} + +// GetMappingNodeBackupBackupTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNodeBackupBackupTypeEnum(val string) (NodeBackupBackupTypeEnum, bool) { + enum, ok := mappingNodeBackupBackupTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// NodeBackupLifecycleStateEnum Enum with underlying type: string +type NodeBackupLifecycleStateEnum string + +// Set of constants representing the allowable values for NodeBackupLifecycleStateEnum +const ( + NodeBackupLifecycleStateCreating NodeBackupLifecycleStateEnum = "CREATING" + NodeBackupLifecycleStateActive NodeBackupLifecycleStateEnum = "ACTIVE" + NodeBackupLifecycleStateUpdating NodeBackupLifecycleStateEnum = "UPDATING" + NodeBackupLifecycleStateDeleting NodeBackupLifecycleStateEnum = "DELETING" + NodeBackupLifecycleStateDeleted NodeBackupLifecycleStateEnum = "DELETED" + NodeBackupLifecycleStateFailed NodeBackupLifecycleStateEnum = "FAILED" + NodeBackupLifecycleStatePartial NodeBackupLifecycleStateEnum = "PARTIAL" +) + +var mappingNodeBackupLifecycleStateEnum = map[string]NodeBackupLifecycleStateEnum{ + "CREATING": NodeBackupLifecycleStateCreating, + "ACTIVE": NodeBackupLifecycleStateActive, + "UPDATING": NodeBackupLifecycleStateUpdating, + "DELETING": NodeBackupLifecycleStateDeleting, + "DELETED": NodeBackupLifecycleStateDeleted, + "FAILED": NodeBackupLifecycleStateFailed, + "PARTIAL": NodeBackupLifecycleStatePartial, +} + +var mappingNodeBackupLifecycleStateEnumLowerCase = map[string]NodeBackupLifecycleStateEnum{ + "creating": NodeBackupLifecycleStateCreating, + "active": NodeBackupLifecycleStateActive, + "updating": NodeBackupLifecycleStateUpdating, + "deleting": NodeBackupLifecycleStateDeleting, + "deleted": NodeBackupLifecycleStateDeleted, + "failed": NodeBackupLifecycleStateFailed, + "partial": NodeBackupLifecycleStatePartial, +} + +// GetNodeBackupLifecycleStateEnumValues Enumerates the set of values for NodeBackupLifecycleStateEnum +func GetNodeBackupLifecycleStateEnumValues() []NodeBackupLifecycleStateEnum { + values := make([]NodeBackupLifecycleStateEnum, 0) + for _, v := range mappingNodeBackupLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetNodeBackupLifecycleStateEnumStringValues Enumerates the set of values in String for NodeBackupLifecycleStateEnum +func GetNodeBackupLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + "PARTIAL", + } +} + +// GetMappingNodeBackupLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNodeBackupLifecycleStateEnum(val string) (NodeBackupLifecycleStateEnum, bool) { + enum, ok := mappingNodeBackupLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/bds/node_backup_configuration.go b/bds/node_backup_configuration.go new file mode 100644 index 0000000000..fc6d6f7283 --- /dev/null +++ b/bds/node_backup_configuration.go @@ -0,0 +1,187 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NodeBackupConfiguration The information about the NodeBackupConfiguration. +type NodeBackupConfiguration struct { + + // The unique identifier for the NodeBackupConfiguration. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the bdsInstance which is the parent resource id. + BdsInstanceId *string `mandatory:"true" json:"bdsInstanceId"` + + // A user-friendly name. Only ASCII alphanumeric characters with no spaces allowed. The name does not have to be unique, and it may be changed. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + LevelTypeDetails LevelTypeDetails `mandatory:"true" json:"levelTypeDetails"` + + // The state of the NodeBackupConfiguration. + LifecycleState NodeBackupConfigurationLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the NodeBackupConfiguration was created, shown as an RFC 3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the NodeBackupConfiguration was updated, shown as an RFC 3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The time zone of the execution schedule, in IANA time zone database name format + Timezone *string `mandatory:"true" json:"timezone"` + + // Day/time recurrence (specified following RFC 5545) at which to trigger the backup process. Currently only DAILY, WEEKLY and MONTHLY frequency is supported. Days of the week are specified using BYDAY field. Time of the day is specified using BYHOUR. Other fields are not supported. + Schedule *string `mandatory:"true" json:"schedule"` + + // Number of backup copies to retain. + NumberOfBackupsToRetain *int `mandatory:"true" json:"numberOfBackupsToRetain"` + + // Incremental backup type includes only the changes since the last backup. Full backup type includes all changes since the volume was created. + BackupType NodeBackupBackupTypeEnum `mandatory:"false" json:"backupType,omitempty"` +} + +func (m NodeBackupConfiguration) 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 NodeBackupConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNodeBackupConfigurationLifecycleStateEnum(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(GetNodeBackupConfigurationLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingNodeBackupBackupTypeEnum(string(m.BackupType)); !ok && m.BackupType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackupType: %s. Supported values are: %s.", m.BackupType, strings.Join(GetNodeBackupBackupTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *NodeBackupConfiguration) UnmarshalJSON(data []byte) (e error) { + model := struct { + BackupType NodeBackupBackupTypeEnum `json:"backupType"` + Id *string `json:"id"` + BdsInstanceId *string `json:"bdsInstanceId"` + DisplayName *string `json:"displayName"` + LevelTypeDetails leveltypedetails `json:"levelTypeDetails"` + LifecycleState NodeBackupConfigurationLifecycleStateEnum `json:"lifecycleState"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + Timezone *string `json:"timezone"` + Schedule *string `json:"schedule"` + NumberOfBackupsToRetain *int `json:"numberOfBackupsToRetain"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.BackupType = model.BackupType + + m.Id = model.Id + + m.BdsInstanceId = model.BdsInstanceId + + m.DisplayName = model.DisplayName + + nn, e = model.LevelTypeDetails.UnmarshalPolymorphicJSON(model.LevelTypeDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.LevelTypeDetails = nn.(LevelTypeDetails) + } else { + m.LevelTypeDetails = nil + } + + m.LifecycleState = model.LifecycleState + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + m.Timezone = model.Timezone + + m.Schedule = model.Schedule + + m.NumberOfBackupsToRetain = model.NumberOfBackupsToRetain + + return +} + +// NodeBackupConfigurationLifecycleStateEnum Enum with underlying type: string +type NodeBackupConfigurationLifecycleStateEnum string + +// Set of constants representing the allowable values for NodeBackupConfigurationLifecycleStateEnum +const ( + NodeBackupConfigurationLifecycleStateCreating NodeBackupConfigurationLifecycleStateEnum = "CREATING" + NodeBackupConfigurationLifecycleStateActive NodeBackupConfigurationLifecycleStateEnum = "ACTIVE" + NodeBackupConfigurationLifecycleStateUpdating NodeBackupConfigurationLifecycleStateEnum = "UPDATING" + NodeBackupConfigurationLifecycleStateDeleting NodeBackupConfigurationLifecycleStateEnum = "DELETING" + NodeBackupConfigurationLifecycleStateDeleted NodeBackupConfigurationLifecycleStateEnum = "DELETED" + NodeBackupConfigurationLifecycleStateFailed NodeBackupConfigurationLifecycleStateEnum = "FAILED" +) + +var mappingNodeBackupConfigurationLifecycleStateEnum = map[string]NodeBackupConfigurationLifecycleStateEnum{ + "CREATING": NodeBackupConfigurationLifecycleStateCreating, + "ACTIVE": NodeBackupConfigurationLifecycleStateActive, + "UPDATING": NodeBackupConfigurationLifecycleStateUpdating, + "DELETING": NodeBackupConfigurationLifecycleStateDeleting, + "DELETED": NodeBackupConfigurationLifecycleStateDeleted, + "FAILED": NodeBackupConfigurationLifecycleStateFailed, +} + +var mappingNodeBackupConfigurationLifecycleStateEnumLowerCase = map[string]NodeBackupConfigurationLifecycleStateEnum{ + "creating": NodeBackupConfigurationLifecycleStateCreating, + "active": NodeBackupConfigurationLifecycleStateActive, + "updating": NodeBackupConfigurationLifecycleStateUpdating, + "deleting": NodeBackupConfigurationLifecycleStateDeleting, + "deleted": NodeBackupConfigurationLifecycleStateDeleted, + "failed": NodeBackupConfigurationLifecycleStateFailed, +} + +// GetNodeBackupConfigurationLifecycleStateEnumValues Enumerates the set of values for NodeBackupConfigurationLifecycleStateEnum +func GetNodeBackupConfigurationLifecycleStateEnumValues() []NodeBackupConfigurationLifecycleStateEnum { + values := make([]NodeBackupConfigurationLifecycleStateEnum, 0) + for _, v := range mappingNodeBackupConfigurationLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetNodeBackupConfigurationLifecycleStateEnumStringValues Enumerates the set of values in String for NodeBackupConfigurationLifecycleStateEnum +func GetNodeBackupConfigurationLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingNodeBackupConfigurationLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNodeBackupConfigurationLifecycleStateEnum(val string) (NodeBackupConfigurationLifecycleStateEnum, bool) { + enum, ok := mappingNodeBackupConfigurationLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/bds/node_backup_configuration_summary.go b/bds/node_backup_configuration_summary.go new file mode 100644 index 0000000000..127ccb3c4a --- /dev/null +++ b/bds/node_backup_configuration_summary.go @@ -0,0 +1,102 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NodeBackupConfigurationSummary The information about the NodeBackupConfiguration. +type NodeBackupConfigurationSummary struct { + + // The id of the NodeBackupConfiguration. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the bdsInstance which is the parent resource id. + BdsInstanceId *string `mandatory:"true" json:"bdsInstanceId"` + + // A user-friendly name. Only ASCII alphanumeric characters with no spaces allowed. The name does not have to be unique, and it may be changed. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + LevelTypeDetails LevelTypeDetails `mandatory:"true" json:"levelTypeDetails"` + + // The state of the NodeBackupConfiguration. + LifecycleState NodeBackupConfigurationLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the NodeBackupConfiguration was created, shown as an RFC 3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the NodeBackupConfiguration was updated, shown as an RFC 3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m NodeBackupConfigurationSummary) 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 NodeBackupConfigurationSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNodeBackupConfigurationLifecycleStateEnum(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(GetNodeBackupConfigurationLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *NodeBackupConfigurationSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + Id *string `json:"id"` + BdsInstanceId *string `json:"bdsInstanceId"` + DisplayName *string `json:"displayName"` + LevelTypeDetails leveltypedetails `json:"levelTypeDetails"` + LifecycleState NodeBackupConfigurationLifecycleStateEnum `json:"lifecycleState"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Id = model.Id + + m.BdsInstanceId = model.BdsInstanceId + + m.DisplayName = model.DisplayName + + nn, e = model.LevelTypeDetails.UnmarshalPolymorphicJSON(model.LevelTypeDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.LevelTypeDetails = nn.(LevelTypeDetails) + } else { + m.LevelTypeDetails = nil + } + + m.LifecycleState = model.LifecycleState + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + return +} diff --git a/bds/node_backup_summary.go b/bds/node_backup_summary.go new file mode 100644 index 0000000000..d567e5a69b --- /dev/null +++ b/bds/node_backup_summary.go @@ -0,0 +1,69 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NodeBackupSummary The information about the nodeBackupSummary. +type NodeBackupSummary struct { + + // The id of the node backup. + Id *string `mandatory:"true" json:"id"` + + // BDS generated name for the backup. Format is nodeHostName_timeCreated. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The instance OCID of the node, which is the resource from which the node backup was acquired. + NodeInstanceId *string `mandatory:"true" json:"nodeInstanceId"` + + // Host name of the node that the backup belongs to. + NodeHostName *string `mandatory:"true" json:"nodeHostName"` + + // type based on how backup action was initiated. + BackupTriggerType NodeBackupBackupTriggerTypeEnum `mandatory:"true" json:"backupTriggerType"` + + // Incremental backup type includes only the changes since the last backup. Full backup type includes all changes since the volume was created + BackupType NodeBackupBackupTypeEnum `mandatory:"true" json:"backupType"` + + // The state of NodeBackup. + LifecycleState NodeBackupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the cluster was created, shown as an RFC 3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` +} + +func (m NodeBackupSummary) 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 NodeBackupSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNodeBackupBackupTriggerTypeEnum(string(m.BackupTriggerType)); !ok && m.BackupTriggerType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackupTriggerType: %s. Supported values are: %s.", m.BackupTriggerType, strings.Join(GetNodeBackupBackupTriggerTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingNodeBackupBackupTypeEnum(string(m.BackupType)); !ok && m.BackupType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackupType: %s. Supported values are: %s.", m.BackupType, strings.Join(GetNodeBackupBackupTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingNodeBackupLifecycleStateEnum(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(GetNodeBackupLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/bds/node_level_details.go b/bds/node_level_details.go new file mode 100644 index 0000000000..497330b3b9 --- /dev/null +++ b/bds/node_level_details.go @@ -0,0 +1,54 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NodeLevelDetails Details of node level used to trigger the creation of a new node backup configuration and node replacement configuration. +type NodeLevelDetails struct { + + // Host name of the node to create backup configuration. + NodeHostName *string `mandatory:"true" json:"nodeHostName"` +} + +func (m NodeLevelDetails) 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 NodeLevelDetails) 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 NodeLevelDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNodeLevelDetails NodeLevelDetails + s := struct { + DiscriminatorParam string `json:"levelType"` + MarshalTypeNodeLevelDetails + }{ + "NODE_LEVEL", + (MarshalTypeNodeLevelDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/bds/node_replace_configuration.go b/bds/node_replace_configuration.go new file mode 100644 index 0000000000..28e4f73124 --- /dev/null +++ b/bds/node_replace_configuration.go @@ -0,0 +1,217 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NodeReplaceConfiguration The information about the NodeReplaceConfiguration. +type NodeReplaceConfiguration struct { + + // The unique identifier for the NodeReplaceConfiguration. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the bdsInstance which is the parent resource id. + BdsInstanceId *string `mandatory:"true" json:"bdsInstanceId"` + + // A user-friendly name. Only ASCII alphanumeric characters with no spaces allowed. The name does not have to be unique, and it may be changed. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + LevelTypeDetails LevelTypeDetails `mandatory:"true" json:"levelTypeDetails"` + + // The state of the NodeReplaceConfiguration. + LifecycleState NodeReplaceConfigurationLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the NodeReplaceConfiguration was created, shown as an RFC 3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the NodeReplaceConfiguration was updated, shown as an RFC 3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Type of compute instance health metric to use for node replacement + MetricType NodeReplaceConfigurationMetricTypeEnum `mandatory:"true" json:"metricType"` + + // This value is the minimum period of time to wait for metric emission before triggering node replacement. The value is in minutes. + DurationInMinutes *int `mandatory:"true" json:"durationInMinutes"` +} + +func (m NodeReplaceConfiguration) 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 NodeReplaceConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNodeReplaceConfigurationLifecycleStateEnum(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(GetNodeReplaceConfigurationLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingNodeReplaceConfigurationMetricTypeEnum(string(m.MetricType)); !ok && m.MetricType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for MetricType: %s. Supported values are: %s.", m.MetricType, strings.Join(GetNodeReplaceConfigurationMetricTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *NodeReplaceConfiguration) UnmarshalJSON(data []byte) (e error) { + model := struct { + Id *string `json:"id"` + BdsInstanceId *string `json:"bdsInstanceId"` + DisplayName *string `json:"displayName"` + LevelTypeDetails leveltypedetails `json:"levelTypeDetails"` + LifecycleState NodeReplaceConfigurationLifecycleStateEnum `json:"lifecycleState"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + MetricType NodeReplaceConfigurationMetricTypeEnum `json:"metricType"` + DurationInMinutes *int `json:"durationInMinutes"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Id = model.Id + + m.BdsInstanceId = model.BdsInstanceId + + m.DisplayName = model.DisplayName + + nn, e = model.LevelTypeDetails.UnmarshalPolymorphicJSON(model.LevelTypeDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.LevelTypeDetails = nn.(LevelTypeDetails) + } else { + m.LevelTypeDetails = nil + } + + m.LifecycleState = model.LifecycleState + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + m.MetricType = model.MetricType + + m.DurationInMinutes = model.DurationInMinutes + + return +} + +// NodeReplaceConfigurationLifecycleStateEnum Enum with underlying type: string +type NodeReplaceConfigurationLifecycleStateEnum string + +// Set of constants representing the allowable values for NodeReplaceConfigurationLifecycleStateEnum +const ( + NodeReplaceConfigurationLifecycleStateCreating NodeReplaceConfigurationLifecycleStateEnum = "CREATING" + NodeReplaceConfigurationLifecycleStateActive NodeReplaceConfigurationLifecycleStateEnum = "ACTIVE" + NodeReplaceConfigurationLifecycleStateUpdating NodeReplaceConfigurationLifecycleStateEnum = "UPDATING" + NodeReplaceConfigurationLifecycleStateDeleting NodeReplaceConfigurationLifecycleStateEnum = "DELETING" + NodeReplaceConfigurationLifecycleStateDeleted NodeReplaceConfigurationLifecycleStateEnum = "DELETED" + NodeReplaceConfigurationLifecycleStateFailed NodeReplaceConfigurationLifecycleStateEnum = "FAILED" +) + +var mappingNodeReplaceConfigurationLifecycleStateEnum = map[string]NodeReplaceConfigurationLifecycleStateEnum{ + "CREATING": NodeReplaceConfigurationLifecycleStateCreating, + "ACTIVE": NodeReplaceConfigurationLifecycleStateActive, + "UPDATING": NodeReplaceConfigurationLifecycleStateUpdating, + "DELETING": NodeReplaceConfigurationLifecycleStateDeleting, + "DELETED": NodeReplaceConfigurationLifecycleStateDeleted, + "FAILED": NodeReplaceConfigurationLifecycleStateFailed, +} + +var mappingNodeReplaceConfigurationLifecycleStateEnumLowerCase = map[string]NodeReplaceConfigurationLifecycleStateEnum{ + "creating": NodeReplaceConfigurationLifecycleStateCreating, + "active": NodeReplaceConfigurationLifecycleStateActive, + "updating": NodeReplaceConfigurationLifecycleStateUpdating, + "deleting": NodeReplaceConfigurationLifecycleStateDeleting, + "deleted": NodeReplaceConfigurationLifecycleStateDeleted, + "failed": NodeReplaceConfigurationLifecycleStateFailed, +} + +// GetNodeReplaceConfigurationLifecycleStateEnumValues Enumerates the set of values for NodeReplaceConfigurationLifecycleStateEnum +func GetNodeReplaceConfigurationLifecycleStateEnumValues() []NodeReplaceConfigurationLifecycleStateEnum { + values := make([]NodeReplaceConfigurationLifecycleStateEnum, 0) + for _, v := range mappingNodeReplaceConfigurationLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetNodeReplaceConfigurationLifecycleStateEnumStringValues Enumerates the set of values in String for NodeReplaceConfigurationLifecycleStateEnum +func GetNodeReplaceConfigurationLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingNodeReplaceConfigurationLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNodeReplaceConfigurationLifecycleStateEnum(val string) (NodeReplaceConfigurationLifecycleStateEnum, bool) { + enum, ok := mappingNodeReplaceConfigurationLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// NodeReplaceConfigurationMetricTypeEnum Enum with underlying type: string +type NodeReplaceConfigurationMetricTypeEnum string + +// Set of constants representing the allowable values for NodeReplaceConfigurationMetricTypeEnum +const ( + NodeReplaceConfigurationMetricTypeStatus NodeReplaceConfigurationMetricTypeEnum = "INSTANCE_STATUS" + NodeReplaceConfigurationMetricTypeAccessibilityStatus NodeReplaceConfigurationMetricTypeEnum = "INSTANCE_ACCESSIBILITY_STATUS" +) + +var mappingNodeReplaceConfigurationMetricTypeEnum = map[string]NodeReplaceConfigurationMetricTypeEnum{ + "INSTANCE_STATUS": NodeReplaceConfigurationMetricTypeStatus, + "INSTANCE_ACCESSIBILITY_STATUS": NodeReplaceConfigurationMetricTypeAccessibilityStatus, +} + +var mappingNodeReplaceConfigurationMetricTypeEnumLowerCase = map[string]NodeReplaceConfigurationMetricTypeEnum{ + "instance_status": NodeReplaceConfigurationMetricTypeStatus, + "instance_accessibility_status": NodeReplaceConfigurationMetricTypeAccessibilityStatus, +} + +// GetNodeReplaceConfigurationMetricTypeEnumValues Enumerates the set of values for NodeReplaceConfigurationMetricTypeEnum +func GetNodeReplaceConfigurationMetricTypeEnumValues() []NodeReplaceConfigurationMetricTypeEnum { + values := make([]NodeReplaceConfigurationMetricTypeEnum, 0) + for _, v := range mappingNodeReplaceConfigurationMetricTypeEnum { + values = append(values, v) + } + return values +} + +// GetNodeReplaceConfigurationMetricTypeEnumStringValues Enumerates the set of values in String for NodeReplaceConfigurationMetricTypeEnum +func GetNodeReplaceConfigurationMetricTypeEnumStringValues() []string { + return []string{ + "INSTANCE_STATUS", + "INSTANCE_ACCESSIBILITY_STATUS", + } +} + +// GetMappingNodeReplaceConfigurationMetricTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNodeReplaceConfigurationMetricTypeEnum(val string) (NodeReplaceConfigurationMetricTypeEnum, bool) { + enum, ok := mappingNodeReplaceConfigurationMetricTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/bds/node_replace_configuration_summary.go b/bds/node_replace_configuration_summary.go new file mode 100644 index 0000000000..bf628f8ce1 --- /dev/null +++ b/bds/node_replace_configuration_summary.go @@ -0,0 +1,102 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NodeReplaceConfigurationSummary The information about the NodeReplaceConfigurationSummary. +type NodeReplaceConfigurationSummary struct { + + // The id of the NodeReplaceConfiguration. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the bdsInstance which is the parent resource id. + BdsInstanceId *string `mandatory:"true" json:"bdsInstanceId"` + + // A user-friendly name. Only ASCII alphanumeric characters with no spaces allowed. The name does not have to be unique, and it may be changed. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + LevelTypeDetails LevelTypeDetails `mandatory:"true" json:"levelTypeDetails"` + + // The state of the NodeReplaceConfiguration. + LifecycleState NodeReplaceConfigurationLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the NodeReplaceConfiguration was created, shown as an RFC 3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the NodeReplaceConfiguration was updated, shown as an RFC 3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m NodeReplaceConfigurationSummary) 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 NodeReplaceConfigurationSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNodeReplaceConfigurationLifecycleStateEnum(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(GetNodeReplaceConfigurationLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *NodeReplaceConfigurationSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + Id *string `json:"id"` + BdsInstanceId *string `json:"bdsInstanceId"` + DisplayName *string `json:"displayName"` + LevelTypeDetails leveltypedetails `json:"levelTypeDetails"` + LifecycleState NodeReplaceConfigurationLifecycleStateEnum `json:"lifecycleState"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Id = model.Id + + m.BdsInstanceId = model.BdsInstanceId + + m.DisplayName = model.DisplayName + + nn, e = model.LevelTypeDetails.UnmarshalPolymorphicJSON(model.LevelTypeDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.LevelTypeDetails = nn.(LevelTypeDetails) + } else { + m.LevelTypeDetails = nil + } + + m.LifecycleState = model.LifecycleState + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + return +} diff --git a/bds/node_type_level_details.go b/bds/node_type_level_details.go new file mode 100644 index 0000000000..6c015d932d --- /dev/null +++ b/bds/node_type_level_details.go @@ -0,0 +1,57 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NodeTypeLevelDetails Details of node type level used to trigger the creation of a new node backup configuration and node replacement configuration. +type NodeTypeLevelDetails struct { + + // Type of the node or nodes of the node backup configuration or node replacement configuration which are going to be created. + NodeType NodeNodeTypeEnum `mandatory:"true" json:"nodeType"` +} + +func (m NodeTypeLevelDetails) 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 NodeTypeLevelDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingNodeNodeTypeEnum(string(m.NodeType)); !ok && m.NodeType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NodeType: %s. Supported values are: %s.", m.NodeType, strings.Join(GetNodeNodeTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NodeTypeLevelDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNodeTypeLevelDetails NodeTypeLevelDetails + s := struct { + DiscriminatorParam string `json:"levelType"` + MarshalTypeNodeTypeLevelDetails + }{ + "NODE_TYPE_LEVEL", + (MarshalTypeNodeTypeLevelDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/bds/operation_types.go b/bds/operation_types.go index e8f35cbbe4..1b40f698b3 100644 --- a/bds/operation_types.go +++ b/bds/operation_types.go @@ -54,6 +54,15 @@ const ( OperationTypesRemoveKafka OperationTypesEnum = "REMOVE_KAFKA" OperationTypesExecuteBootstrapScript OperationTypesEnum = "EXECUTE_BOOTSTRAP_SCRIPT" OperationTypesOdhServiceCertificateUpdate OperationTypesEnum = "ODH_SERVICE_CERTIFICATE_UPDATE" + OperationTypesCreateBackupConfig OperationTypesEnum = "CREATE_BACKUP_CONFIG" + OperationTypesUpdateBackupConfig OperationTypesEnum = "UPDATE_BACKUP_CONFIG" + OperationTypesDeleteBackupConfig OperationTypesEnum = "DELETE_BACKUP_CONFIG" + OperationTypesCreateNodeReplaceConfig OperationTypesEnum = "CREATE_NODE_REPLACE_CONFIG" + OperationTypesUpdateNodeReplaceConfig OperationTypesEnum = "UPDATE_NODE_REPLACE_CONFIG" + OperationTypesDeleteNodeReplaceConfig OperationTypesEnum = "DELETE_NODE_REPLACE_CONFIG" + OperationTypesBackupNodes OperationTypesEnum = "BACKUP_NODES" + OperationTypesDeleteNodeBackup OperationTypesEnum = "DELETE_NODE_BACKUP" + OperationTypesReplaceNode OperationTypesEnum = "REPLACE_NODE" ) var mappingOperationTypesEnum = map[string]OperationTypesEnum{ @@ -93,6 +102,15 @@ var mappingOperationTypesEnum = map[string]OperationTypesEnum{ "REMOVE_KAFKA": OperationTypesRemoveKafka, "EXECUTE_BOOTSTRAP_SCRIPT": OperationTypesExecuteBootstrapScript, "ODH_SERVICE_CERTIFICATE_UPDATE": OperationTypesOdhServiceCertificateUpdate, + "CREATE_BACKUP_CONFIG": OperationTypesCreateBackupConfig, + "UPDATE_BACKUP_CONFIG": OperationTypesUpdateBackupConfig, + "DELETE_BACKUP_CONFIG": OperationTypesDeleteBackupConfig, + "CREATE_NODE_REPLACE_CONFIG": OperationTypesCreateNodeReplaceConfig, + "UPDATE_NODE_REPLACE_CONFIG": OperationTypesUpdateNodeReplaceConfig, + "DELETE_NODE_REPLACE_CONFIG": OperationTypesDeleteNodeReplaceConfig, + "BACKUP_NODES": OperationTypesBackupNodes, + "DELETE_NODE_BACKUP": OperationTypesDeleteNodeBackup, + "REPLACE_NODE": OperationTypesReplaceNode, } var mappingOperationTypesEnumLowerCase = map[string]OperationTypesEnum{ @@ -132,6 +150,15 @@ var mappingOperationTypesEnumLowerCase = map[string]OperationTypesEnum{ "remove_kafka": OperationTypesRemoveKafka, "execute_bootstrap_script": OperationTypesExecuteBootstrapScript, "odh_service_certificate_update": OperationTypesOdhServiceCertificateUpdate, + "create_backup_config": OperationTypesCreateBackupConfig, + "update_backup_config": OperationTypesUpdateBackupConfig, + "delete_backup_config": OperationTypesDeleteBackupConfig, + "create_node_replace_config": OperationTypesCreateNodeReplaceConfig, + "update_node_replace_config": OperationTypesUpdateNodeReplaceConfig, + "delete_node_replace_config": OperationTypesDeleteNodeReplaceConfig, + "backup_nodes": OperationTypesBackupNodes, + "delete_node_backup": OperationTypesDeleteNodeBackup, + "replace_node": OperationTypesReplaceNode, } // GetOperationTypesEnumValues Enumerates the set of values for OperationTypesEnum @@ -182,6 +209,15 @@ func GetOperationTypesEnumStringValues() []string { "REMOVE_KAFKA", "EXECUTE_BOOTSTRAP_SCRIPT", "ODH_SERVICE_CERTIFICATE_UPDATE", + "CREATE_BACKUP_CONFIG", + "UPDATE_BACKUP_CONFIG", + "DELETE_BACKUP_CONFIG", + "CREATE_NODE_REPLACE_CONFIG", + "UPDATE_NODE_REPLACE_CONFIG", + "DELETE_NODE_REPLACE_CONFIG", + "BACKUP_NODES", + "DELETE_NODE_BACKUP", + "REPLACE_NODE", } } diff --git a/bds/remove_node_replace_configuration_details.go b/bds/remove_node_replace_configuration_details.go new file mode 100644 index 0000000000..9075e86b80 --- /dev/null +++ b/bds/remove_node_replace_configuration_details.go @@ -0,0 +1,39 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RemoveNodeReplaceConfigurationDetails The information about the NodeReplaceConfiguration that being removed. +type RemoveNodeReplaceConfigurationDetails struct { + + // Base-64 encoded password for the cluster admin user. + ClusterAdminPassword *string `mandatory:"true" json:"clusterAdminPassword"` +} + +func (m RemoveNodeReplaceConfigurationDetails) 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 RemoveNodeReplaceConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/bds/remove_node_replace_configuration_request_response.go b/bds/remove_node_replace_configuration_request_response.go new file mode 100644 index 0000000000..abbc83be89 --- /dev/null +++ b/bds/remove_node_replace_configuration_request_response.go @@ -0,0 +1,110 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveNodeReplaceConfigurationRequest wrapper for the RemoveNodeReplaceConfiguration operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/RemoveNodeReplaceConfiguration.go.html to see an example of how to use RemoveNodeReplaceConfigurationRequest. +type RemoveNodeReplaceConfigurationRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Unique Oracle-assigned identifier of the NodeReplaceConfiguration. + NodeReplaceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"nodeReplaceConfigurationId"` + + // Details for removing NodeReplaceConfiguration + RemoveNodeReplaceConfigurationDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error, without risk of executing that same action again. Retry tokens expire after 24 + // hours but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 RemoveNodeReplaceConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveNodeReplaceConfigurationRequest) 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 RemoveNodeReplaceConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveNodeReplaceConfigurationRequest) 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 RemoveNodeReplaceConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveNodeReplaceConfigurationResponse wrapper for the RemoveNodeReplaceConfiguration operation +type RemoveNodeReplaceConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response RemoveNodeReplaceConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveNodeReplaceConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/replace_node_details.go b/bds/replace_node_details.go new file mode 100644 index 0000000000..9d614e36e9 --- /dev/null +++ b/bds/replace_node_details.go @@ -0,0 +1,48 @@ +// 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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReplaceNodeDetails The information about the node to be replaced. +type ReplaceNodeDetails struct { + + // Host name of the node to replace. MASTER, UTILITY and EDGE node are only supported types + NodeHostName *string `mandatory:"true" json:"nodeHostName"` + + // The id of the nodeBackup to use for replacing the node. + NodeBackupId *string `mandatory:"true" json:"nodeBackupId"` + + // Base-64 encoded password for the cluster admin user. + ClusterAdminPassword *string `mandatory:"true" json:"clusterAdminPassword"` + + // Shape of the new vm when replacing the node. If not provided, BDS will attempt to replace the node with the shape of current node. + Shape *string `mandatory:"false" json:"shape"` +} + +func (m ReplaceNodeDetails) 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 ReplaceNodeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/bds/replace_node_request_response.go b/bds/replace_node_request_response.go new file mode 100644 index 0000000000..26dab00110 --- /dev/null +++ b/bds/replace_node_request_response.go @@ -0,0 +1,107 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ReplaceNodeRequest wrapper for the ReplaceNode operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/ReplaceNode.go.html to see an example of how to use ReplaceNodeRequest. +type ReplaceNodeRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Details for Replacing the node. + ReplaceNodeDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // This if-match is for the BdsInstance. For optimistic concurrency + // control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response + // for that resource. The resource will be updated or deleted only if + // the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error, without risk of executing that same action again. Retry tokens expire after 24 + // hours but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 ReplaceNodeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ReplaceNodeRequest) 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 ReplaceNodeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ReplaceNodeRequest) 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 ReplaceNodeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ReplaceNodeResponse wrapper for the ReplaceNode operation +type ReplaceNodeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response ReplaceNodeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ReplaceNodeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/update_node_backup_configuration_details.go b/bds/update_node_backup_configuration_details.go new file mode 100644 index 0000000000..a42a2fea2d --- /dev/null +++ b/bds/update_node_backup_configuration_details.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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateNodeBackupConfigurationDetails The information about the NodeBackupConfiguration that is being updated. +type UpdateNodeBackupConfigurationDetails struct { + LevelTypeDetails LevelTypeDetails `mandatory:"false" json:"levelTypeDetails"` + + // A user-friendly name. Only ASCII alphanumeric characters with no spaces allowed. The name does not have to be unique, and it may be changed. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The time zone of the execution schedule, in IANA time zone database name format + Timezone *string `mandatory:"false" json:"timezone"` + + // Day/time recurrence (specified following RFC 5545) at which to trigger the backup process. Currently only DAILY, WEEKLY and MONTHLY frequency is supported. Days of the week are specified using BYDAY field. Time of the day is specified using BYHOUR. Other fields are not supported. + Schedule *string `mandatory:"false" json:"schedule"` + + // Number of backup copies to retain. + NumberOfBackupsToRetain *int `mandatory:"false" json:"numberOfBackupsToRetain"` + + // Incremental backup type includes only the changes since the last backup. Full backup type includes all changes since the volume was created. + BackupType NodeBackupBackupTypeEnum `mandatory:"false" json:"backupType,omitempty"` +} + +func (m UpdateNodeBackupConfigurationDetails) 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 UpdateNodeBackupConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingNodeBackupBackupTypeEnum(string(m.BackupType)); !ok && m.BackupType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackupType: %s. Supported values are: %s.", m.BackupType, strings.Join(GetNodeBackupBackupTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *UpdateNodeBackupConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + LevelTypeDetails leveltypedetails `json:"levelTypeDetails"` + DisplayName *string `json:"displayName"` + Timezone *string `json:"timezone"` + Schedule *string `json:"schedule"` + NumberOfBackupsToRetain *int `json:"numberOfBackupsToRetain"` + BackupType NodeBackupBackupTypeEnum `json:"backupType"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.LevelTypeDetails.UnmarshalPolymorphicJSON(model.LevelTypeDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.LevelTypeDetails = nn.(LevelTypeDetails) + } else { + m.LevelTypeDetails = nil + } + + m.DisplayName = model.DisplayName + + m.Timezone = model.Timezone + + m.Schedule = model.Schedule + + m.NumberOfBackupsToRetain = model.NumberOfBackupsToRetain + + m.BackupType = model.BackupType + + return +} diff --git a/bds/update_node_backup_configuration_request_response.go b/bds/update_node_backup_configuration_request_response.go new file mode 100644 index 0000000000..8e6f148088 --- /dev/null +++ b/bds/update_node_backup_configuration_request_response.go @@ -0,0 +1,110 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateNodeBackupConfigurationRequest wrapper for the UpdateNodeBackupConfiguration operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/UpdateNodeBackupConfiguration.go.html to see an example of how to use UpdateNodeBackupConfigurationRequest. +type UpdateNodeBackupConfigurationRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Unique Oracle-assigned identifier of the NodeBackupConfiguration. + NodeBackupConfigurationId *string `mandatory:"true" contributesTo:"path" name:"nodeBackupConfigurationId"` + + // Details for updating the NodeBackupConfiguration. + UpdateNodeBackupConfigurationDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error, without risk of executing that same action again. Retry tokens expire after 24 + // hours but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 UpdateNodeBackupConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateNodeBackupConfigurationRequest) 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 UpdateNodeBackupConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateNodeBackupConfigurationRequest) 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 UpdateNodeBackupConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateNodeBackupConfigurationResponse wrapper for the UpdateNodeBackupConfiguration operation +type UpdateNodeBackupConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateNodeBackupConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateNodeBackupConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/bds/update_node_replace_configuration_details.go b/bds/update_node_replace_configuration_details.go new file mode 100644 index 0000000000..27e75aef7c --- /dev/null +++ b/bds/update_node_replace_configuration_details.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. + +// Big Data Service API +// +// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications. +// + +package bds + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateNodeReplaceConfigurationDetails The information about the NodeReplaceConfiguration +type UpdateNodeReplaceConfigurationDetails struct { + LevelTypeDetails LevelTypeDetails `mandatory:"false" json:"levelTypeDetails"` + + // A user-friendly name. Only ASCII alphanumeric characters with no spaces allowed. The name does not have to be unique, and it may be changed. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Type of compute instance health metric to use for node replacement + MetricType NodeReplaceConfigurationMetricTypeEnum `mandatory:"false" json:"metricType,omitempty"` + + // This value is the pending duration time to wait for metric emission before triggering node replacement. The value is in minutes. + DurationInMinutes *int `mandatory:"false" json:"durationInMinutes"` +} + +func (m UpdateNodeReplaceConfigurationDetails) 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 UpdateNodeReplaceConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingNodeReplaceConfigurationMetricTypeEnum(string(m.MetricType)); !ok && m.MetricType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for MetricType: %s. Supported values are: %s.", m.MetricType, strings.Join(GetNodeReplaceConfigurationMetricTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *UpdateNodeReplaceConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + LevelTypeDetails leveltypedetails `json:"levelTypeDetails"` + DisplayName *string `json:"displayName"` + MetricType NodeReplaceConfigurationMetricTypeEnum `json:"metricType"` + DurationInMinutes *int `json:"durationInMinutes"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.LevelTypeDetails.UnmarshalPolymorphicJSON(model.LevelTypeDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.LevelTypeDetails = nn.(LevelTypeDetails) + } else { + m.LevelTypeDetails = nil + } + + m.DisplayName = model.DisplayName + + m.MetricType = model.MetricType + + m.DurationInMinutes = model.DurationInMinutes + + return +} diff --git a/bds/update_node_replace_configuration_request_response.go b/bds/update_node_replace_configuration_request_response.go new file mode 100644 index 0000000000..90af98dd45 --- /dev/null +++ b/bds/update_node_replace_configuration_request_response.go @@ -0,0 +1,110 @@ +// 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 bds + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateNodeReplaceConfigurationRequest wrapper for the UpdateNodeReplaceConfiguration operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/bds/UpdateNodeReplaceConfiguration.go.html to see an example of how to use UpdateNodeReplaceConfigurationRequest. +type UpdateNodeReplaceConfigurationRequest struct { + + // The OCID of the cluster. + BdsInstanceId *string `mandatory:"true" contributesTo:"path" name:"bdsInstanceId"` + + // Unique Oracle-assigned identifier of the NodeReplaceConfiguration. + NodeReplaceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"nodeReplaceConfigurationId"` + + // Details for updating the nodeReplaceConfiguration. + UpdateNodeReplaceConfigurationDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error, without risk of executing that same action again. Retry tokens expire after 24 + // hours but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 UpdateNodeReplaceConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateNodeReplaceConfigurationRequest) 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 UpdateNodeReplaceConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateNodeReplaceConfigurationRequest) 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 UpdateNodeReplaceConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateNodeReplaceConfigurationResponse wrapper for the UpdateNodeReplaceConfiguration operation +type UpdateNodeReplaceConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateNodeReplaceConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateNodeReplaceConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/clusterplacementgroups/clusterplacementgroups_clusterplacementgroupscp_client.go b/clusterplacementgroups/clusterplacementgroups_clusterplacementgroupscp_client.go index cd1c1f8b57..f820793c51 100644 --- a/clusterplacementgroups/clusterplacementgroups_clusterplacementgroupscp_client.go +++ b/clusterplacementgroups/clusterplacementgroups_clusterplacementgroupscp_client.go @@ -145,7 +145,7 @@ func (client ClusterPlacementGroupsCPClient) activateClusterPlacementGroup(ctx c defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/ClusterPlacementGroup/ActivateClusterPlacementGroup" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "ActivateClusterPlacementGroup", apiReferenceLink) return response, err } @@ -203,7 +203,7 @@ func (client ClusterPlacementGroupsCPClient) cancelWorkRequest(ctx context.Conte defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/WorkRequest/CancelWorkRequest" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "CancelWorkRequest", apiReferenceLink) return response, err } @@ -268,7 +268,7 @@ func (client ClusterPlacementGroupsCPClient) changeClusterPlacementGroupCompartm defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/ClusterPlacementGroup/ChangeClusterPlacementGroupCompartment" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "ChangeClusterPlacementGroupCompartment", apiReferenceLink) return response, err } @@ -331,7 +331,7 @@ func (client ClusterPlacementGroupsCPClient) createClusterPlacementGroup(ctx con defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/ClusterPlacementGroup/CreateClusterPlacementGroup" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "CreateClusterPlacementGroup", apiReferenceLink) return response, err } @@ -394,7 +394,7 @@ func (client ClusterPlacementGroupsCPClient) deactivateClusterPlacementGroup(ctx defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/ClusterPlacementGroup/DeactivateClusterPlacementGroup" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "DeactivateClusterPlacementGroup", apiReferenceLink) return response, err } @@ -452,7 +452,7 @@ func (client ClusterPlacementGroupsCPClient) deleteClusterPlacementGroup(ctx con defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/ClusterPlacementGroup/DeleteClusterPlacementGroup" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "DeleteClusterPlacementGroup", apiReferenceLink) return response, err } @@ -510,7 +510,7 @@ func (client ClusterPlacementGroupsCPClient) getClusterPlacementGroup(ctx contex defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/ClusterPlacementGroup/GetClusterPlacementGroup" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "GetClusterPlacementGroup", apiReferenceLink) return response, err } @@ -568,7 +568,7 @@ func (client ClusterPlacementGroupsCPClient) getWorkRequest(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/WorkRequest/GetWorkRequest" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "GetWorkRequest", apiReferenceLink) return response, err } @@ -626,7 +626,7 @@ func (client ClusterPlacementGroupsCPClient) listClusterPlacementGroups(ctx cont defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/ClusterPlacementGroupCollection/ListClusterPlacementGroups" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "ListClusterPlacementGroups", apiReferenceLink) return response, err } @@ -684,7 +684,7 @@ func (client ClusterPlacementGroupsCPClient) listWorkRequestErrors(ctx context.C defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/WorkRequestError/ListWorkRequestErrors" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "ListWorkRequestErrors", apiReferenceLink) return response, err } @@ -742,7 +742,7 @@ func (client ClusterPlacementGroupsCPClient) listWorkRequestLogs(ctx context.Con defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/WorkRequestLogEntry/ListWorkRequestLogs" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "ListWorkRequestLogs", apiReferenceLink) return response, err } @@ -800,7 +800,7 @@ func (client ClusterPlacementGroupsCPClient) listWorkRequests(ctx context.Contex defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/WorkRequest/ListWorkRequests" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "ListWorkRequests", apiReferenceLink) return response, err } @@ -858,7 +858,7 @@ func (client ClusterPlacementGroupsCPClient) updateClusterPlacementGroup(ctx con defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/clusterplacementgroups/20230801/ClusterPlacementGroup/UpdateClusterPlacementGroup" err = common.PostProcessServiceError(err, "ClusterPlacementGroupsCP", "UpdateClusterPlacementGroup", apiReferenceLink) return response, err } diff --git a/common/version.go b/common/version.go index 0c0f91286e..3ca799210f 100644 --- a/common/version.go +++ b/common/version.go @@ -13,7 +13,7 @@ import ( const ( major = "65" minor = "65" - patch = "2" + patch = "3" tag = "" ) diff --git a/datascience/cancel_pipeline_run_request_response.go b/datascience/cancel_pipeline_run_request_response.go index db245f8df9..77af0b2975 100644 --- a/datascience/cancel_pipeline_run_request_response.go +++ b/datascience/cancel_pipeline_run_request_response.go @@ -34,6 +34,9 @@ type CancelPipelineRunRequest struct { // provide matches the resource's current `etag` value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + // A boolean value to specify whether to terminate pipeline run gracefully. + TerminateGracefully *bool `mandatory:"false" contributesTo:"query" name:"terminateGracefully"` + // 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/datascience/create_job_run_request_response.go b/datascience/create_job_run_request_response.go index b798a9fc41..b9e426314f 100644 --- a/datascience/create_job_run_request_response.go +++ b/datascience/create_job_run_request_response.go @@ -27,6 +27,9 @@ type CreateJobRunRequest struct { // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected. OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + // URL to fetch the Resource Principal Token from the parent resource. + OpcParentRptUrl *string `mandatory:"false" contributesTo:"header" name:"opc-parent-rpt-url"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/datascience/create_model_deployment_request_response.go b/datascience/create_model_deployment_request_response.go index d18962e4ad..1415edb7b7 100644 --- a/datascience/create_model_deployment_request_response.go +++ b/datascience/create_model_deployment_request_response.go @@ -27,6 +27,9 @@ type CreateModelDeploymentRequest struct { // A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected. OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + // URL to fetch the Resource Principal Token from the parent resource. + OpcParentRptUrl *string `mandatory:"false" contributesTo:"header" name:"opc-parent-rpt-url"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/datascience/create_pipeline_run_request_response.go b/datascience/create_pipeline_run_request_response.go index bd16ab3e0e..f25c3cd853 100644 --- a/datascience/create_pipeline_run_request_response.go +++ b/datascience/create_pipeline_run_request_response.go @@ -27,6 +27,9 @@ type CreatePipelineRunRequest struct { // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, then provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // URL to fetch the Resource Principal Token from the parent resource. + OpcParentRptUrl *string `mandatory:"false" contributesTo:"header" name:"opc-parent-rpt-url"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/datascience/fast_launch_job_config_summary.go b/datascience/fast_launch_job_config_summary.go index 5312250113..947e83e8f3 100644 --- a/datascience/fast_launch_job_config_summary.go +++ b/datascience/fast_launch_job_config_summary.go @@ -67,6 +67,7 @@ const ( FastLaunchJobConfigSummaryShapeSeriesAmdRome FastLaunchJobConfigSummaryShapeSeriesEnum = "AMD_ROME" FastLaunchJobConfigSummaryShapeSeriesIntelSkylake FastLaunchJobConfigSummaryShapeSeriesEnum = "INTEL_SKYLAKE" FastLaunchJobConfigSummaryShapeSeriesNvidiaGpu FastLaunchJobConfigSummaryShapeSeriesEnum = "NVIDIA_GPU" + FastLaunchJobConfigSummaryShapeSeriesGeneric FastLaunchJobConfigSummaryShapeSeriesEnum = "GENERIC" FastLaunchJobConfigSummaryShapeSeriesLegacy FastLaunchJobConfigSummaryShapeSeriesEnum = "LEGACY" FastLaunchJobConfigSummaryShapeSeriesArm FastLaunchJobConfigSummaryShapeSeriesEnum = "ARM" ) @@ -75,6 +76,7 @@ var mappingFastLaunchJobConfigSummaryShapeSeriesEnum = map[string]FastLaunchJobC "AMD_ROME": FastLaunchJobConfigSummaryShapeSeriesAmdRome, "INTEL_SKYLAKE": FastLaunchJobConfigSummaryShapeSeriesIntelSkylake, "NVIDIA_GPU": FastLaunchJobConfigSummaryShapeSeriesNvidiaGpu, + "GENERIC": FastLaunchJobConfigSummaryShapeSeriesGeneric, "LEGACY": FastLaunchJobConfigSummaryShapeSeriesLegacy, "ARM": FastLaunchJobConfigSummaryShapeSeriesArm, } @@ -83,6 +85,7 @@ var mappingFastLaunchJobConfigSummaryShapeSeriesEnumLowerCase = map[string]FastL "amd_rome": FastLaunchJobConfigSummaryShapeSeriesAmdRome, "intel_skylake": FastLaunchJobConfigSummaryShapeSeriesIntelSkylake, "nvidia_gpu": FastLaunchJobConfigSummaryShapeSeriesNvidiaGpu, + "generic": FastLaunchJobConfigSummaryShapeSeriesGeneric, "legacy": FastLaunchJobConfigSummaryShapeSeriesLegacy, "arm": FastLaunchJobConfigSummaryShapeSeriesArm, } @@ -102,6 +105,7 @@ func GetFastLaunchJobConfigSummaryShapeSeriesEnumStringValues() []string { "AMD_ROME", "INTEL_SKYLAKE", "NVIDIA_GPU", + "GENERIC", "LEGACY", "ARM", } diff --git a/datascience/job_shape_summary.go b/datascience/job_shape_summary.go index bd56974ba7..9aed15cee8 100644 --- a/datascience/job_shape_summary.go +++ b/datascience/job_shape_summary.go @@ -58,6 +58,7 @@ const ( JobShapeSummaryShapeSeriesAmdRome JobShapeSummaryShapeSeriesEnum = "AMD_ROME" JobShapeSummaryShapeSeriesIntelSkylake JobShapeSummaryShapeSeriesEnum = "INTEL_SKYLAKE" JobShapeSummaryShapeSeriesNvidiaGpu JobShapeSummaryShapeSeriesEnum = "NVIDIA_GPU" + JobShapeSummaryShapeSeriesGeneric JobShapeSummaryShapeSeriesEnum = "GENERIC" JobShapeSummaryShapeSeriesLegacy JobShapeSummaryShapeSeriesEnum = "LEGACY" JobShapeSummaryShapeSeriesArm JobShapeSummaryShapeSeriesEnum = "ARM" ) @@ -66,6 +67,7 @@ var mappingJobShapeSummaryShapeSeriesEnum = map[string]JobShapeSummaryShapeSerie "AMD_ROME": JobShapeSummaryShapeSeriesAmdRome, "INTEL_SKYLAKE": JobShapeSummaryShapeSeriesIntelSkylake, "NVIDIA_GPU": JobShapeSummaryShapeSeriesNvidiaGpu, + "GENERIC": JobShapeSummaryShapeSeriesGeneric, "LEGACY": JobShapeSummaryShapeSeriesLegacy, "ARM": JobShapeSummaryShapeSeriesArm, } @@ -74,6 +76,7 @@ var mappingJobShapeSummaryShapeSeriesEnumLowerCase = map[string]JobShapeSummaryS "amd_rome": JobShapeSummaryShapeSeriesAmdRome, "intel_skylake": JobShapeSummaryShapeSeriesIntelSkylake, "nvidia_gpu": JobShapeSummaryShapeSeriesNvidiaGpu, + "generic": JobShapeSummaryShapeSeriesGeneric, "legacy": JobShapeSummaryShapeSeriesLegacy, "arm": JobShapeSummaryShapeSeriesArm, } @@ -93,6 +96,7 @@ func GetJobShapeSummaryShapeSeriesEnumStringValues() []string { "AMD_ROME", "INTEL_SKYLAKE", "NVIDIA_GPU", + "GENERIC", "LEGACY", "ARM", } diff --git a/datascience/model_deployment_shape_series.go b/datascience/model_deployment_shape_series.go index bfe0178c73..98fd217b94 100644 --- a/datascience/model_deployment_shape_series.go +++ b/datascience/model_deployment_shape_series.go @@ -21,6 +21,7 @@ const ( ModelDeploymentShapeSeriesAmdRome ModelDeploymentShapeSeriesEnum = "AMD_ROME" ModelDeploymentShapeSeriesIntelSkylake ModelDeploymentShapeSeriesEnum = "INTEL_SKYLAKE" ModelDeploymentShapeSeriesNvidiaGpu ModelDeploymentShapeSeriesEnum = "NVIDIA_GPU" + ModelDeploymentShapeSeriesGeneric ModelDeploymentShapeSeriesEnum = "GENERIC" ModelDeploymentShapeSeriesLegacy ModelDeploymentShapeSeriesEnum = "LEGACY" ModelDeploymentShapeSeriesArm ModelDeploymentShapeSeriesEnum = "ARM" ) @@ -29,6 +30,7 @@ var mappingModelDeploymentShapeSeriesEnum = map[string]ModelDeploymentShapeSerie "AMD_ROME": ModelDeploymentShapeSeriesAmdRome, "INTEL_SKYLAKE": ModelDeploymentShapeSeriesIntelSkylake, "NVIDIA_GPU": ModelDeploymentShapeSeriesNvidiaGpu, + "GENERIC": ModelDeploymentShapeSeriesGeneric, "LEGACY": ModelDeploymentShapeSeriesLegacy, "ARM": ModelDeploymentShapeSeriesArm, } @@ -37,6 +39,7 @@ var mappingModelDeploymentShapeSeriesEnumLowerCase = map[string]ModelDeploymentS "amd_rome": ModelDeploymentShapeSeriesAmdRome, "intel_skylake": ModelDeploymentShapeSeriesIntelSkylake, "nvidia_gpu": ModelDeploymentShapeSeriesNvidiaGpu, + "generic": ModelDeploymentShapeSeriesGeneric, "legacy": ModelDeploymentShapeSeriesLegacy, "arm": ModelDeploymentShapeSeriesArm, } @@ -56,6 +59,7 @@ func GetModelDeploymentShapeSeriesEnumStringValues() []string { "AMD_ROME", "INTEL_SKYLAKE", "NVIDIA_GPU", + "GENERIC", "LEGACY", "ARM", } diff --git a/datascience/notebook_session_shape_series.go b/datascience/notebook_session_shape_series.go index eba07fda46..247b04a392 100644 --- a/datascience/notebook_session_shape_series.go +++ b/datascience/notebook_session_shape_series.go @@ -21,6 +21,7 @@ const ( NotebookSessionShapeSeriesAmdRome NotebookSessionShapeSeriesEnum = "AMD_ROME" NotebookSessionShapeSeriesIntelSkylake NotebookSessionShapeSeriesEnum = "INTEL_SKYLAKE" NotebookSessionShapeSeriesNvidiaGpu NotebookSessionShapeSeriesEnum = "NVIDIA_GPU" + NotebookSessionShapeSeriesGeneric NotebookSessionShapeSeriesEnum = "GENERIC" NotebookSessionShapeSeriesLegacy NotebookSessionShapeSeriesEnum = "LEGACY" NotebookSessionShapeSeriesArm NotebookSessionShapeSeriesEnum = "ARM" ) @@ -29,6 +30,7 @@ var mappingNotebookSessionShapeSeriesEnum = map[string]NotebookSessionShapeSerie "AMD_ROME": NotebookSessionShapeSeriesAmdRome, "INTEL_SKYLAKE": NotebookSessionShapeSeriesIntelSkylake, "NVIDIA_GPU": NotebookSessionShapeSeriesNvidiaGpu, + "GENERIC": NotebookSessionShapeSeriesGeneric, "LEGACY": NotebookSessionShapeSeriesLegacy, "ARM": NotebookSessionShapeSeriesArm, } @@ -37,6 +39,7 @@ var mappingNotebookSessionShapeSeriesEnumLowerCase = map[string]NotebookSessionS "amd_rome": NotebookSessionShapeSeriesAmdRome, "intel_skylake": NotebookSessionShapeSeriesIntelSkylake, "nvidia_gpu": NotebookSessionShapeSeriesNvidiaGpu, + "generic": NotebookSessionShapeSeriesGeneric, "legacy": NotebookSessionShapeSeriesLegacy, "arm": NotebookSessionShapeSeriesArm, } @@ -56,6 +59,7 @@ func GetNotebookSessionShapeSeriesEnumStringValues() []string { "AMD_ROME", "INTEL_SKYLAKE", "NVIDIA_GPU", + "GENERIC", "LEGACY", "ARM", } diff --git a/datascience/pipeline_container_configuration_details.go b/datascience/pipeline_container_configuration_details.go new file mode 100644 index 0000000000..661bf8980d --- /dev/null +++ b/datascience/pipeline_container_configuration_details.go @@ -0,0 +1,115 @@ +// 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. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PipelineContainerConfigurationDetails Container Details for a step in pipeline. +type PipelineContainerConfigurationDetails interface { +} + +type pipelinecontainerconfigurationdetails struct { + JsonData []byte + ContainerType string `json:"containerType"` +} + +// UnmarshalJSON unmarshals json +func (m *pipelinecontainerconfigurationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerpipelinecontainerconfigurationdetails pipelinecontainerconfigurationdetails + s := struct { + Model Unmarshalerpipelinecontainerconfigurationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ContainerType = s.Model.ContainerType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *pipelinecontainerconfigurationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ContainerType { + case "OCIR_CONTAINER": + mm := PipelineOcirContainerConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for PipelineContainerConfigurationDetails: %s.", m.ContainerType) + return *m, nil + } +} + +func (m pipelinecontainerconfigurationdetails) 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 pipelinecontainerconfigurationdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PipelineContainerConfigurationDetailsContainerTypeEnum Enum with underlying type: string +type PipelineContainerConfigurationDetailsContainerTypeEnum string + +// Set of constants representing the allowable values for PipelineContainerConfigurationDetailsContainerTypeEnum +const ( + PipelineContainerConfigurationDetailsContainerTypeOcirContainer PipelineContainerConfigurationDetailsContainerTypeEnum = "OCIR_CONTAINER" +) + +var mappingPipelineContainerConfigurationDetailsContainerTypeEnum = map[string]PipelineContainerConfigurationDetailsContainerTypeEnum{ + "OCIR_CONTAINER": PipelineContainerConfigurationDetailsContainerTypeOcirContainer, +} + +var mappingPipelineContainerConfigurationDetailsContainerTypeEnumLowerCase = map[string]PipelineContainerConfigurationDetailsContainerTypeEnum{ + "ocir_container": PipelineContainerConfigurationDetailsContainerTypeOcirContainer, +} + +// GetPipelineContainerConfigurationDetailsContainerTypeEnumValues Enumerates the set of values for PipelineContainerConfigurationDetailsContainerTypeEnum +func GetPipelineContainerConfigurationDetailsContainerTypeEnumValues() []PipelineContainerConfigurationDetailsContainerTypeEnum { + values := make([]PipelineContainerConfigurationDetailsContainerTypeEnum, 0) + for _, v := range mappingPipelineContainerConfigurationDetailsContainerTypeEnum { + values = append(values, v) + } + return values +} + +// GetPipelineContainerConfigurationDetailsContainerTypeEnumStringValues Enumerates the set of values in String for PipelineContainerConfigurationDetailsContainerTypeEnum +func GetPipelineContainerConfigurationDetailsContainerTypeEnumStringValues() []string { + return []string{ + "OCIR_CONTAINER", + } +} + +// GetMappingPipelineContainerConfigurationDetailsContainerTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPipelineContainerConfigurationDetailsContainerTypeEnum(val string) (PipelineContainerConfigurationDetailsContainerTypeEnum, bool) { + enum, ok := mappingPipelineContainerConfigurationDetailsContainerTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/datascience/pipeline_container_step_details.go b/datascience/pipeline_container_step_details.go new file mode 100644 index 0000000000..5099631d7f --- /dev/null +++ b/datascience/pipeline_container_step_details.go @@ -0,0 +1,131 @@ +// 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. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PipelineContainerStepDetails The type of step where user provides the container details for an execution engine managed by the pipelines service. +type PipelineContainerStepDetails struct { + + // The name of the step. It must be unique within the pipeline. This is used to create the pipeline DAG. + StepName *string `mandatory:"true" json:"stepName"` + + StepContainerConfigurationDetails PipelineContainerConfigurationDetails `mandatory:"true" json:"stepContainerConfigurationDetails"` + + // A short description of the step. + Description *string `mandatory:"false" json:"description"` + + // The list of step names this current step depends on for execution. + DependsOn []string `mandatory:"false" json:"dependsOn"` + + StepConfigurationDetails *PipelineStepConfigurationDetails `mandatory:"false" json:"stepConfigurationDetails"` + + StepInfrastructureConfigurationDetails *PipelineInfrastructureConfigurationDetails `mandatory:"false" json:"stepInfrastructureConfigurationDetails"` + + // A flag to indicate whether the artifact has been uploaded for this step or not. + IsArtifactUploaded *bool `mandatory:"false" json:"isArtifactUploaded"` +} + +// GetStepName returns StepName +func (m PipelineContainerStepDetails) GetStepName() *string { + return m.StepName +} + +// GetDescription returns Description +func (m PipelineContainerStepDetails) GetDescription() *string { + return m.Description +} + +// GetDependsOn returns DependsOn +func (m PipelineContainerStepDetails) GetDependsOn() []string { + return m.DependsOn +} + +// GetStepConfigurationDetails returns StepConfigurationDetails +func (m PipelineContainerStepDetails) GetStepConfigurationDetails() *PipelineStepConfigurationDetails { + return m.StepConfigurationDetails +} + +func (m PipelineContainerStepDetails) 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 PipelineContainerStepDetails) 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 PipelineContainerStepDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypePipelineContainerStepDetails PipelineContainerStepDetails + s := struct { + DiscriminatorParam string `json:"stepType"` + MarshalTypePipelineContainerStepDetails + }{ + "CONTAINER", + (MarshalTypePipelineContainerStepDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *PipelineContainerStepDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Description *string `json:"description"` + DependsOn []string `json:"dependsOn"` + StepConfigurationDetails *PipelineStepConfigurationDetails `json:"stepConfigurationDetails"` + StepInfrastructureConfigurationDetails *PipelineInfrastructureConfigurationDetails `json:"stepInfrastructureConfigurationDetails"` + IsArtifactUploaded *bool `json:"isArtifactUploaded"` + StepName *string `json:"stepName"` + StepContainerConfigurationDetails pipelinecontainerconfigurationdetails `json:"stepContainerConfigurationDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Description = model.Description + + m.DependsOn = make([]string, len(model.DependsOn)) + copy(m.DependsOn, model.DependsOn) + m.StepConfigurationDetails = model.StepConfigurationDetails + + m.StepInfrastructureConfigurationDetails = model.StepInfrastructureConfigurationDetails + + m.IsArtifactUploaded = model.IsArtifactUploaded + + m.StepName = model.StepName + + nn, e = model.StepContainerConfigurationDetails.UnmarshalPolymorphicJSON(model.StepContainerConfigurationDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.StepContainerConfigurationDetails = nn.(PipelineContainerConfigurationDetails) + } else { + m.StepContainerConfigurationDetails = nil + } + + return +} diff --git a/datascience/pipeline_container_step_run.go b/datascience/pipeline_container_step_run.go new file mode 100644 index 0000000000..b5891919eb --- /dev/null +++ b/datascience/pipeline_container_step_run.go @@ -0,0 +1,94 @@ +// 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. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PipelineContainerStepRun Detail of each ContainerStepRun. +type PipelineContainerStepRun struct { + + // The date and time the pipeline step run was started in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + TimeStarted *common.SDKTime `mandatory:"true" json:"timeStarted"` + + // The name of the step. + StepName *string `mandatory:"true" json:"stepName"` + + // The date and time the pipeline step run finshed executing in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // Details of the state of the step run. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The state of the step run. + LifecycleState PipelineStepRunLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +// GetTimeStarted returns TimeStarted +func (m PipelineContainerStepRun) GetTimeStarted() *common.SDKTime { + return m.TimeStarted +} + +// GetTimeFinished returns TimeFinished +func (m PipelineContainerStepRun) GetTimeFinished() *common.SDKTime { + return m.TimeFinished +} + +// GetStepName returns StepName +func (m PipelineContainerStepRun) GetStepName() *string { + return m.StepName +} + +// GetLifecycleState returns LifecycleState +func (m PipelineContainerStepRun) GetLifecycleState() PipelineStepRunLifecycleStateEnum { + return m.LifecycleState +} + +// GetLifecycleDetails returns LifecycleDetails +func (m PipelineContainerStepRun) GetLifecycleDetails() *string { + return m.LifecycleDetails +} + +func (m PipelineContainerStepRun) 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 PipelineContainerStepRun) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingPipelineStepRunLifecycleStateEnum(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(GetPipelineStepRunLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PipelineContainerStepRun) MarshalJSON() (buff []byte, e error) { + type MarshalTypePipelineContainerStepRun PipelineContainerStepRun + s := struct { + DiscriminatorParam string `json:"stepType"` + MarshalTypePipelineContainerStepRun + }{ + "CONTAINER", + (MarshalTypePipelineContainerStepRun)(m), + } + + return json.Marshal(&s) +} diff --git a/datascience/pipeline_container_step_update_details.go b/datascience/pipeline_container_step_update_details.go new file mode 100644 index 0000000000..dc5efe62b7 --- /dev/null +++ b/datascience/pipeline_container_step_update_details.go @@ -0,0 +1,76 @@ +// 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. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PipelineContainerStepUpdateDetails Update the details for a container step type. +type PipelineContainerStepUpdateDetails struct { + + // The name of the step. + StepName *string `mandatory:"true" json:"stepName"` + + // A short description of the step. + Description *string `mandatory:"false" json:"description"` + + StepConfigurationDetails *PipelineStepConfigurationDetails `mandatory:"false" json:"stepConfigurationDetails"` + + StepInfrastructureConfigurationDetails *PipelineInfrastructureConfigurationDetails `mandatory:"false" json:"stepInfrastructureConfigurationDetails"` +} + +// GetStepName returns StepName +func (m PipelineContainerStepUpdateDetails) GetStepName() *string { + return m.StepName +} + +// GetDescription returns Description +func (m PipelineContainerStepUpdateDetails) GetDescription() *string { + return m.Description +} + +// GetStepConfigurationDetails returns StepConfigurationDetails +func (m PipelineContainerStepUpdateDetails) GetStepConfigurationDetails() *PipelineStepConfigurationDetails { + return m.StepConfigurationDetails +} + +func (m PipelineContainerStepUpdateDetails) 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 PipelineContainerStepUpdateDetails) 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 PipelineContainerStepUpdateDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypePipelineContainerStepUpdateDetails PipelineContainerStepUpdateDetails + s := struct { + DiscriminatorParam string `json:"stepType"` + MarshalTypePipelineContainerStepUpdateDetails + }{ + "CONTAINER", + (MarshalTypePipelineContainerStepUpdateDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/datascience/pipeline_custom_script_step_update_details.go b/datascience/pipeline_custom_script_step_update_details.go index a2f0b521d7..bf447ffc15 100644 --- a/datascience/pipeline_custom_script_step_update_details.go +++ b/datascience/pipeline_custom_script_step_update_details.go @@ -26,6 +26,8 @@ type PipelineCustomScriptStepUpdateDetails struct { Description *string `mandatory:"false" json:"description"` StepConfigurationDetails *PipelineStepConfigurationDetails `mandatory:"false" json:"stepConfigurationDetails"` + + StepInfrastructureConfigurationDetails *PipelineInfrastructureConfigurationDetails `mandatory:"false" json:"stepInfrastructureConfigurationDetails"` } // GetStepName returns StepName diff --git a/datascience/pipeline_infrastructure_configuration_details.go b/datascience/pipeline_infrastructure_configuration_details.go index 1b5896c018..425538f97c 100644 --- a/datascience/pipeline_infrastructure_configuration_details.go +++ b/datascience/pipeline_infrastructure_configuration_details.go @@ -24,6 +24,9 @@ type PipelineInfrastructureConfigurationDetails struct { // The size of the block storage volume to attach to the instance. BlockStorageSizeInGBs *int `mandatory:"true" json:"blockStorageSizeInGBs"` + // The subnet to create a secondary vnic in to attach to the instance running the pipeline step. + SubnetId *string `mandatory:"false" json:"subnetId"` + ShapeConfigDetails *PipelineShapeConfigDetails `mandatory:"false" json:"shapeConfigDetails"` } diff --git a/datascience/pipeline_ocir_container_configuration_details.go b/datascience/pipeline_ocir_container_configuration_details.go new file mode 100644 index 0000000000..71b5abefa9 --- /dev/null +++ b/datascience/pipeline_ocir_container_configuration_details.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PipelineOcirContainerConfigurationDetails Container configuration based on image stored in OCI Container Registry. +type PipelineOcirContainerConfigurationDetails struct { + + // The full path to the Oracle Container Repository (OCIR) registry, image, and tag in a canonical format. + Image *string `mandatory:"true" json:"image"` + + // The container image run CMD (https://docs.docker.com/engine/reference/builder/#cmd) as a list of strings. + // Use `CMD` as arguments to the `ENTRYPOINT` or the only command to run in the absence of an `ENTRYPOINT`. + // The combined size of `CMD` and `ENTRYPOINT` must be less than 2048 bytes. + Cmd []string `mandatory:"false" json:"cmd"` + + // The container image run ENTRYPOINT (https://docs.docker.com/engine/reference/builder/#entrypoint) as a list of strings. + // Accept the `CMD` as extra arguments. + // The combined size of `CMD` and `ENTRYPOINT` must be less than 2048 bytes. + // More information on how `CMD` and `ENTRYPOINT` interact are here (https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). + Entrypoint []string `mandatory:"false" json:"entrypoint"` + + // The digest of the container image. For example, + // `sha256:881303a6b2738834d795a32b4a98eb0e5e3d1cad590a712d1e04f9b2fa90a030` + ImageDigest *string `mandatory:"false" json:"imageDigest"` + + // OCID of the container image signature + ImageSignatureId *string `mandatory:"false" json:"imageSignatureId"` +} + +func (m PipelineOcirContainerConfigurationDetails) 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 PipelineOcirContainerConfigurationDetails) 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 PipelineOcirContainerConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypePipelineOcirContainerConfigurationDetails PipelineOcirContainerConfigurationDetails + s := struct { + DiscriminatorParam string `json:"containerType"` + MarshalTypePipelineOcirContainerConfigurationDetails + }{ + "OCIR_CONTAINER", + (MarshalTypePipelineOcirContainerConfigurationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/datascience/pipeline_step_details.go b/datascience/pipeline_step_details.go index fb4d2d25d6..c48ff910c1 100644 --- a/datascience/pipeline_step_details.go +++ b/datascience/pipeline_step_details.go @@ -69,6 +69,10 @@ func (m *pipelinestepdetails) UnmarshalPolymorphicJSON(data []byte) (interface{} var err error switch m.StepType { + case "CONTAINER": + mm := PipelineContainerStepDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "ML_JOB": mm := PipelineMlJobStepDetails{} err = json.Unmarshal(data, &mm) @@ -126,16 +130,19 @@ type PipelineStepDetailsStepTypeEnum string const ( PipelineStepDetailsStepTypeMlJob PipelineStepDetailsStepTypeEnum = "ML_JOB" PipelineStepDetailsStepTypeCustomScript PipelineStepDetailsStepTypeEnum = "CUSTOM_SCRIPT" + PipelineStepDetailsStepTypeContainer PipelineStepDetailsStepTypeEnum = "CONTAINER" ) var mappingPipelineStepDetailsStepTypeEnum = map[string]PipelineStepDetailsStepTypeEnum{ "ML_JOB": PipelineStepDetailsStepTypeMlJob, "CUSTOM_SCRIPT": PipelineStepDetailsStepTypeCustomScript, + "CONTAINER": PipelineStepDetailsStepTypeContainer, } var mappingPipelineStepDetailsStepTypeEnumLowerCase = map[string]PipelineStepDetailsStepTypeEnum{ "ml_job": PipelineStepDetailsStepTypeMlJob, "custom_script": PipelineStepDetailsStepTypeCustomScript, + "container": PipelineStepDetailsStepTypeContainer, } // GetPipelineStepDetailsStepTypeEnumValues Enumerates the set of values for PipelineStepDetailsStepTypeEnum @@ -152,6 +159,7 @@ func GetPipelineStepDetailsStepTypeEnumStringValues() []string { return []string{ "ML_JOB", "CUSTOM_SCRIPT", + "CONTAINER", } } diff --git a/datascience/pipeline_step_override_details.go b/datascience/pipeline_step_override_details.go index 73e616bdad..aaa7d6776f 100644 --- a/datascience/pipeline_step_override_details.go +++ b/datascience/pipeline_step_override_details.go @@ -10,6 +10,7 @@ package datascience import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -22,6 +23,8 @@ type PipelineStepOverrideDetails struct { StepName *string `mandatory:"true" json:"stepName"` StepConfigurationDetails *PipelineStepConfigurationDetails `mandatory:"true" json:"stepConfigurationDetails"` + + StepContainerConfigurationDetails PipelineContainerConfigurationDetails `mandatory:"false" json:"stepContainerConfigurationDetails"` } func (m PipelineStepOverrideDetails) String() string { @@ -39,3 +42,33 @@ func (m PipelineStepOverrideDetails) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *PipelineStepOverrideDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + StepContainerConfigurationDetails pipelinecontainerconfigurationdetails `json:"stepContainerConfigurationDetails"` + StepName *string `json:"stepName"` + StepConfigurationDetails *PipelineStepConfigurationDetails `json:"stepConfigurationDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.StepContainerConfigurationDetails.UnmarshalPolymorphicJSON(model.StepContainerConfigurationDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.StepContainerConfigurationDetails = nn.(PipelineContainerConfigurationDetails) + } else { + m.StepContainerConfigurationDetails = nil + } + + m.StepName = model.StepName + + m.StepConfigurationDetails = model.StepConfigurationDetails + + return +} diff --git a/datascience/pipeline_step_run.go b/datascience/pipeline_step_run.go index 16f86f8911..398ab7a455 100644 --- a/datascience/pipeline_step_run.go +++ b/datascience/pipeline_step_run.go @@ -75,6 +75,10 @@ func (m *pipelinesteprun) UnmarshalPolymorphicJSON(data []byte) (interface{}, er var err error switch m.StepType { + case "CONTAINER": + mm := PipelineContainerStepRun{} + err = json.Unmarshal(data, &mm) + return mm, err case "CUSTOM_SCRIPT": mm := PipelineCustomScriptStepRun{} err = json.Unmarshal(data, &mm) @@ -210,16 +214,19 @@ type PipelineStepRunStepTypeEnum string const ( PipelineStepRunStepTypeMlJob PipelineStepRunStepTypeEnum = "ML_JOB" PipelineStepRunStepTypeCustomScript PipelineStepRunStepTypeEnum = "CUSTOM_SCRIPT" + PipelineStepRunStepTypeContainer PipelineStepRunStepTypeEnum = "CONTAINER" ) var mappingPipelineStepRunStepTypeEnum = map[string]PipelineStepRunStepTypeEnum{ "ML_JOB": PipelineStepRunStepTypeMlJob, "CUSTOM_SCRIPT": PipelineStepRunStepTypeCustomScript, + "CONTAINER": PipelineStepRunStepTypeContainer, } var mappingPipelineStepRunStepTypeEnumLowerCase = map[string]PipelineStepRunStepTypeEnum{ "ml_job": PipelineStepRunStepTypeMlJob, "custom_script": PipelineStepRunStepTypeCustomScript, + "container": PipelineStepRunStepTypeContainer, } // GetPipelineStepRunStepTypeEnumValues Enumerates the set of values for PipelineStepRunStepTypeEnum @@ -236,6 +243,7 @@ func GetPipelineStepRunStepTypeEnumStringValues() []string { return []string{ "ML_JOB", "CUSTOM_SCRIPT", + "CONTAINER", } } diff --git a/datascience/pipeline_step_update_details.go b/datascience/pipeline_step_update_details.go index bf56fae865..202eeab0c7 100644 --- a/datascience/pipeline_step_update_details.go +++ b/datascience/pipeline_step_update_details.go @@ -72,6 +72,10 @@ func (m *pipelinestepupdatedetails) UnmarshalPolymorphicJSON(data []byte) (inter mm := PipelineCustomScriptStepUpdateDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "CONTAINER": + mm := PipelineContainerStepUpdateDetails{} + err = json.Unmarshal(data, &mm) + return mm, err default: common.Logf("Recieved unsupported enum value for PipelineStepUpdateDetails: %s.", m.StepType) return *m, nil @@ -116,16 +120,19 @@ type PipelineStepUpdateDetailsStepTypeEnum string const ( PipelineStepUpdateDetailsStepTypeMlJob PipelineStepUpdateDetailsStepTypeEnum = "ML_JOB" PipelineStepUpdateDetailsStepTypeCustomScript PipelineStepUpdateDetailsStepTypeEnum = "CUSTOM_SCRIPT" + PipelineStepUpdateDetailsStepTypeContainer PipelineStepUpdateDetailsStepTypeEnum = "CONTAINER" ) var mappingPipelineStepUpdateDetailsStepTypeEnum = map[string]PipelineStepUpdateDetailsStepTypeEnum{ "ML_JOB": PipelineStepUpdateDetailsStepTypeMlJob, "CUSTOM_SCRIPT": PipelineStepUpdateDetailsStepTypeCustomScript, + "CONTAINER": PipelineStepUpdateDetailsStepTypeContainer, } var mappingPipelineStepUpdateDetailsStepTypeEnumLowerCase = map[string]PipelineStepUpdateDetailsStepTypeEnum{ "ml_job": PipelineStepUpdateDetailsStepTypeMlJob, "custom_script": PipelineStepUpdateDetailsStepTypeCustomScript, + "container": PipelineStepUpdateDetailsStepTypeContainer, } // GetPipelineStepUpdateDetailsStepTypeEnumValues Enumerates the set of values for PipelineStepUpdateDetailsStepTypeEnum @@ -142,6 +149,7 @@ func GetPipelineStepUpdateDetailsStepTypeEnumStringValues() []string { return []string{ "ML_JOB", "CUSTOM_SCRIPT", + "CONTAINER", } } diff --git a/datascience/update_pipeline_details.go b/datascience/update_pipeline_details.go index 7a7ae79e3e..204df3ace5 100644 --- a/datascience/update_pipeline_details.go +++ b/datascience/update_pipeline_details.go @@ -27,9 +27,11 @@ type UpdatePipelineDetails struct { ConfigurationDetails PipelineConfigurationDetails `mandatory:"false" json:"configurationDetails"` + InfrastructureConfigurationDetails *PipelineInfrastructureConfigurationDetails `mandatory:"false" json:"infrastructureConfigurationDetails"` + LogConfigurationDetails *PipelineLogConfigurationDetails `mandatory:"false" json:"logConfigurationDetails"` - // Array of update details for each step. Only step configurations are allowed to be updated. + // Array of update details for each step. Only step configurations and step infrastructure configurations are allowed to be updated. StepDetails []PipelineStepUpdateDetails `mandatory:"false" json:"stepDetails"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). @@ -60,13 +62,14 @@ func (m UpdatePipelineDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *UpdatePipelineDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - DisplayName *string `json:"displayName"` - Description *string `json:"description"` - ConfigurationDetails pipelineconfigurationdetails `json:"configurationDetails"` - LogConfigurationDetails *PipelineLogConfigurationDetails `json:"logConfigurationDetails"` - StepDetails []pipelinestepupdatedetails `json:"stepDetails"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + ConfigurationDetails pipelineconfigurationdetails `json:"configurationDetails"` + InfrastructureConfigurationDetails *PipelineInfrastructureConfigurationDetails `json:"infrastructureConfigurationDetails"` + LogConfigurationDetails *PipelineLogConfigurationDetails `json:"logConfigurationDetails"` + StepDetails []pipelinestepupdatedetails `json:"stepDetails"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` }{} e = json.Unmarshal(data, &model) @@ -88,6 +91,8 @@ func (m *UpdatePipelineDetails) UnmarshalJSON(data []byte) (e error) { m.ConfigurationDetails = nil } + m.InfrastructureConfigurationDetails = model.InfrastructureConfigurationDetails + m.LogConfigurationDetails = model.LogConfigurationDetails m.StepDetails = make([]PipelineStepUpdateDetails, len(model.StepDetails)) diff --git a/resourcescheduler/action_type.go b/resourcescheduler/action_type.go new file mode 100644 index 0000000000..ca4fd407fd --- /dev/null +++ b/resourcescheduler/action_type.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "strings" +) + +// ActionTypeEnum Enum with underlying type: string +type ActionTypeEnum string + +// Set of constants representing the allowable values for ActionTypeEnum +const ( + ActionTypeCreated ActionTypeEnum = "CREATED" + ActionTypeUpdated ActionTypeEnum = "UPDATED" + ActionTypeDeleted ActionTypeEnum = "DELETED" + ActionTypeInProgress ActionTypeEnum = "IN_PROGRESS" + ActionTypeRelated ActionTypeEnum = "RELATED" + ActionTypeFailed ActionTypeEnum = "FAILED" +) + +var mappingActionTypeEnum = map[string]ActionTypeEnum{ + "CREATED": ActionTypeCreated, + "UPDATED": ActionTypeUpdated, + "DELETED": ActionTypeDeleted, + "IN_PROGRESS": ActionTypeInProgress, + "RELATED": ActionTypeRelated, + "FAILED": ActionTypeFailed, +} + +var mappingActionTypeEnumLowerCase = map[string]ActionTypeEnum{ + "created": ActionTypeCreated, + "updated": ActionTypeUpdated, + "deleted": ActionTypeDeleted, + "in_progress": ActionTypeInProgress, + "related": ActionTypeRelated, + "failed": ActionTypeFailed, +} + +// GetActionTypeEnumValues Enumerates the set of values for ActionTypeEnum +func GetActionTypeEnumValues() []ActionTypeEnum { + values := make([]ActionTypeEnum, 0) + for _, v := range mappingActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetActionTypeEnumStringValues Enumerates the set of values in String for ActionTypeEnum +func GetActionTypeEnumStringValues() []string { + return []string{ + "CREATED", + "UPDATED", + "DELETED", + "IN_PROGRESS", + "RELATED", + "FAILED", + } +} + +// GetMappingActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingActionTypeEnum(val string) (ActionTypeEnum, bool) { + enum, ok := mappingActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/activate_schedule_request_response.go b/resourcescheduler/activate_schedule_request_response.go new file mode 100644 index 0000000000..f555337bc6 --- /dev/null +++ b/resourcescheduler/activate_schedule_request_response.go @@ -0,0 +1,109 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ActivateScheduleRequest wrapper for the ActivateSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ActivateSchedule.go.html to see an example of how to use ActivateScheduleRequest. +type ActivateScheduleRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the schedule. + ScheduleId *string `mandatory:"true" contributesTo:"path" name:"scheduleId"` + + // This is used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // This is a token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of running that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 ActivateScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ActivateScheduleRequest) 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 ActivateScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ActivateScheduleRequest) 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 ActivateScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ActivateScheduleResponse wrapper for the ActivateSchedule operation +type ActivateScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Schedule instance + Schedule `presentIn:"body"` + + // This is a 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"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response ActivateScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ActivateScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/resourcescheduler/cancel_work_request_request_response.go b/resourcescheduler/cancel_work_request_request_response.go new file mode 100644 index 0000000000..460993d933 --- /dev/null +++ b/resourcescheduler/cancel_work_request_request_response.go @@ -0,0 +1,96 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelWorkRequestRequest wrapper for the CancelWorkRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/CancelWorkRequest.go.html to see an example of how to use CancelWorkRequestRequest. +type CancelWorkRequestRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // This is used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 CancelWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelWorkRequestRequest) 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 CancelWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelWorkRequestRequest) 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 CancelWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelWorkRequestResponse wrapper for the CancelWorkRequest operation +type CancelWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // This is a 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 CancelWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/resourcescheduler/compartment_id_resource_filter.go b/resourcescheduler/compartment_id_resource_filter.go new file mode 100644 index 0000000000..382ae56c03 --- /dev/null +++ b/resourcescheduler/compartment_id_resource_filter.go @@ -0,0 +1,57 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CompartmentIdResourceFilter This is a resource filter for filtering resource based on compartment OCID. +type CompartmentIdResourceFilter struct { + + // This is the compartment used for filtering. + Value *string `mandatory:"false" json:"value"` + + // This sets whether to include child compartments. + ShouldIncludeChildCompartments *bool `mandatory:"false" json:"shouldIncludeChildCompartments"` +} + +func (m CompartmentIdResourceFilter) 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 CompartmentIdResourceFilter) 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 CompartmentIdResourceFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCompartmentIdResourceFilter CompartmentIdResourceFilter + s := struct { + DiscriminatorParam string `json:"attribute"` + MarshalTypeCompartmentIdResourceFilter + }{ + "COMPARTMENT_ID", + (MarshalTypeCompartmentIdResourceFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcescheduler/create_schedule_details.go b/resourcescheduler/create_schedule_details.go new file mode 100644 index 0000000000..e67d04a9d9 --- /dev/null +++ b/resourcescheduler/create_schedule_details.go @@ -0,0 +1,229 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateScheduleDetails This is the data to create a schedule. +type CreateScheduleDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which the schedule is created + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // This is the action that will be executed by the schedule. + Action CreateScheduleDetailsActionEnum `mandatory:"true" json:"action"` + + // This is the frequency of recurrence of a schedule. The frequency field can either conform to RFC-5545 formatting + // or UNIX cron formatting for recurrences, based on the value specified by the recurrenceType field. + RecurrenceDetails *string `mandatory:"true" json:"recurrenceDetails"` + + // Type of recurrence of a schedule + RecurrenceType CreateScheduleDetailsRecurrenceTypeEnum `mandatory:"true" json:"recurrenceType"` + + // This is a user-friendly name for the schedule. It does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"false" json:"displayName"` + + // This is the description of the schedule. + Description *string `mandatory:"false" json:"description"` + + // This is a list of resources filters. The schedule will be applied to resources matching all of them. + ResourceFilters []ResourceFilter `mandatory:"false" json:"resourceFilters"` + + // This is the list of resources to which the scheduled operation is applied. + Resources []Resource `mandatory:"false" json:"resources"` + + // This is the date and time the schedule starts, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeStarts *common.SDKTime `mandatory:"false" json:"timeStarts"` + + // This is the date and time the schedule ends, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeEnds *common.SDKTime `mandatory:"false" json:"timeEnds"` + + // These are free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // These are 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/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateScheduleDetails) 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 CreateScheduleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCreateScheduleDetailsActionEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetCreateScheduleDetailsActionEnumStringValues(), ","))) + } + if _, ok := GetMappingCreateScheduleDetailsRecurrenceTypeEnum(string(m.RecurrenceType)); !ok && m.RecurrenceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RecurrenceType: %s. Supported values are: %s.", m.RecurrenceType, strings.Join(GetCreateScheduleDetailsRecurrenceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *CreateScheduleDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + ResourceFilters []resourcefilter `json:"resourceFilters"` + Resources []Resource `json:"resources"` + TimeStarts *common.SDKTime `json:"timeStarts"` + TimeEnds *common.SDKTime `json:"timeEnds"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + CompartmentId *string `json:"compartmentId"` + Action CreateScheduleDetailsActionEnum `json:"action"` + RecurrenceDetails *string `json:"recurrenceDetails"` + RecurrenceType CreateScheduleDetailsRecurrenceTypeEnum `json:"recurrenceType"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Description = model.Description + + m.ResourceFilters = make([]ResourceFilter, len(model.ResourceFilters)) + for i, n := range model.ResourceFilters { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.ResourceFilters[i] = nn.(ResourceFilter) + } else { + m.ResourceFilters[i] = nil + } + } + m.Resources = make([]Resource, len(model.Resources)) + copy(m.Resources, model.Resources) + m.TimeStarts = model.TimeStarts + + m.TimeEnds = model.TimeEnds + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.CompartmentId = model.CompartmentId + + m.Action = model.Action + + m.RecurrenceDetails = model.RecurrenceDetails + + m.RecurrenceType = model.RecurrenceType + + return +} + +// CreateScheduleDetailsActionEnum Enum with underlying type: string +type CreateScheduleDetailsActionEnum string + +// Set of constants representing the allowable values for CreateScheduleDetailsActionEnum +const ( + CreateScheduleDetailsActionStartResource CreateScheduleDetailsActionEnum = "START_RESOURCE" + CreateScheduleDetailsActionStopResource CreateScheduleDetailsActionEnum = "STOP_RESOURCE" +) + +var mappingCreateScheduleDetailsActionEnum = map[string]CreateScheduleDetailsActionEnum{ + "START_RESOURCE": CreateScheduleDetailsActionStartResource, + "STOP_RESOURCE": CreateScheduleDetailsActionStopResource, +} + +var mappingCreateScheduleDetailsActionEnumLowerCase = map[string]CreateScheduleDetailsActionEnum{ + "start_resource": CreateScheduleDetailsActionStartResource, + "stop_resource": CreateScheduleDetailsActionStopResource, +} + +// GetCreateScheduleDetailsActionEnumValues Enumerates the set of values for CreateScheduleDetailsActionEnum +func GetCreateScheduleDetailsActionEnumValues() []CreateScheduleDetailsActionEnum { + values := make([]CreateScheduleDetailsActionEnum, 0) + for _, v := range mappingCreateScheduleDetailsActionEnum { + values = append(values, v) + } + return values +} + +// GetCreateScheduleDetailsActionEnumStringValues Enumerates the set of values in String for CreateScheduleDetailsActionEnum +func GetCreateScheduleDetailsActionEnumStringValues() []string { + return []string{ + "START_RESOURCE", + "STOP_RESOURCE", + } +} + +// GetMappingCreateScheduleDetailsActionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateScheduleDetailsActionEnum(val string) (CreateScheduleDetailsActionEnum, bool) { + enum, ok := mappingCreateScheduleDetailsActionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// CreateScheduleDetailsRecurrenceTypeEnum Enum with underlying type: string +type CreateScheduleDetailsRecurrenceTypeEnum string + +// Set of constants representing the allowable values for CreateScheduleDetailsRecurrenceTypeEnum +const ( + CreateScheduleDetailsRecurrenceTypeCron CreateScheduleDetailsRecurrenceTypeEnum = "CRON" + CreateScheduleDetailsRecurrenceTypeIcal CreateScheduleDetailsRecurrenceTypeEnum = "ICAL" +) + +var mappingCreateScheduleDetailsRecurrenceTypeEnum = map[string]CreateScheduleDetailsRecurrenceTypeEnum{ + "CRON": CreateScheduleDetailsRecurrenceTypeCron, + "ICAL": CreateScheduleDetailsRecurrenceTypeIcal, +} + +var mappingCreateScheduleDetailsRecurrenceTypeEnumLowerCase = map[string]CreateScheduleDetailsRecurrenceTypeEnum{ + "cron": CreateScheduleDetailsRecurrenceTypeCron, + "ical": CreateScheduleDetailsRecurrenceTypeIcal, +} + +// GetCreateScheduleDetailsRecurrenceTypeEnumValues Enumerates the set of values for CreateScheduleDetailsRecurrenceTypeEnum +func GetCreateScheduleDetailsRecurrenceTypeEnumValues() []CreateScheduleDetailsRecurrenceTypeEnum { + values := make([]CreateScheduleDetailsRecurrenceTypeEnum, 0) + for _, v := range mappingCreateScheduleDetailsRecurrenceTypeEnum { + values = append(values, v) + } + return values +} + +// GetCreateScheduleDetailsRecurrenceTypeEnumStringValues Enumerates the set of values in String for CreateScheduleDetailsRecurrenceTypeEnum +func GetCreateScheduleDetailsRecurrenceTypeEnumStringValues() []string { + return []string{ + "CRON", + "ICAL", + } +} + +// GetMappingCreateScheduleDetailsRecurrenceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateScheduleDetailsRecurrenceTypeEnum(val string) (CreateScheduleDetailsRecurrenceTypeEnum, bool) { + enum, ok := mappingCreateScheduleDetailsRecurrenceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/create_schedule_request_response.go b/resourcescheduler/create_schedule_request_response.go new file mode 100644 index 0000000000..e36564bb60 --- /dev/null +++ b/resourcescheduler/create_schedule_request_response.go @@ -0,0 +1,113 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateScheduleRequest wrapper for the CreateSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/CreateSchedule.go.html to see an example of how to use CreateScheduleRequest. +type CreateScheduleRequest struct { + + // This API shows the details of the new schedule + CreateScheduleDetails `contributesTo:"body"` + + // This is a token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of running that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 CreateScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateScheduleRequest) 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 CreateScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateScheduleRequest) 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 CreateScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateScheduleResponse wrapper for the CreateSchedule operation +type CreateScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Schedule instance + Schedule `presentIn:"body"` + + // This is the URL for the created schedule. The schedule OCID is generated after this request is sent. + Location *string `presentIn:"header" name:"location"` + + // This is the same as location + ContentLocation *string `presentIn:"header" name:"content-location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // This is a 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 CreateScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/resourcescheduler/deactivate_schedule_request_response.go b/resourcescheduler/deactivate_schedule_request_response.go new file mode 100644 index 0000000000..19561416c9 --- /dev/null +++ b/resourcescheduler/deactivate_schedule_request_response.go @@ -0,0 +1,109 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeactivateScheduleRequest wrapper for the DeactivateSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/DeactivateSchedule.go.html to see an example of how to use DeactivateScheduleRequest. +type DeactivateScheduleRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the schedule. + ScheduleId *string `mandatory:"true" contributesTo:"path" name:"scheduleId"` + + // This is used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // This is a token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of running that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 DeactivateScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeactivateScheduleRequest) 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 DeactivateScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeactivateScheduleRequest) 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 DeactivateScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeactivateScheduleResponse wrapper for the DeactivateSchedule operation +type DeactivateScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Schedule instance + Schedule `presentIn:"body"` + + // This is a 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"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response DeactivateScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeactivateScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/resourcescheduler/defined_tag_filter_value.go b/resourcescheduler/defined_tag_filter_value.go new file mode 100644 index 0000000000..7179903d8a --- /dev/null +++ b/resourcescheduler/defined_tag_filter_value.go @@ -0,0 +1,45 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DefinedTagFilterValue This is a defined tag filter value. +type DefinedTagFilterValue struct { + + // This is the namespace of the defined tag. + Namespace *string `mandatory:"false" json:"namespace"` + + // This is the key of the defined tag. + TagKey *string `mandatory:"false" json:"tagKey"` + + // This is the value of the defined tag. + Value *string `mandatory:"false" json:"value"` +} + +func (m DefinedTagFilterValue) 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 DefinedTagFilterValue) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/defined_tags_resource_filter.go b/resourcescheduler/defined_tags_resource_filter.go new file mode 100644 index 0000000000..773d9fff04 --- /dev/null +++ b/resourcescheduler/defined_tags_resource_filter.go @@ -0,0 +1,54 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DefinedTagsResourceFilter This is a resource filter for filtering resource based on a defined tag. +type DefinedTagsResourceFilter struct { + + // This is a defined tag filter value. + Value []DefinedTagFilterValue `mandatory:"false" json:"value"` +} + +func (m DefinedTagsResourceFilter) 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 DefinedTagsResourceFilter) 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 DefinedTagsResourceFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDefinedTagsResourceFilter DefinedTagsResourceFilter + s := struct { + DiscriminatorParam string `json:"attribute"` + MarshalTypeDefinedTagsResourceFilter + }{ + "DEFINED_TAGS", + (MarshalTypeDefinedTagsResourceFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcescheduler/delete_schedule_request_response.go b/resourcescheduler/delete_schedule_request_response.go new file mode 100644 index 0000000000..11aea4022f --- /dev/null +++ b/resourcescheduler/delete_schedule_request_response.go @@ -0,0 +1,96 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteScheduleRequest wrapper for the DeleteSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/DeleteSchedule.go.html to see an example of how to use DeleteScheduleRequest. +type DeleteScheduleRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the schedule. + ScheduleId *string `mandatory:"true" contributesTo:"path" name:"scheduleId"` + + // This is used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteScheduleRequest) 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 DeleteScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteScheduleRequest) 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 DeleteScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteScheduleResponse wrapper for the DeleteSchedule operation +type DeleteScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // This is a 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 DeleteScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/resourcescheduler/get_schedule_request_response.go b/resourcescheduler/get_schedule_request_response.go new file mode 100644 index 0000000000..08019d088d --- /dev/null +++ b/resourcescheduler/get_schedule_request_response.go @@ -0,0 +1,96 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetScheduleRequest wrapper for the GetSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/GetSchedule.go.html to see an example of how to use GetScheduleRequest. +type GetScheduleRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the schedule. + ScheduleId *string `mandatory:"true" contributesTo:"path" name:"scheduleId"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetScheduleRequest) 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 GetScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetScheduleRequest) 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 GetScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetScheduleResponse wrapper for the GetSchedule operation +type GetScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Schedule instance + Schedule `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // This is a 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 GetScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/resourcescheduler/get_work_request_request_response.go b/resourcescheduler/get_work_request_request_response.go new file mode 100644 index 0000000000..d8a498b2ca --- /dev/null +++ b/resourcescheduler/get_work_request_request_response.go @@ -0,0 +1,99 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/GetWorkRequest.go.html to see an example of how to use GetWorkRequestRequest. +type GetWorkRequestRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) 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 GetWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) 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 GetWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // This is a 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"` + + // This is a decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/resourcescheduler/lifecycle_state_resource_filter.go b/resourcescheduler/lifecycle_state_resource_filter.go new file mode 100644 index 0000000000..eb6c1ecb68 --- /dev/null +++ b/resourcescheduler/lifecycle_state_resource_filter.go @@ -0,0 +1,54 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LifecycleStateResourceFilter This is a resource filter for filtering resources based on their lifecycle state. +type LifecycleStateResourceFilter struct { + + // This is a collection of resource lifecycle state values. + Value []string `mandatory:"false" json:"value"` +} + +func (m LifecycleStateResourceFilter) 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 LifecycleStateResourceFilter) 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 LifecycleStateResourceFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeLifecycleStateResourceFilter LifecycleStateResourceFilter + s := struct { + DiscriminatorParam string `json:"attribute"` + MarshalTypeLifecycleStateResourceFilter + }{ + "LIFECYCLE_STATE", + (MarshalTypeLifecycleStateResourceFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcescheduler/list_resource_types_request_response.go b/resourcescheduler/list_resource_types_request_response.go new file mode 100644 index 0000000000..cb8136fa9c --- /dev/null +++ b/resourcescheduler/list_resource_types_request_response.go @@ -0,0 +1,107 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListResourceTypesRequest wrapper for the ListResourceTypes operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ListResourceTypes.go.html to see an example of how to use ListResourceTypesRequest. +type ListResourceTypesRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // This used for list pagination. The value of the opc-next-page response header from the previous + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 ListResourceTypesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListResourceTypesRequest) 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 ListResourceTypesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListResourceTypesRequest) 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 ListResourceTypesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListResourceTypesResponse wrapper for the ListResourceTypes operation +type ListResourceTypesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ResourceTypeCollection instances + ResourceTypeCollection `presentIn:"body"` + + // This is a 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"` + + // When this header appears in the list pagination response, there are additional results pages to view. For + // important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListResourceTypesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListResourceTypesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/resourcescheduler/list_schedules_request_response.go b/resourcescheduler/list_schedules_request_response.go new file mode 100644 index 0000000000..b3273dd030 --- /dev/null +++ b/resourcescheduler/list_schedules_request_response.go @@ -0,0 +1,225 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSchedulesRequest wrapper for the ListSchedules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ListSchedules.go.html to see an example of how to use ListSchedulesRequest. +type ListSchedulesRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // This is a filter to return only resources that match the given lifecycle state. The + // state value is case-insensitive. + LifecycleState ScheduleLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // This is a filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the schedule. + ScheduleId *string `mandatory:"false" contributesTo:"query" name:"scheduleId"` + + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // This used for list pagination. The value of the opc-next-page response header from the previous + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // This is the field to sort by. You can provide only one sort order. The default order for `timeCreated` + // is descending. The default order for `displayName` is ascending. + SortBy ListSchedulesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // This is the sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListSchedulesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 ListSchedulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSchedulesRequest) 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 ListSchedulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSchedulesRequest) 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 ListSchedulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingScheduleLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetScheduleLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListSchedulesSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListSchedulesSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListSchedulesSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListSchedulesSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSchedulesResponse wrapper for the ListSchedules operation +type ListSchedulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ScheduleCollection instances + ScheduleCollection `presentIn:"body"` + + // This is a 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"` + + // When this header appears in the list pagination response, there are additional results pages to view. For + // important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListSchedulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSchedulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSchedulesSortByEnum Enum with underlying type: string +type ListSchedulesSortByEnum string + +// Set of constants representing the allowable values for ListSchedulesSortByEnum +const ( + ListSchedulesSortByTimecreated ListSchedulesSortByEnum = "timeCreated" + ListSchedulesSortByDisplayname ListSchedulesSortByEnum = "displayName" + ListSchedulesSortByLifecyclestate ListSchedulesSortByEnum = "lifecycleState" + ListSchedulesSortByState ListSchedulesSortByEnum = "state" +) + +var mappingListSchedulesSortByEnum = map[string]ListSchedulesSortByEnum{ + "timeCreated": ListSchedulesSortByTimecreated, + "displayName": ListSchedulesSortByDisplayname, + "lifecycleState": ListSchedulesSortByLifecyclestate, + "state": ListSchedulesSortByState, +} + +var mappingListSchedulesSortByEnumLowerCase = map[string]ListSchedulesSortByEnum{ + "timecreated": ListSchedulesSortByTimecreated, + "displayname": ListSchedulesSortByDisplayname, + "lifecyclestate": ListSchedulesSortByLifecyclestate, + "state": ListSchedulesSortByState, +} + +// GetListSchedulesSortByEnumValues Enumerates the set of values for ListSchedulesSortByEnum +func GetListSchedulesSortByEnumValues() []ListSchedulesSortByEnum { + values := make([]ListSchedulesSortByEnum, 0) + for _, v := range mappingListSchedulesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSchedulesSortByEnumStringValues Enumerates the set of values in String for ListSchedulesSortByEnum +func GetListSchedulesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + "lifecycleState", + "state", + } +} + +// GetMappingListSchedulesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSchedulesSortByEnum(val string) (ListSchedulesSortByEnum, bool) { + enum, ok := mappingListSchedulesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSchedulesSortOrderEnum Enum with underlying type: string +type ListSchedulesSortOrderEnum string + +// Set of constants representing the allowable values for ListSchedulesSortOrderEnum +const ( + ListSchedulesSortOrderAsc ListSchedulesSortOrderEnum = "ASC" + ListSchedulesSortOrderDesc ListSchedulesSortOrderEnum = "DESC" +) + +var mappingListSchedulesSortOrderEnum = map[string]ListSchedulesSortOrderEnum{ + "ASC": ListSchedulesSortOrderAsc, + "DESC": ListSchedulesSortOrderDesc, +} + +var mappingListSchedulesSortOrderEnumLowerCase = map[string]ListSchedulesSortOrderEnum{ + "asc": ListSchedulesSortOrderAsc, + "desc": ListSchedulesSortOrderDesc, +} + +// GetListSchedulesSortOrderEnumValues Enumerates the set of values for ListSchedulesSortOrderEnum +func GetListSchedulesSortOrderEnumValues() []ListSchedulesSortOrderEnum { + values := make([]ListSchedulesSortOrderEnum, 0) + for _, v := range mappingListSchedulesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSchedulesSortOrderEnumStringValues Enumerates the set of values in String for ListSchedulesSortOrderEnum +func GetListSchedulesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSchedulesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSchedulesSortOrderEnum(val string) (ListSchedulesSortOrderEnum, bool) { + enum, ok := mappingListSchedulesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/list_work_request_errors_request_response.go b/resourcescheduler/list_work_request_errors_request_response.go new file mode 100644 index 0000000000..241f687db9 --- /dev/null +++ b/resourcescheduler/list_work_request_errors_request_response.go @@ -0,0 +1,199 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestErrorsRequest wrapper for the ListWorkRequestErrors operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrorsRequest. +type ListWorkRequestErrorsRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // This used for list pagination. The value of the opc-next-page response header from the previous + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // This is the field to sort by. Only one sort order may be provided. Default order for `timestamp` is descending. + SortBy ListWorkRequestErrorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // This is the sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWorkRequestErrorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // 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 ListWorkRequestErrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) 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 ListWorkRequestErrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestErrorsRequest) 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 ListWorkRequestErrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestErrorsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestErrorsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestErrorsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestErrorsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestErrorsResponse wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestErrorCollection instances + WorkRequestErrorCollection `presentIn:"body"` + + // When this header appears in the list pagination response, there are additional results pages to view. For + // important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // This is a 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 ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestErrorsSortByEnum Enum with underlying type: string +type ListWorkRequestErrorsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortByEnum +const ( + ListWorkRequestErrorsSortByTimestamp ListWorkRequestErrorsSortByEnum = "timestamp" +) + +var mappingListWorkRequestErrorsSortByEnum = map[string]ListWorkRequestErrorsSortByEnum{ + "timestamp": ListWorkRequestErrorsSortByTimestamp, +} + +var mappingListWorkRequestErrorsSortByEnumLowerCase = map[string]ListWorkRequestErrorsSortByEnum{ + "timestamp": ListWorkRequestErrorsSortByTimestamp, +} + +// GetListWorkRequestErrorsSortByEnumValues Enumerates the set of values for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumValues() []ListWorkRequestErrorsSortByEnum { + values := make([]ListWorkRequestErrorsSortByEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListWorkRequestErrorsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortByEnum(val string) (ListWorkRequestErrorsSortByEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestErrorsSortOrderEnum Enum with underlying type: string +type ListWorkRequestErrorsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortOrderEnum +const ( + ListWorkRequestErrorsSortOrderAsc ListWorkRequestErrorsSortOrderEnum = "ASC" + ListWorkRequestErrorsSortOrderDesc ListWorkRequestErrorsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestErrorsSortOrderEnum = map[string]ListWorkRequestErrorsSortOrderEnum{ + "ASC": ListWorkRequestErrorsSortOrderAsc, + "DESC": ListWorkRequestErrorsSortOrderDesc, +} + +var mappingListWorkRequestErrorsSortOrderEnumLowerCase = map[string]ListWorkRequestErrorsSortOrderEnum{ + "asc": ListWorkRequestErrorsSortOrderAsc, + "desc": ListWorkRequestErrorsSortOrderDesc, +} + +// GetListWorkRequestErrorsSortOrderEnumValues Enumerates the set of values for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumValues() []ListWorkRequestErrorsSortOrderEnum { + values := make([]ListWorkRequestErrorsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestErrorsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortOrderEnum(val string) (ListWorkRequestErrorsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/list_work_request_logs_request_response.go b/resourcescheduler/list_work_request_logs_request_response.go new file mode 100644 index 0000000000..c23ad2daa5 --- /dev/null +++ b/resourcescheduler/list_work_request_logs_request_response.go @@ -0,0 +1,199 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestLogsRequest wrapper for the ListWorkRequestLogs operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogsRequest. +type ListWorkRequestLogsRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // This used for list pagination. The value of the opc-next-page response header from the previous + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // This is the field to sort by. Only one sort order may be provided. Default order for `timestamp` is descending. + SortBy ListWorkRequestLogsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // This is the sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWorkRequestLogsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // 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 ListWorkRequestLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) 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 ListWorkRequestLogsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestLogsRequest) 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 ListWorkRequestLogsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestLogsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestLogsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestLogsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestLogsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestLogsResponse wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestLogEntryCollection instances + WorkRequestLogEntryCollection `presentIn:"body"` + + // When this header appears in the list pagination response, there are additional results pages to view. For + // important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // This is a 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 ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestLogsSortByEnum Enum with underlying type: string +type ListWorkRequestLogsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortByEnum +const ( + ListWorkRequestLogsSortByTimestamp ListWorkRequestLogsSortByEnum = "timestamp" +) + +var mappingListWorkRequestLogsSortByEnum = map[string]ListWorkRequestLogsSortByEnum{ + "timestamp": ListWorkRequestLogsSortByTimestamp, +} + +var mappingListWorkRequestLogsSortByEnumLowerCase = map[string]ListWorkRequestLogsSortByEnum{ + "timestamp": ListWorkRequestLogsSortByTimestamp, +} + +// GetListWorkRequestLogsSortByEnumValues Enumerates the set of values for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumValues() []ListWorkRequestLogsSortByEnum { + values := make([]ListWorkRequestLogsSortByEnum, 0) + for _, v := range mappingListWorkRequestLogsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListWorkRequestLogsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortByEnum(val string) (ListWorkRequestLogsSortByEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestLogsSortOrderEnum Enum with underlying type: string +type ListWorkRequestLogsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortOrderEnum +const ( + ListWorkRequestLogsSortOrderAsc ListWorkRequestLogsSortOrderEnum = "ASC" + ListWorkRequestLogsSortOrderDesc ListWorkRequestLogsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestLogsSortOrderEnum = map[string]ListWorkRequestLogsSortOrderEnum{ + "ASC": ListWorkRequestLogsSortOrderAsc, + "DESC": ListWorkRequestLogsSortOrderDesc, +} + +var mappingListWorkRequestLogsSortOrderEnumLowerCase = map[string]ListWorkRequestLogsSortOrderEnum{ + "asc": ListWorkRequestLogsSortOrderAsc, + "desc": ListWorkRequestLogsSortOrderDesc, +} + +// GetListWorkRequestLogsSortOrderEnumValues Enumerates the set of values for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumValues() []ListWorkRequestLogsSortOrderEnum { + values := make([]ListWorkRequestLogsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestLogsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestLogsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortOrderEnum(val string) (ListWorkRequestLogsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/list_work_requests_request_response.go b/resourcescheduler/list_work_requests_request_response.go new file mode 100644 index 0000000000..cabb0df3dd --- /dev/null +++ b/resourcescheduler/list_work_requests_request_response.go @@ -0,0 +1,280 @@ +// 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 resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ListWorkRequests.go.html to see an example of how to use ListWorkRequestsRequest. +type ListWorkRequestsRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"false" contributesTo:"query" name:"workRequestId"` + + // This is a filter to return only the resources that match the given lifecycle state. + Status ListWorkRequestsStatusEnum `mandatory:"false" contributesTo:"query" name:"status" omitEmpty:"true"` + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the resource affected by the work request. + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // This used for list pagination. The value of the opc-next-page response header from the previous + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // This is the sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWorkRequestsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // This is the field to sort by. Only one sort order may be provided. Default order for `timeAccepted` is descending. + SortBy ListWorkRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the schedule. + ScheduleId *string `mandatory:"false" contributesTo:"query" name:"scheduleId"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) 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 ListWorkRequestsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) 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 ListWorkRequestsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestsStatusEnum(string(request.Status)); !ok && request.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", request.Status, strings.Join(GetListWorkRequestsStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestSummaryCollection instances + WorkRequestSummaryCollection `presentIn:"body"` + + // This is a 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"` + + // When this header appears in the list pagination response, there are additional results pages to view. For + // important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestsStatusEnum Enum with underlying type: string +type ListWorkRequestsStatusEnum string + +// Set of constants representing the allowable values for ListWorkRequestsStatusEnum +const ( + ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" + ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" + ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" + ListWorkRequestsStatusNeedsAttention ListWorkRequestsStatusEnum = "NEEDS_ATTENTION" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" +) + +var mappingListWorkRequestsStatusEnum = map[string]ListWorkRequestsStatusEnum{ + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "WAITING": ListWorkRequestsStatusWaiting, + "NEEDS_ATTENTION": ListWorkRequestsStatusNeedsAttention, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, +} + +var mappingListWorkRequestsStatusEnumLowerCase = map[string]ListWorkRequestsStatusEnum{ + "accepted": ListWorkRequestsStatusAccepted, + "in_progress": ListWorkRequestsStatusInProgress, + "waiting": ListWorkRequestsStatusWaiting, + "needs_attention": ListWorkRequestsStatusNeedsAttention, + "failed": ListWorkRequestsStatusFailed, + "succeeded": ListWorkRequestsStatusSucceeded, + "canceling": ListWorkRequestsStatusCanceling, + "canceled": ListWorkRequestsStatusCanceled, +} + +// GetListWorkRequestsStatusEnumValues Enumerates the set of values for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumValues() []ListWorkRequestsStatusEnum { + values := make([]ListWorkRequestsStatusEnum, 0) + for _, v := range mappingListWorkRequestsStatusEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsStatusEnumStringValues Enumerates the set of values in String for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingListWorkRequestsStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsStatusEnum(val string) (ListWorkRequestsStatusEnum, bool) { + enum, ok := mappingListWorkRequestsStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortOrderEnum Enum with underlying type: string +type ListWorkRequestsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortOrderEnum +const ( + ListWorkRequestsSortOrderAsc ListWorkRequestsSortOrderEnum = "ASC" + ListWorkRequestsSortOrderDesc ListWorkRequestsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestsSortOrderEnum = map[string]ListWorkRequestsSortOrderEnum{ + "ASC": ListWorkRequestsSortOrderAsc, + "DESC": ListWorkRequestsSortOrderDesc, +} + +var mappingListWorkRequestsSortOrderEnumLowerCase = map[string]ListWorkRequestsSortOrderEnum{ + "asc": ListWorkRequestsSortOrderAsc, + "desc": ListWorkRequestsSortOrderDesc, +} + +// GetListWorkRequestsSortOrderEnumValues Enumerates the set of values for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumValues() []ListWorkRequestsSortOrderEnum { + values := make([]ListWorkRequestsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortOrderEnum(val string) (ListWorkRequestsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortByEnum Enum with underlying type: string +type ListWorkRequestsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortByEnum +const ( + ListWorkRequestsSortByTimeaccepted ListWorkRequestsSortByEnum = "timeAccepted" +) + +var mappingListWorkRequestsSortByEnum = map[string]ListWorkRequestsSortByEnum{ + "timeAccepted": ListWorkRequestsSortByTimeaccepted, +} + +var mappingListWorkRequestsSortByEnumLowerCase = map[string]ListWorkRequestsSortByEnum{ + "timeaccepted": ListWorkRequestsSortByTimeaccepted, +} + +// GetListWorkRequestsSortByEnumValues Enumerates the set of values for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumValues() []ListWorkRequestsSortByEnum { + values := make([]ListWorkRequestsSortByEnum, 0) + for _, v := range mappingListWorkRequestsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumStringValues() []string { + return []string{ + "timeAccepted", + } +} + +// GetMappingListWorkRequestsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortByEnum(val string) (ListWorkRequestsSortByEnum, bool) { + enum, ok := mappingListWorkRequestsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/operation_status.go b/resourcescheduler/operation_status.go new file mode 100644 index 0000000000..579e4e69e5 --- /dev/null +++ b/resourcescheduler/operation_status.go @@ -0,0 +1,80 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "strings" +) + +// OperationStatusEnum Enum with underlying type: string +type OperationStatusEnum string + +// Set of constants representing the allowable values for OperationStatusEnum +const ( + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusWaiting OperationStatusEnum = "WAITING" + OperationStatusNeedsAttention OperationStatusEnum = "NEEDS_ATTENTION" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" +) + +var mappingOperationStatusEnum = map[string]OperationStatusEnum{ + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "WAITING": OperationStatusWaiting, + "NEEDS_ATTENTION": OperationStatusNeedsAttention, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, +} + +var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "waiting": OperationStatusWaiting, + "needs_attention": OperationStatusNeedsAttention, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, +} + +// GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum +func GetOperationStatusEnumValues() []OperationStatusEnum { + values := make([]OperationStatusEnum, 0) + for _, v := range mappingOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetOperationStatusEnumStringValues Enumerates the set of values in String for OperationStatusEnum +func GetOperationStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationStatusEnum(val string) (OperationStatusEnum, bool) { + enum, ok := mappingOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/operation_type.go b/resourcescheduler/operation_type.go new file mode 100644 index 0000000000..fc27dfdbeb --- /dev/null +++ b/resourcescheduler/operation_type.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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "strings" +) + +// OperationTypeEnum Enum with underlying type: string +type OperationTypeEnum string + +// Set of constants representing the allowable values for OperationTypeEnum +const ( + OperationTypeStartResource OperationTypeEnum = "START_RESOURCE" + OperationTypeStopResource OperationTypeEnum = "STOP_RESOURCE" + OperationTypeChangeScheduleCompartment OperationTypeEnum = "CHANGE_SCHEDULE_COMPARTMENT" + OperationTypeCreateSchedule OperationTypeEnum = "CREATE_SCHEDULE" + OperationTypeUpdateSchedule OperationTypeEnum = "UPDATE_SCHEDULE" +) + +var mappingOperationTypeEnum = map[string]OperationTypeEnum{ + "START_RESOURCE": OperationTypeStartResource, + "STOP_RESOURCE": OperationTypeStopResource, + "CHANGE_SCHEDULE_COMPARTMENT": OperationTypeChangeScheduleCompartment, + "CREATE_SCHEDULE": OperationTypeCreateSchedule, + "UPDATE_SCHEDULE": OperationTypeUpdateSchedule, +} + +var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ + "start_resource": OperationTypeStartResource, + "stop_resource": OperationTypeStopResource, + "change_schedule_compartment": OperationTypeChangeScheduleCompartment, + "create_schedule": OperationTypeCreateSchedule, + "update_schedule": OperationTypeUpdateSchedule, +} + +// GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum +func GetOperationTypeEnumValues() []OperationTypeEnum { + values := make([]OperationTypeEnum, 0) + for _, v := range mappingOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetOperationTypeEnumStringValues Enumerates the set of values in String for OperationTypeEnum +func GetOperationTypeEnumStringValues() []string { + return []string{ + "START_RESOURCE", + "STOP_RESOURCE", + "CHANGE_SCHEDULE_COMPARTMENT", + "CREATE_SCHEDULE", + "UPDATE_SCHEDULE", + } +} + +// GetMappingOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationTypeEnum(val string) (OperationTypeEnum, bool) { + enum, ok := mappingOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/resource.go b/resourcescheduler/resource.go new file mode 100644 index 0000000000..623468cbfa --- /dev/null +++ b/resourcescheduler/resource.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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Resource This is the schedule resource entity. +type Resource struct { + + // This is the resource OCID. + Id *string `mandatory:"true" json:"id"` + + // This is additional information that helps to identity the resource for the schedule. + // { + // "id": "" + // "metadata": + // { + // "namespaceName": "sampleNamespace", + // "bucketName": "sampleBucket" + // } + // } + Metadata map[string]string `mandatory:"false" json:"metadata"` +} + +func (m Resource) 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 Resource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/resource_filter.go b/resourcescheduler/resource_filter.go new file mode 100644 index 0000000000..820b1b8436 --- /dev/null +++ b/resourcescheduler/resource_filter.go @@ -0,0 +1,147 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceFilter This is a generic filter used to decide which resources that the schedule be applied to. +type ResourceFilter interface { +} + +type resourcefilter struct { + JsonData []byte + Attribute string `json:"attribute"` +} + +// UnmarshalJSON unmarshals json +func (m *resourcefilter) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerresourcefilter resourcefilter + s := struct { + Model Unmarshalerresourcefilter + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Attribute = s.Model.Attribute + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *resourcefilter) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Attribute { + case "TIME_CREATED": + mm := TimeCreatedResourceFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "RESOURCE_TYPE": + mm := ResourceTypeResourceFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "LIFECYCLE_STATE": + mm := LifecycleStateResourceFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "COMPARTMENT_ID": + mm := CompartmentIdResourceFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "DEFINED_TAGS": + mm := DefinedTagsResourceFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for ResourceFilter: %s.", m.Attribute) + return *m, nil + } +} + +func (m resourcefilter) 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 resourcefilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ResourceFilterAttributeEnum Enum with underlying type: string +type ResourceFilterAttributeEnum string + +// Set of constants representing the allowable values for ResourceFilterAttributeEnum +const ( + ResourceFilterAttributeCompartmentId ResourceFilterAttributeEnum = "COMPARTMENT_ID" + ResourceFilterAttributeResourceType ResourceFilterAttributeEnum = "RESOURCE_TYPE" + ResourceFilterAttributeDefinedTags ResourceFilterAttributeEnum = "DEFINED_TAGS" + ResourceFilterAttributeTimeCreated ResourceFilterAttributeEnum = "TIME_CREATED" + ResourceFilterAttributeLifecycleState ResourceFilterAttributeEnum = "LIFECYCLE_STATE" +) + +var mappingResourceFilterAttributeEnum = map[string]ResourceFilterAttributeEnum{ + "COMPARTMENT_ID": ResourceFilterAttributeCompartmentId, + "RESOURCE_TYPE": ResourceFilterAttributeResourceType, + "DEFINED_TAGS": ResourceFilterAttributeDefinedTags, + "TIME_CREATED": ResourceFilterAttributeTimeCreated, + "LIFECYCLE_STATE": ResourceFilterAttributeLifecycleState, +} + +var mappingResourceFilterAttributeEnumLowerCase = map[string]ResourceFilterAttributeEnum{ + "compartment_id": ResourceFilterAttributeCompartmentId, + "resource_type": ResourceFilterAttributeResourceType, + "defined_tags": ResourceFilterAttributeDefinedTags, + "time_created": ResourceFilterAttributeTimeCreated, + "lifecycle_state": ResourceFilterAttributeLifecycleState, +} + +// GetResourceFilterAttributeEnumValues Enumerates the set of values for ResourceFilterAttributeEnum +func GetResourceFilterAttributeEnumValues() []ResourceFilterAttributeEnum { + values := make([]ResourceFilterAttributeEnum, 0) + for _, v := range mappingResourceFilterAttributeEnum { + values = append(values, v) + } + return values +} + +// GetResourceFilterAttributeEnumStringValues Enumerates the set of values in String for ResourceFilterAttributeEnum +func GetResourceFilterAttributeEnumStringValues() []string { + return []string{ + "COMPARTMENT_ID", + "RESOURCE_TYPE", + "DEFINED_TAGS", + "TIME_CREATED", + "LIFECYCLE_STATE", + } +} + +// GetMappingResourceFilterAttributeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingResourceFilterAttributeEnum(val string) (ResourceFilterAttributeEnum, bool) { + enum, ok := mappingResourceFilterAttributeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/resource_type.go b/resourcescheduler/resource_type.go new file mode 100644 index 0000000000..8fef913002 --- /dev/null +++ b/resourcescheduler/resource_type.go @@ -0,0 +1,39 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceType This is a resource type supported by resource scheduler. +type ResourceType struct { + + // This is a resource type supported by resource scheduler. + Name *string `mandatory:"true" json:"name"` +} + +func (m ResourceType) 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 ResourceType) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/resource_type_collection.go b/resourcescheduler/resource_type_collection.go new file mode 100644 index 0000000000..c2ec018645 --- /dev/null +++ b/resourcescheduler/resource_type_collection.go @@ -0,0 +1,39 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceTypeCollection This is the collection of resource types supported by resource scheduler. +type ResourceTypeCollection struct { + + // This is the collection of resource types supported by resource scheduler. + Items []ResourceType `mandatory:"true" json:"items"` +} + +func (m ResourceTypeCollection) 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 ResourceTypeCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/resource_type_resource_filter.go b/resourcescheduler/resource_type_resource_filter.go new file mode 100644 index 0000000000..fbb85d5404 --- /dev/null +++ b/resourcescheduler/resource_type_resource_filter.go @@ -0,0 +1,54 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceTypeResourceFilter This is a resource filter for filtering resource based on resource type. +type ResourceTypeResourceFilter struct { + + // This is a collection of resource types. + Value []string `mandatory:"false" json:"value"` +} + +func (m ResourceTypeResourceFilter) 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 ResourceTypeResourceFilter) 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 ResourceTypeResourceFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeResourceTypeResourceFilter ResourceTypeResourceFilter + s := struct { + DiscriminatorParam string `json:"attribute"` + MarshalTypeResourceTypeResourceFilter + }{ + "RESOURCE_TYPE", + (MarshalTypeResourceTypeResourceFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcescheduler/resourcescheduler_schedule_client.go b/resourcescheduler/resourcescheduler_schedule_client.go new file mode 100644 index 0000000000..f31adc1d67 --- /dev/null +++ b/resourcescheduler/resourcescheduler_schedule_client.go @@ -0,0 +1,861 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ScheduleClient a client for Schedule +type ScheduleClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewScheduleClientWithConfigurationProvider Creates a new default Schedule client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewScheduleClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ScheduleClient, err error) { + if enabled := common.CheckForEnabledServices("resourcescheduler"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newScheduleClientFromBaseClient(baseClient, provider) +} + +// NewScheduleClientWithOboToken Creates a new default Schedule client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewScheduleClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ScheduleClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newScheduleClientFromBaseClient(baseClient, configProvider) +} + +func newScheduleClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ScheduleClient, err error) { + // Schedule service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Schedule")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ScheduleClient{BaseClient: baseClient} + client.BasePath = "20240430" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ScheduleClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("resourcescheduler", "https://resource-scheduler.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ScheduleClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *ScheduleClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ActivateSchedule This API activates a schedule. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ActivateSchedule.go.html to see an example of how to use ActivateSchedule API. +// A default retry strategy applies to this operation ActivateSchedule() +func (client ScheduleClient) ActivateSchedule(ctx context.Context, request ActivateScheduleRequest) (response ActivateScheduleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.activateSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ActivateScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ActivateScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ActivateScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ActivateScheduleResponse") + } + return +} + +// activateSchedule implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) activateSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/schedules/{scheduleId}/actions/activateSchedule", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ActivateScheduleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "ActivateSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CancelWorkRequest This API cancels a work request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/CancelWorkRequest.go.html to see an example of how to use CancelWorkRequest API. +// A default retry strategy applies to this operation CancelWorkRequest() +func (client ScheduleClient) CancelWorkRequest(ctx context.Context, request CancelWorkRequestRequest) (response CancelWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.cancelWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelWorkRequestResponse") + } + return +} + +// cancelWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) cancelWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "CancelWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateSchedule Creates a Schedule +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/CreateSchedule.go.html to see an example of how to use CreateSchedule API. +// A default retry strategy applies to this operation CreateSchedule() +func (client ScheduleClient) CreateSchedule(ctx context.Context, request CreateScheduleRequest) (response CreateScheduleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateScheduleResponse") + } + return +} + +// createSchedule implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) createSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/schedules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateScheduleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "CreateSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeactivateSchedule This API deactivates a schedule. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/DeactivateSchedule.go.html to see an example of how to use DeactivateSchedule API. +// A default retry strategy applies to this operation DeactivateSchedule() +func (client ScheduleClient) DeactivateSchedule(ctx context.Context, request DeactivateScheduleRequest) (response DeactivateScheduleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.deactivateSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeactivateScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeactivateScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeactivateScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeactivateScheduleResponse") + } + return +} + +// deactivateSchedule implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) deactivateSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/schedules/{scheduleId}/actions/deactivateSchedule", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeactivateScheduleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "DeactivateSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteSchedule This API deletes a schedule. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/DeleteSchedule.go.html to see an example of how to use DeleteSchedule API. +// A default retry strategy applies to this operation DeleteSchedule() +func (client ScheduleClient) DeleteSchedule(ctx context.Context, request DeleteScheduleRequest) (response DeleteScheduleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteScheduleResponse") + } + return +} + +// deleteSchedule implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) deleteSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/schedules/{scheduleId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteScheduleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "DeleteSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetSchedule This API gets information about a schedule. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/GetSchedule.go.html to see an example of how to use GetSchedule API. +// A default retry strategy applies to this operation GetSchedule() +func (client ScheduleClient) GetSchedule(ctx context.Context, request GetScheduleRequest) (response GetScheduleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetScheduleResponse") + } + return +} + +// getSchedule implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) getSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/schedules/{scheduleId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetScheduleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "GetSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest This API gets the details of a work request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() +func (client ScheduleClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) getWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "GetWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListResourceTypes This API gets a list of schedule resource types. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ListResourceTypes.go.html to see an example of how to use ListResourceTypes API. +// A default retry strategy applies to this operation ListResourceTypes() +func (client ScheduleClient) ListResourceTypes(ctx context.Context, request ListResourceTypesRequest) (response ListResourceTypesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listResourceTypes, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListResourceTypesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListResourceTypesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListResourceTypesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListResourceTypesResponse") + } + return +} + +// listResourceTypes implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) listResourceTypes(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/schedules/resourceTypes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListResourceTypesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "ListResourceTypes", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListSchedules This API gets a list of schedules +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ListSchedules.go.html to see an example of how to use ListSchedules API. +// A default retry strategy applies to this operation ListSchedules() +func (client ScheduleClient) ListSchedules(ctx context.Context, request ListSchedulesRequest) (response ListSchedulesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSchedules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListSchedulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListSchedulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListSchedulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSchedulesResponse") + } + return +} + +// listSchedules implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) listSchedules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/schedules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListSchedulesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "ListSchedules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestErrors This API lists the errors for a work request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() +func (client ScheduleClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestErrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestErrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "ListWorkRequestErrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Lists the logs for a work request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() +func (client ScheduleClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestLogsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } + return +} + +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "ListWorkRequestLogs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Lists the cloud scheduler work requests in a compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() +func (client ScheduleClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) listWorkRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "ListWorkRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateSchedule The API updates a schedule +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/UpdateSchedule.go.html to see an example of how to use UpdateSchedule API. +// A default retry strategy applies to this operation UpdateSchedule() +func (client ScheduleClient) UpdateSchedule(ctx context.Context, request UpdateScheduleRequest) (response UpdateScheduleResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateScheduleResponse") + } + return +} + +// updateSchedule implements the OCIOperation interface (enables retrying operations) +func (client ScheduleClient) updateSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/schedules/{scheduleId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateScheduleResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Schedule", "UpdateSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/resourcescheduler/schedule.go b/resourcescheduler/schedule.go new file mode 100644 index 0000000000..0a7aa7a8dc --- /dev/null +++ b/resourcescheduler/schedule.go @@ -0,0 +1,345 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Schedule A Schedule describes the date and time when an operation will be or has been applied to a set of resources. You must specify either +// the resources directly or provide a set of resource filters to select the resources. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, contact your +// administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/iaas/Content/Identity/policiesgs/get-started-with-policies.htm). +type Schedule struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the schedule + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which the schedule is created + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // This is a user-friendly name for the schedule. It does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"true" json:"displayName"` + + // This is the action that will be executed by the schedule. + Action ScheduleActionEnum `mandatory:"true" json:"action"` + + // This is the frequency of recurrence of a schedule. The frequency field can either conform to RFC-5545 formatting + // or UNIX cron formatting for recurrences, based on the value specified by the recurrenceType field. + RecurrenceDetails *string `mandatory:"true" json:"recurrenceDetails"` + + // Type of recurrence of a schedule + RecurrenceType ScheduleRecurrenceTypeEnum `mandatory:"true" json:"recurrenceType"` + + // This is the date and time the schedule was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // This is the current state of a schedule. + LifecycleState ScheduleLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // These are free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // These are 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/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // This is the description of the schedule. + Description *string `mandatory:"false" json:"description"` + + // This is a list of resources filters. The schedule will be applied to resources matching all of them. + ResourceFilters []ResourceFilter `mandatory:"false" json:"resourceFilters"` + + // This is the list of resources to which the scheduled operation is applied. + Resources []Resource `mandatory:"false" json:"resources"` + + // This is the date and time the schedule starts, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeStarts *common.SDKTime `mandatory:"false" json:"timeStarts"` + + // This is the date and time the schedule ends, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeEnds *common.SDKTime `mandatory:"false" json:"timeEnds"` + + // This is the date and time the schedule was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // This is the date and time the schedule runs last time, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeLastRun *common.SDKTime `mandatory:"false" json:"timeLastRun"` + + // This is the date and time the schedule run the next time, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeNextRun *common.SDKTime `mandatory:"false" json:"timeNextRun"` + + // These are system tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m Schedule) 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 Schedule) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingScheduleActionEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetScheduleActionEnumStringValues(), ","))) + } + if _, ok := GetMappingScheduleRecurrenceTypeEnum(string(m.RecurrenceType)); !ok && m.RecurrenceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RecurrenceType: %s. Supported values are: %s.", m.RecurrenceType, strings.Join(GetScheduleRecurrenceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingScheduleLifecycleStateEnum(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(GetScheduleLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *Schedule) UnmarshalJSON(data []byte) (e error) { + model := struct { + Description *string `json:"description"` + ResourceFilters []resourcefilter `json:"resourceFilters"` + Resources []Resource `json:"resources"` + TimeStarts *common.SDKTime `json:"timeStarts"` + TimeEnds *common.SDKTime `json:"timeEnds"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + TimeLastRun *common.SDKTime `json:"timeLastRun"` + TimeNextRun *common.SDKTime `json:"timeNextRun"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + Id *string `json:"id"` + CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + Action ScheduleActionEnum `json:"action"` + RecurrenceDetails *string `json:"recurrenceDetails"` + RecurrenceType ScheduleRecurrenceTypeEnum `json:"recurrenceType"` + TimeCreated *common.SDKTime `json:"timeCreated"` + LifecycleState ScheduleLifecycleStateEnum `json:"lifecycleState"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Description = model.Description + + m.ResourceFilters = make([]ResourceFilter, len(model.ResourceFilters)) + for i, n := range model.ResourceFilters { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.ResourceFilters[i] = nn.(ResourceFilter) + } else { + m.ResourceFilters[i] = nil + } + } + m.Resources = make([]Resource, len(model.Resources)) + copy(m.Resources, model.Resources) + m.TimeStarts = model.TimeStarts + + m.TimeEnds = model.TimeEnds + + m.TimeUpdated = model.TimeUpdated + + m.TimeLastRun = model.TimeLastRun + + m.TimeNextRun = model.TimeNextRun + + m.SystemTags = model.SystemTags + + m.Id = model.Id + + m.CompartmentId = model.CompartmentId + + m.DisplayName = model.DisplayName + + m.Action = model.Action + + m.RecurrenceDetails = model.RecurrenceDetails + + m.RecurrenceType = model.RecurrenceType + + m.TimeCreated = model.TimeCreated + + m.LifecycleState = model.LifecycleState + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + return +} + +// ScheduleActionEnum Enum with underlying type: string +type ScheduleActionEnum string + +// Set of constants representing the allowable values for ScheduleActionEnum +const ( + ScheduleActionStartResource ScheduleActionEnum = "START_RESOURCE" + ScheduleActionStopResource ScheduleActionEnum = "STOP_RESOURCE" +) + +var mappingScheduleActionEnum = map[string]ScheduleActionEnum{ + "START_RESOURCE": ScheduleActionStartResource, + "STOP_RESOURCE": ScheduleActionStopResource, +} + +var mappingScheduleActionEnumLowerCase = map[string]ScheduleActionEnum{ + "start_resource": ScheduleActionStartResource, + "stop_resource": ScheduleActionStopResource, +} + +// GetScheduleActionEnumValues Enumerates the set of values for ScheduleActionEnum +func GetScheduleActionEnumValues() []ScheduleActionEnum { + values := make([]ScheduleActionEnum, 0) + for _, v := range mappingScheduleActionEnum { + values = append(values, v) + } + return values +} + +// GetScheduleActionEnumStringValues Enumerates the set of values in String for ScheduleActionEnum +func GetScheduleActionEnumStringValues() []string { + return []string{ + "START_RESOURCE", + "STOP_RESOURCE", + } +} + +// GetMappingScheduleActionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduleActionEnum(val string) (ScheduleActionEnum, bool) { + enum, ok := mappingScheduleActionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ScheduleRecurrenceTypeEnum Enum with underlying type: string +type ScheduleRecurrenceTypeEnum string + +// Set of constants representing the allowable values for ScheduleRecurrenceTypeEnum +const ( + ScheduleRecurrenceTypeCron ScheduleRecurrenceTypeEnum = "CRON" + ScheduleRecurrenceTypeIcal ScheduleRecurrenceTypeEnum = "ICAL" +) + +var mappingScheduleRecurrenceTypeEnum = map[string]ScheduleRecurrenceTypeEnum{ + "CRON": ScheduleRecurrenceTypeCron, + "ICAL": ScheduleRecurrenceTypeIcal, +} + +var mappingScheduleRecurrenceTypeEnumLowerCase = map[string]ScheduleRecurrenceTypeEnum{ + "cron": ScheduleRecurrenceTypeCron, + "ical": ScheduleRecurrenceTypeIcal, +} + +// GetScheduleRecurrenceTypeEnumValues Enumerates the set of values for ScheduleRecurrenceTypeEnum +func GetScheduleRecurrenceTypeEnumValues() []ScheduleRecurrenceTypeEnum { + values := make([]ScheduleRecurrenceTypeEnum, 0) + for _, v := range mappingScheduleRecurrenceTypeEnum { + values = append(values, v) + } + return values +} + +// GetScheduleRecurrenceTypeEnumStringValues Enumerates the set of values in String for ScheduleRecurrenceTypeEnum +func GetScheduleRecurrenceTypeEnumStringValues() []string { + return []string{ + "CRON", + "ICAL", + } +} + +// GetMappingScheduleRecurrenceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduleRecurrenceTypeEnum(val string) (ScheduleRecurrenceTypeEnum, bool) { + enum, ok := mappingScheduleRecurrenceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ScheduleLifecycleStateEnum Enum with underlying type: string +type ScheduleLifecycleStateEnum string + +// Set of constants representing the allowable values for ScheduleLifecycleStateEnum +const ( + ScheduleLifecycleStateActive ScheduleLifecycleStateEnum = "ACTIVE" + ScheduleLifecycleStateInactive ScheduleLifecycleStateEnum = "INACTIVE" + ScheduleLifecycleStateCreating ScheduleLifecycleStateEnum = "CREATING" + ScheduleLifecycleStateUpdating ScheduleLifecycleStateEnum = "UPDATING" + ScheduleLifecycleStateDeleting ScheduleLifecycleStateEnum = "DELETING" + ScheduleLifecycleStateDeleted ScheduleLifecycleStateEnum = "DELETED" + ScheduleLifecycleStateFailed ScheduleLifecycleStateEnum = "FAILED" +) + +var mappingScheduleLifecycleStateEnum = map[string]ScheduleLifecycleStateEnum{ + "ACTIVE": ScheduleLifecycleStateActive, + "INACTIVE": ScheduleLifecycleStateInactive, + "CREATING": ScheduleLifecycleStateCreating, + "UPDATING": ScheduleLifecycleStateUpdating, + "DELETING": ScheduleLifecycleStateDeleting, + "DELETED": ScheduleLifecycleStateDeleted, + "FAILED": ScheduleLifecycleStateFailed, +} + +var mappingScheduleLifecycleStateEnumLowerCase = map[string]ScheduleLifecycleStateEnum{ + "active": ScheduleLifecycleStateActive, + "inactive": ScheduleLifecycleStateInactive, + "creating": ScheduleLifecycleStateCreating, + "updating": ScheduleLifecycleStateUpdating, + "deleting": ScheduleLifecycleStateDeleting, + "deleted": ScheduleLifecycleStateDeleted, + "failed": ScheduleLifecycleStateFailed, +} + +// GetScheduleLifecycleStateEnumValues Enumerates the set of values for ScheduleLifecycleStateEnum +func GetScheduleLifecycleStateEnumValues() []ScheduleLifecycleStateEnum { + values := make([]ScheduleLifecycleStateEnum, 0) + for _, v := range mappingScheduleLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetScheduleLifecycleStateEnumStringValues Enumerates the set of values in String for ScheduleLifecycleStateEnum +func GetScheduleLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + "CREATING", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingScheduleLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduleLifecycleStateEnum(val string) (ScheduleLifecycleStateEnum, bool) { + enum, ok := mappingScheduleLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/schedule_collection.go b/resourcescheduler/schedule_collection.go new file mode 100644 index 0000000000..b511a59867 --- /dev/null +++ b/resourcescheduler/schedule_collection.go @@ -0,0 +1,39 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduleCollection This is the list of schedule items. +type ScheduleCollection struct { + + // This is the list of schedule items. + Items []ScheduleSummary `mandatory:"true" json:"items"` +} + +func (m ScheduleCollection) 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 ScheduleCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/schedule_summary.go b/resourcescheduler/schedule_summary.go new file mode 100644 index 0000000000..5aa5905f3c --- /dev/null +++ b/resourcescheduler/schedule_summary.go @@ -0,0 +1,288 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduleSummary This is the summary information about a schedule. +type ScheduleSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the schedule + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which the schedule is created + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // This is a user-friendly name for the schedule. It does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"true" json:"displayName"` + + // This is the action that will be executed by the schedule. + Action ScheduleSummaryActionEnum `mandatory:"true" json:"action"` + + // This is the frequency of recurrence of a schedule. The frequency field can either conform to RFC-5545 formatting + // or UNIX cron formatting for recurrences, based on the value specified by the recurrenceType field. + RecurrenceDetails *string `mandatory:"true" json:"recurrenceDetails"` + + // Type of recurrence of a schedule + RecurrenceType ScheduleSummaryRecurrenceTypeEnum `mandatory:"true" json:"recurrenceType"` + + // This is the current state of the schedule. + LifecycleState ScheduleLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // This is the description of the schedule. + Description *string `mandatory:"false" json:"description"` + + // This is a list of resources filters. The schedule will be applied to resources matching all of them. + ResourceFilters []ResourceFilter `mandatory:"false" json:"resourceFilters"` + + // This is the list of resources to which the scheduled operation is applied. + Resources []Resource `mandatory:"false" json:"resources"` + + // This is the date and time the schedule starts, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeStarts *common.SDKTime `mandatory:"false" json:"timeStarts"` + + // This is the date and time the schedule ends, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeEnds *common.SDKTime `mandatory:"false" json:"timeEnds"` + + // This is the date and time the schedule was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // This is the date and time the schedule was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // This is the date and time the schedule runs last time, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeLastRun *common.SDKTime `mandatory:"false" json:"timeLastRun"` + + // This is the date and time the schedule run the next time, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeNextRun *common.SDKTime `mandatory:"false" json:"timeNextRun"` + + // This is the status of the last work request. + LastRunStatus OperationStatusEnum `mandatory:"false" json:"lastRunStatus,omitempty"` + + // These are free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // These are 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/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // These are system tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ScheduleSummary) 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 ScheduleSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingScheduleSummaryActionEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetScheduleSummaryActionEnumStringValues(), ","))) + } + if _, ok := GetMappingScheduleSummaryRecurrenceTypeEnum(string(m.RecurrenceType)); !ok && m.RecurrenceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RecurrenceType: %s. Supported values are: %s.", m.RecurrenceType, strings.Join(GetScheduleSummaryRecurrenceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingScheduleLifecycleStateEnum(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(GetScheduleLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingOperationStatusEnum(string(m.LastRunStatus)); !ok && m.LastRunStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LastRunStatus: %s. Supported values are: %s.", m.LastRunStatus, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *ScheduleSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + Description *string `json:"description"` + ResourceFilters []resourcefilter `json:"resourceFilters"` + Resources []Resource `json:"resources"` + TimeStarts *common.SDKTime `json:"timeStarts"` + TimeEnds *common.SDKTime `json:"timeEnds"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + TimeLastRun *common.SDKTime `json:"timeLastRun"` + TimeNextRun *common.SDKTime `json:"timeNextRun"` + LastRunStatus OperationStatusEnum `json:"lastRunStatus"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + Id *string `json:"id"` + CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + Action ScheduleSummaryActionEnum `json:"action"` + RecurrenceDetails *string `json:"recurrenceDetails"` + RecurrenceType ScheduleSummaryRecurrenceTypeEnum `json:"recurrenceType"` + LifecycleState ScheduleLifecycleStateEnum `json:"lifecycleState"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Description = model.Description + + m.ResourceFilters = make([]ResourceFilter, len(model.ResourceFilters)) + for i, n := range model.ResourceFilters { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.ResourceFilters[i] = nn.(ResourceFilter) + } else { + m.ResourceFilters[i] = nil + } + } + m.Resources = make([]Resource, len(model.Resources)) + copy(m.Resources, model.Resources) + m.TimeStarts = model.TimeStarts + + m.TimeEnds = model.TimeEnds + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + m.TimeLastRun = model.TimeLastRun + + m.TimeNextRun = model.TimeNextRun + + m.LastRunStatus = model.LastRunStatus + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.Id = model.Id + + m.CompartmentId = model.CompartmentId + + m.DisplayName = model.DisplayName + + m.Action = model.Action + + m.RecurrenceDetails = model.RecurrenceDetails + + m.RecurrenceType = model.RecurrenceType + + m.LifecycleState = model.LifecycleState + + return +} + +// ScheduleSummaryActionEnum Enum with underlying type: string +type ScheduleSummaryActionEnum string + +// Set of constants representing the allowable values for ScheduleSummaryActionEnum +const ( + ScheduleSummaryActionStartResource ScheduleSummaryActionEnum = "START_RESOURCE" + ScheduleSummaryActionStopResource ScheduleSummaryActionEnum = "STOP_RESOURCE" +) + +var mappingScheduleSummaryActionEnum = map[string]ScheduleSummaryActionEnum{ + "START_RESOURCE": ScheduleSummaryActionStartResource, + "STOP_RESOURCE": ScheduleSummaryActionStopResource, +} + +var mappingScheduleSummaryActionEnumLowerCase = map[string]ScheduleSummaryActionEnum{ + "start_resource": ScheduleSummaryActionStartResource, + "stop_resource": ScheduleSummaryActionStopResource, +} + +// GetScheduleSummaryActionEnumValues Enumerates the set of values for ScheduleSummaryActionEnum +func GetScheduleSummaryActionEnumValues() []ScheduleSummaryActionEnum { + values := make([]ScheduleSummaryActionEnum, 0) + for _, v := range mappingScheduleSummaryActionEnum { + values = append(values, v) + } + return values +} + +// GetScheduleSummaryActionEnumStringValues Enumerates the set of values in String for ScheduleSummaryActionEnum +func GetScheduleSummaryActionEnumStringValues() []string { + return []string{ + "START_RESOURCE", + "STOP_RESOURCE", + } +} + +// GetMappingScheduleSummaryActionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduleSummaryActionEnum(val string) (ScheduleSummaryActionEnum, bool) { + enum, ok := mappingScheduleSummaryActionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ScheduleSummaryRecurrenceTypeEnum Enum with underlying type: string +type ScheduleSummaryRecurrenceTypeEnum string + +// Set of constants representing the allowable values for ScheduleSummaryRecurrenceTypeEnum +const ( + ScheduleSummaryRecurrenceTypeCron ScheduleSummaryRecurrenceTypeEnum = "CRON" + ScheduleSummaryRecurrenceTypeIcal ScheduleSummaryRecurrenceTypeEnum = "ICAL" +) + +var mappingScheduleSummaryRecurrenceTypeEnum = map[string]ScheduleSummaryRecurrenceTypeEnum{ + "CRON": ScheduleSummaryRecurrenceTypeCron, + "ICAL": ScheduleSummaryRecurrenceTypeIcal, +} + +var mappingScheduleSummaryRecurrenceTypeEnumLowerCase = map[string]ScheduleSummaryRecurrenceTypeEnum{ + "cron": ScheduleSummaryRecurrenceTypeCron, + "ical": ScheduleSummaryRecurrenceTypeIcal, +} + +// GetScheduleSummaryRecurrenceTypeEnumValues Enumerates the set of values for ScheduleSummaryRecurrenceTypeEnum +func GetScheduleSummaryRecurrenceTypeEnumValues() []ScheduleSummaryRecurrenceTypeEnum { + values := make([]ScheduleSummaryRecurrenceTypeEnum, 0) + for _, v := range mappingScheduleSummaryRecurrenceTypeEnum { + values = append(values, v) + } + return values +} + +// GetScheduleSummaryRecurrenceTypeEnumStringValues Enumerates the set of values in String for ScheduleSummaryRecurrenceTypeEnum +func GetScheduleSummaryRecurrenceTypeEnumStringValues() []string { + return []string{ + "CRON", + "ICAL", + } +} + +// GetMappingScheduleSummaryRecurrenceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduleSummaryRecurrenceTypeEnum(val string) (ScheduleSummaryRecurrenceTypeEnum, bool) { + enum, ok := mappingScheduleSummaryRecurrenceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/sort_order.go b/resourcescheduler/sort_order.go new file mode 100644 index 0000000000..798299dd1f --- /dev/null +++ b/resourcescheduler/sort_order.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "strings" +) + +// SortOrderEnum Enum with underlying type: string +type SortOrderEnum string + +// Set of constants representing the allowable values for SortOrderEnum +const ( + SortOrderAsc SortOrderEnum = "ASC" + SortOrderDesc SortOrderEnum = "DESC" +) + +var mappingSortOrderEnum = map[string]SortOrderEnum{ + "ASC": SortOrderAsc, + "DESC": SortOrderDesc, +} + +var mappingSortOrderEnumLowerCase = map[string]SortOrderEnum{ + "asc": SortOrderAsc, + "desc": SortOrderDesc, +} + +// GetSortOrderEnumValues Enumerates the set of values for SortOrderEnum +func GetSortOrderEnumValues() []SortOrderEnum { + values := make([]SortOrderEnum, 0) + for _, v := range mappingSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSortOrderEnumStringValues Enumerates the set of values in String for SortOrderEnum +func GetSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSortOrderEnum(val string) (SortOrderEnum, bool) { + enum, ok := mappingSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/time_created_resource_filter.go b/resourcescheduler/time_created_resource_filter.go new file mode 100644 index 0000000000..fe98851fb2 --- /dev/null +++ b/resourcescheduler/time_created_resource_filter.go @@ -0,0 +1,106 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TimeCreatedResourceFilter This is a resource filter for filtering resources based on their creation time. +type TimeCreatedResourceFilter struct { + + // This is the date and time as the value of the filter. + Value *string `mandatory:"false" json:"value"` + + // This is the condition for the filter in comparison to its creation time. + Condition TimeCreatedResourceFilterConditionEnum `mandatory:"false" json:"condition,omitempty"` +} + +func (m TimeCreatedResourceFilter) 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 TimeCreatedResourceFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTimeCreatedResourceFilterConditionEnum(string(m.Condition)); !ok && m.Condition != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Condition: %s. Supported values are: %s.", m.Condition, strings.Join(GetTimeCreatedResourceFilterConditionEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m TimeCreatedResourceFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeTimeCreatedResourceFilter TimeCreatedResourceFilter + s := struct { + DiscriminatorParam string `json:"attribute"` + MarshalTypeTimeCreatedResourceFilter + }{ + "TIME_CREATED", + (MarshalTypeTimeCreatedResourceFilter)(m), + } + + return json.Marshal(&s) +} + +// TimeCreatedResourceFilterConditionEnum Enum with underlying type: string +type TimeCreatedResourceFilterConditionEnum string + +// Set of constants representing the allowable values for TimeCreatedResourceFilterConditionEnum +const ( + TimeCreatedResourceFilterConditionEqual TimeCreatedResourceFilterConditionEnum = "EQUAL" + TimeCreatedResourceFilterConditionBefore TimeCreatedResourceFilterConditionEnum = "BEFORE" + TimeCreatedResourceFilterConditionAfter TimeCreatedResourceFilterConditionEnum = "AFTER" +) + +var mappingTimeCreatedResourceFilterConditionEnum = map[string]TimeCreatedResourceFilterConditionEnum{ + "EQUAL": TimeCreatedResourceFilterConditionEqual, + "BEFORE": TimeCreatedResourceFilterConditionBefore, + "AFTER": TimeCreatedResourceFilterConditionAfter, +} + +var mappingTimeCreatedResourceFilterConditionEnumLowerCase = map[string]TimeCreatedResourceFilterConditionEnum{ + "equal": TimeCreatedResourceFilterConditionEqual, + "before": TimeCreatedResourceFilterConditionBefore, + "after": TimeCreatedResourceFilterConditionAfter, +} + +// GetTimeCreatedResourceFilterConditionEnumValues Enumerates the set of values for TimeCreatedResourceFilterConditionEnum +func GetTimeCreatedResourceFilterConditionEnumValues() []TimeCreatedResourceFilterConditionEnum { + values := make([]TimeCreatedResourceFilterConditionEnum, 0) + for _, v := range mappingTimeCreatedResourceFilterConditionEnum { + values = append(values, v) + } + return values +} + +// GetTimeCreatedResourceFilterConditionEnumStringValues Enumerates the set of values in String for TimeCreatedResourceFilterConditionEnum +func GetTimeCreatedResourceFilterConditionEnumStringValues() []string { + return []string{ + "EQUAL", + "BEFORE", + "AFTER", + } +} + +// GetMappingTimeCreatedResourceFilterConditionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTimeCreatedResourceFilterConditionEnum(val string) (TimeCreatedResourceFilterConditionEnum, bool) { + enum, ok := mappingTimeCreatedResourceFilterConditionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/update_schedule_details.go b/resourcescheduler/update_schedule_details.go new file mode 100644 index 0000000000..44cc1f50f5 --- /dev/null +++ b/resourcescheduler/update_schedule_details.go @@ -0,0 +1,223 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateScheduleDetails This is the data to update a schedule. +type UpdateScheduleDetails struct { + + // This is a user-friendly name for the schedule. It does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"false" json:"displayName"` + + // This is the description of the schedule. + Description *string `mandatory:"false" json:"description"` + + // This is the action that will be executed by the schedule. + Action UpdateScheduleDetailsActionEnum `mandatory:"false" json:"action,omitempty"` + + // This is the frequency of recurrence of a schedule. The frequency field can either conform to RFC-5545 formatting + // or UNIX cron formatting for recurrences, based on the value specified by the recurrenceType field. + RecurrenceDetails *string `mandatory:"false" json:"recurrenceDetails"` + + // Type of recurrence of a schedule + RecurrenceType UpdateScheduleDetailsRecurrenceTypeEnum `mandatory:"false" json:"recurrenceType,omitempty"` + + // This is a list of resources filters. The schedule will be applied to resources matching all of them. + ResourceFilters []ResourceFilter `mandatory:"false" json:"resourceFilters"` + + // This is the list of resources to which the scheduled operation is applied. + Resources []Resource `mandatory:"false" json:"resources"` + + // This is the date and time the schedule starts, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeStarts *common.SDKTime `mandatory:"false" json:"timeStarts"` + + // This is the date and time the schedule ends, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeEnds *common.SDKTime `mandatory:"false" json:"timeEnds"` + + // These are free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // These are 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/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateScheduleDetails) 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 UpdateScheduleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingUpdateScheduleDetailsActionEnum(string(m.Action)); !ok && m.Action != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetUpdateScheduleDetailsActionEnumStringValues(), ","))) + } + if _, ok := GetMappingUpdateScheduleDetailsRecurrenceTypeEnum(string(m.RecurrenceType)); !ok && m.RecurrenceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RecurrenceType: %s. Supported values are: %s.", m.RecurrenceType, strings.Join(GetUpdateScheduleDetailsRecurrenceTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *UpdateScheduleDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + Action UpdateScheduleDetailsActionEnum `json:"action"` + RecurrenceDetails *string `json:"recurrenceDetails"` + RecurrenceType UpdateScheduleDetailsRecurrenceTypeEnum `json:"recurrenceType"` + ResourceFilters []resourcefilter `json:"resourceFilters"` + Resources []Resource `json:"resources"` + TimeStarts *common.SDKTime `json:"timeStarts"` + TimeEnds *common.SDKTime `json:"timeEnds"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Description = model.Description + + m.Action = model.Action + + m.RecurrenceDetails = model.RecurrenceDetails + + m.RecurrenceType = model.RecurrenceType + + m.ResourceFilters = make([]ResourceFilter, len(model.ResourceFilters)) + for i, n := range model.ResourceFilters { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.ResourceFilters[i] = nn.(ResourceFilter) + } else { + m.ResourceFilters[i] = nil + } + } + m.Resources = make([]Resource, len(model.Resources)) + copy(m.Resources, model.Resources) + m.TimeStarts = model.TimeStarts + + m.TimeEnds = model.TimeEnds + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + return +} + +// UpdateScheduleDetailsActionEnum Enum with underlying type: string +type UpdateScheduleDetailsActionEnum string + +// Set of constants representing the allowable values for UpdateScheduleDetailsActionEnum +const ( + UpdateScheduleDetailsActionStartResource UpdateScheduleDetailsActionEnum = "START_RESOURCE" + UpdateScheduleDetailsActionStopResource UpdateScheduleDetailsActionEnum = "STOP_RESOURCE" +) + +var mappingUpdateScheduleDetailsActionEnum = map[string]UpdateScheduleDetailsActionEnum{ + "START_RESOURCE": UpdateScheduleDetailsActionStartResource, + "STOP_RESOURCE": UpdateScheduleDetailsActionStopResource, +} + +var mappingUpdateScheduleDetailsActionEnumLowerCase = map[string]UpdateScheduleDetailsActionEnum{ + "start_resource": UpdateScheduleDetailsActionStartResource, + "stop_resource": UpdateScheduleDetailsActionStopResource, +} + +// GetUpdateScheduleDetailsActionEnumValues Enumerates the set of values for UpdateScheduleDetailsActionEnum +func GetUpdateScheduleDetailsActionEnumValues() []UpdateScheduleDetailsActionEnum { + values := make([]UpdateScheduleDetailsActionEnum, 0) + for _, v := range mappingUpdateScheduleDetailsActionEnum { + values = append(values, v) + } + return values +} + +// GetUpdateScheduleDetailsActionEnumStringValues Enumerates the set of values in String for UpdateScheduleDetailsActionEnum +func GetUpdateScheduleDetailsActionEnumStringValues() []string { + return []string{ + "START_RESOURCE", + "STOP_RESOURCE", + } +} + +// GetMappingUpdateScheduleDetailsActionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUpdateScheduleDetailsActionEnum(val string) (UpdateScheduleDetailsActionEnum, bool) { + enum, ok := mappingUpdateScheduleDetailsActionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// UpdateScheduleDetailsRecurrenceTypeEnum Enum with underlying type: string +type UpdateScheduleDetailsRecurrenceTypeEnum string + +// Set of constants representing the allowable values for UpdateScheduleDetailsRecurrenceTypeEnum +const ( + UpdateScheduleDetailsRecurrenceTypeCron UpdateScheduleDetailsRecurrenceTypeEnum = "CRON" + UpdateScheduleDetailsRecurrenceTypeIcal UpdateScheduleDetailsRecurrenceTypeEnum = "ICAL" +) + +var mappingUpdateScheduleDetailsRecurrenceTypeEnum = map[string]UpdateScheduleDetailsRecurrenceTypeEnum{ + "CRON": UpdateScheduleDetailsRecurrenceTypeCron, + "ICAL": UpdateScheduleDetailsRecurrenceTypeIcal, +} + +var mappingUpdateScheduleDetailsRecurrenceTypeEnumLowerCase = map[string]UpdateScheduleDetailsRecurrenceTypeEnum{ + "cron": UpdateScheduleDetailsRecurrenceTypeCron, + "ical": UpdateScheduleDetailsRecurrenceTypeIcal, +} + +// GetUpdateScheduleDetailsRecurrenceTypeEnumValues Enumerates the set of values for UpdateScheduleDetailsRecurrenceTypeEnum +func GetUpdateScheduleDetailsRecurrenceTypeEnumValues() []UpdateScheduleDetailsRecurrenceTypeEnum { + values := make([]UpdateScheduleDetailsRecurrenceTypeEnum, 0) + for _, v := range mappingUpdateScheduleDetailsRecurrenceTypeEnum { + values = append(values, v) + } + return values +} + +// GetUpdateScheduleDetailsRecurrenceTypeEnumStringValues Enumerates the set of values in String for UpdateScheduleDetailsRecurrenceTypeEnum +func GetUpdateScheduleDetailsRecurrenceTypeEnumStringValues() []string { + return []string{ + "CRON", + "ICAL", + } +} + +// GetMappingUpdateScheduleDetailsRecurrenceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUpdateScheduleDetailsRecurrenceTypeEnum(val string) (UpdateScheduleDetailsRecurrenceTypeEnum, bool) { + enum, ok := mappingUpdateScheduleDetailsRecurrenceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/resourcescheduler/update_schedule_request_response.go b/resourcescheduler/update_schedule_request_response.go new file mode 100644 index 0000000000..70a6f68b8a --- /dev/null +++ b/resourcescheduler/update_schedule_request_response.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. + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateScheduleRequest wrapper for the UpdateSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourcescheduler/UpdateSchedule.go.html to see an example of how to use UpdateScheduleRequest. +type UpdateScheduleRequest struct { + + // This is the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the schedule. + ScheduleId *string `mandatory:"true" contributesTo:"path" name:"scheduleId"` + + // The information about a schedule that will be updated. + UpdateScheduleDetails `contributesTo:"body"` + + // This is used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // This is a unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 UpdateScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateScheduleRequest) 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 UpdateScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateScheduleRequest) 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 UpdateScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateScheduleResponse wrapper for the UpdateSchedule operation +type UpdateScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // This is a 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 UpdateScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/resourcescheduler/work_request.go b/resourcescheduler/work_request.go new file mode 100644 index 0000000000..d8c9c7b24a --- /dev/null +++ b/resourcescheduler/work_request.go @@ -0,0 +1,79 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequest This is an asynchronous work request. Work requests help you monitor long-running operations. When you start a long-running operation, +// the service creates a work request. A work request is an activity log that lets you track each step in the operation's +// progress. Each work request has an OCID that lets you interact with it programmatically and use it for automation. +type WorkRequest struct { + + // The asynchronous operation tracked by this work request. + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // This is the status of the work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // This is the resources that are affected by the work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Shows the progress of the operation tracked by the work request, as a percentage of the total work + // that must be performed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // This is the date and time the work request was created, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // This is the date and time the work request was started, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // This is the date and time the work request was finished, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // This is the date and time the work request was updated, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` +} + +func (m WorkRequest) 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 WorkRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(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(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/work_request_error.go b/resourcescheduler/work_request_error.go new file mode 100644 index 0000000000..7d3e2d9c90 --- /dev/null +++ b/resourcescheduler/work_request_error.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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestError This is an error encountered while performing an operation that is tracked by a work request. +type WorkRequestError struct { + + // A machine-usable code for the error that occurred. For a list of error codes, see + // API Errors (https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm). + Code *string `mandatory:"true" json:"code"` + + // This is a human-readable error message. + Message *string `mandatory:"true" json:"message"` + + // This is the date and time the error occurred, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestError) 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 WorkRequestError) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/work_request_error_collection.go b/resourcescheduler/work_request_error_collection.go new file mode 100644 index 0000000000..a1cf085004 --- /dev/null +++ b/resourcescheduler/work_request_error_collection.go @@ -0,0 +1,39 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestErrorCollection This is a list of work request errors. Can contain both errors and other information, such as metadata. +type WorkRequestErrorCollection struct { + + // This is a list of work request errors. + Items []WorkRequestError `mandatory:"true" json:"items"` +} + +func (m WorkRequestErrorCollection) 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 WorkRequestErrorCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/work_request_log_entry.go b/resourcescheduler/work_request_log_entry.go new file mode 100644 index 0000000000..e0caa35a3e --- /dev/null +++ b/resourcescheduler/work_request_log_entry.go @@ -0,0 +1,43 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntry This is a log message from performing an operation that is tracked by a work request. +type WorkRequestLogEntry struct { + + // This is a human-readable log message. + Message *string `mandatory:"true" json:"message"` + + // This is the date and time the log message was written, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestLogEntry) 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 WorkRequestLogEntry) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/work_request_log_entry_collection.go b/resourcescheduler/work_request_log_entry_collection.go new file mode 100644 index 0000000000..15d776a675 --- /dev/null +++ b/resourcescheduler/work_request_log_entry_collection.go @@ -0,0 +1,39 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntryCollection This is a list of work request logs. Can contain both logs and other information, such as metadata. +type WorkRequestLogEntryCollection struct { + + // This is a list of work request log entries. + Items []WorkRequestLogEntry `mandatory:"true" json:"items"` +} + +func (m WorkRequestLogEntryCollection) 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 WorkRequestLogEntryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/work_request_resource.go b/resourcescheduler/work_request_resource.go new file mode 100644 index 0000000000..67f98e146d --- /dev/null +++ b/resourcescheduler/work_request_resource.go @@ -0,0 +1,54 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestResource This is a resource created or operated on by a work request. +type WorkRequestResource struct { + + // This is the resource type that the work request affects. + EntityType *string `mandatory:"true" json:"entityType"` + + // The way in which this resource is affected by the operation tracked in the work request. + // A resource being created, updated, or deleted remains in the IN_PROGRESS state until + // work is complete for that resource, at which point it transitions to CREATED, UPDATED, + // or DELETED, respectively. + ActionType ActionTypeEnum `mandatory:"true" json:"actionType"` + + // This is an OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) or other unique identifier for the resource. + Identifier *string `mandatory:"true" json:"identifier"` + + // This is the URI path that you can use for a GET request to access the resource metadata. + EntityUri *string `mandatory:"false" json:"entityUri"` +} + +func (m WorkRequestResource) 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 WorkRequestResource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/work_request_summary.go b/resourcescheduler/work_request_summary.go new file mode 100644 index 0000000000..daef32fd99 --- /dev/null +++ b/resourcescheduler/work_request_summary.go @@ -0,0 +1,77 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummary This is the summary information about an asynchronous work request. +type WorkRequestSummary struct { + + // This is the status of the work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources that are affected by this work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Shows the progress of the operation tracked by the work request, as a percentage of the total work + // that must be performed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // This is the date and time the work request was created, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // This is the asynchronous operation tracked by this work request. + OperationType OperationTypeEnum `mandatory:"false" json:"operationType,omitempty"` + + // This is the date and time the work request was started, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // This is the date and time the work request was finished, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // This is the date and time the work request was updated, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` +} + +func (m WorkRequestSummary) 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 WorkRequestSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationStatusEnum(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(GetOperationStatusEnumStringValues(), ","))) + } + + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcescheduler/work_request_summary_collection.go b/resourcescheduler/work_request_summary_collection.go new file mode 100644 index 0000000000..548079d7e3 --- /dev/null +++ b/resourcescheduler/work_request_summary_collection.go @@ -0,0 +1,39 @@ +// 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. + +// Resource Scheduler API +// +// Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources. +// + +package resourcescheduler + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummaryCollection This is a list of work requests. Can contain both work requests and other information, such as metadata. +type WorkRequestSummaryCollection struct { + + // This is a list of work requests. + Items []WorkRequestSummary `mandatory:"true" json:"items"` +} + +func (m WorkRequestSummaryCollection) 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 WorkRequestSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +}