Skip to content

Commit

Permalink
Releasing version 65.61.1
Browse files Browse the repository at this point in the history
Releasing version 65.61.1
  • Loading branch information
oci-dex-release-bot authored Mar 12, 2024
2 parents 67a4299 + 19f014f commit baeb260
Show file tree
Hide file tree
Showing 36 changed files with 1,823 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)

## 65.61.1 - 2024-03-12
### Added
- Support for new development license type on dedicated infrastructure in the Database service
- Support for placement parameters on Autonomous Container Database create operation in the Database service
- Support for autoscaling on model deployment in the Data Science service


## 65.61.0 - 2024-03-05
n### Added
- Support for Linux capabilities configuration for the containers in the Container Instances service
Expand Down
3 changes: 3 additions & 0 deletions common/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,9 @@ func (client BaseClient) httpDo(request *http.Request) (response *http.Response,
// CloseBodyIfValid closes the body of an http response if the response and the body are valid
func CloseBodyIfValid(httpResponse *http.Response) {
if httpResponse != nil && httpResponse.Body != nil {
if httpResponse.Header != nil && strings.ToLower(httpResponse.Header.Get("content-type")) == "text/event-stream" {
return
}
httpResponse.Body.Close()
}
}
Expand Down
4 changes: 2 additions & 2 deletions common/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -1068,9 +1068,9 @@ func responseToStruct(response *http.Response, val *reflect.Value, unmarshaler P
// Notice the current implementation only supports native types:int, strings, floats, bool as the field types
func UnmarshalResponse(httpResponse *http.Response, responseStruct interface{}) (err error) {

// Check for text/event-stream content type, which cannot be Unmarshalled by the SDK
// Check for text/event-stream content type, and return without unmarshalling
if httpResponse != nil && httpResponse.Header != nil && strings.ToLower(httpResponse.Header.Get("content-type")) == "text/event-stream" {
return fmt.Errorf("streaming mode is currently not supported. Please use non-streaming mode for this API instead")
return
}

var val *reflect.Value
Expand Down
92 changes: 92 additions & 0 deletions common/sseReader.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// 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.

package common

import (
"bufio"
"bytes"
"context"
"io"
"net/http"
)

type SseReader struct {
HttpBody io.ReadCloser
eventScanner bufio.Scanner
OnClose func(r *SseReader)
}

// InvalidSSEResponseError returned in the case that a nil response body was given
// to NewSSEReader()
type InvalidSSEResponseError struct {
}

const InvalidResponseErrorMessage = "invalid response struct given to NewSSEReader"

func (e InvalidSSEResponseError) Error() string {
return InvalidResponseErrorMessage
}

// NewSSEReader returns an SSE Reader given an sse response
func NewSSEReader(response *http.Response) (*SseReader, error) {

if response == nil || response.Body == nil {
return nil, InvalidSSEResponseError{}
}

reader := &SseReader{
HttpBody: response.Body,
eventScanner: *bufio.NewScanner(response.Body),
OnClose: func(r *SseReader) { r.HttpBody.Close() }, // Default on close function, ensures body is closed after use
}
return reader, nil
}

// Take the response in bytes and trim it if necessary
func processEvent(e []byte) []byte {
e = bytes.TrimPrefix(e, []byte("data: ")) // Text/event-stream always prefixed with 'data: '
return e
}

// ReadNextEvent reads the next event in the stream, return it unmarshalled
func (r *SseReader) ReadNextEvent() (event []byte, err error) {
if r.eventScanner.Scan() {
eventBytes := r.eventScanner.Bytes()
return processEvent(eventBytes), nil
} else {

// Close out the stream since we are finished reading from it
if r.OnClose != nil {
r.OnClose(r)
}

err := r.eventScanner.Err()
if err == context.Canceled || err == nil {
err = io.EOF
}
return nil, err
}

}

// ReadAllEvents reads all events from the response stream, and processes each with given event handler
func (r *SseReader) ReadAllEvents(eventHandler func(e []byte)) error {
for {

event, err := r.ReadNextEvent()

if err != nil {

if err == io.EOF {
err = nil
}
return err
}

// Ignore empty events
if len(event) > 0 {
eventHandler(event)
}
}
}
2 changes: 1 addition & 1 deletion common/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 102 additions & 0 deletions database/autonomous_container_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ type AutonomousContainerDatabase struct {

// The timestamp of last successful backup. Here NULL value represents either there are no successful backups or backups are not configured for this Autonomous Container Database.
TimeOfLastBackup *common.SDKTime `mandatory:"false" json:"timeOfLastBackup"`

// The value above which an Autonomous Database will be split across multiple nodes. This value defaults to 16 when the "CPU per VM" value on the Autonomous VM Cluster is greater than 16. Otherwise, it defaults to the "CPU per VM" value.
DbSplitThreshold *int `mandatory:"false" json:"dbSplitThreshold"`

// The percentage of CPUs to reserve for a single node Autonomous Database, in increments of 25.
VmFailoverReservation *int `mandatory:"false" json:"vmFailoverReservation"`

// This option determines whether to open an Autonomous Database across the maximum number of nodes or the least number of nodes. The default will be for the minimum number of VMs.
DistributionAffinity AutonomousContainerDatabaseDistributionAffinityEnum `mandatory:"false" json:"distributionAffinity,omitempty"`

// Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.
NetServicesArchitecture AutonomousContainerDatabaseNetServicesArchitectureEnum `mandatory:"false" json:"netServicesArchitecture,omitempty"`
}

func (m AutonomousContainerDatabase) String() string {
Expand Down Expand Up @@ -187,6 +199,12 @@ func (m AutonomousContainerDatabase) ValidateEnumValue() (bool, error) {
if _, ok := GetMappingAutonomousContainerDatabaseComputeModelEnum(string(m.ComputeModel)); !ok && m.ComputeModel != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ComputeModel: %s. Supported values are: %s.", m.ComputeModel, strings.Join(GetAutonomousContainerDatabaseComputeModelEnumStringValues(), ",")))
}
if _, ok := GetMappingAutonomousContainerDatabaseDistributionAffinityEnum(string(m.DistributionAffinity)); !ok && m.DistributionAffinity != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DistributionAffinity: %s. Supported values are: %s.", m.DistributionAffinity, strings.Join(GetAutonomousContainerDatabaseDistributionAffinityEnumStringValues(), ",")))
}
if _, ok := GetMappingAutonomousContainerDatabaseNetServicesArchitectureEnum(string(m.NetServicesArchitecture)); !ok && m.NetServicesArchitecture != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NetServicesArchitecture: %s. Supported values are: %s.", m.NetServicesArchitecture, strings.Join(GetAutonomousContainerDatabaseNetServicesArchitectureEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
Expand Down Expand Up @@ -550,3 +568,87 @@ func GetMappingAutonomousContainerDatabaseComputeModelEnum(val string) (Autonomo
enum, ok := mappingAutonomousContainerDatabaseComputeModelEnumLowerCase[strings.ToLower(val)]
return enum, ok
}

// AutonomousContainerDatabaseDistributionAffinityEnum Enum with underlying type: string
type AutonomousContainerDatabaseDistributionAffinityEnum string

// Set of constants representing the allowable values for AutonomousContainerDatabaseDistributionAffinityEnum
const (
AutonomousContainerDatabaseDistributionAffinityMinimumDistribution AutonomousContainerDatabaseDistributionAffinityEnum = "MINIMUM_DISTRIBUTION"
AutonomousContainerDatabaseDistributionAffinityMaximumDistribution AutonomousContainerDatabaseDistributionAffinityEnum = "MAXIMUM_DISTRIBUTION"
)

var mappingAutonomousContainerDatabaseDistributionAffinityEnum = map[string]AutonomousContainerDatabaseDistributionAffinityEnum{
"MINIMUM_DISTRIBUTION": AutonomousContainerDatabaseDistributionAffinityMinimumDistribution,
"MAXIMUM_DISTRIBUTION": AutonomousContainerDatabaseDistributionAffinityMaximumDistribution,
}

var mappingAutonomousContainerDatabaseDistributionAffinityEnumLowerCase = map[string]AutonomousContainerDatabaseDistributionAffinityEnum{
"minimum_distribution": AutonomousContainerDatabaseDistributionAffinityMinimumDistribution,
"maximum_distribution": AutonomousContainerDatabaseDistributionAffinityMaximumDistribution,
}

// GetAutonomousContainerDatabaseDistributionAffinityEnumValues Enumerates the set of values for AutonomousContainerDatabaseDistributionAffinityEnum
func GetAutonomousContainerDatabaseDistributionAffinityEnumValues() []AutonomousContainerDatabaseDistributionAffinityEnum {
values := make([]AutonomousContainerDatabaseDistributionAffinityEnum, 0)
for _, v := range mappingAutonomousContainerDatabaseDistributionAffinityEnum {
values = append(values, v)
}
return values
}

// GetAutonomousContainerDatabaseDistributionAffinityEnumStringValues Enumerates the set of values in String for AutonomousContainerDatabaseDistributionAffinityEnum
func GetAutonomousContainerDatabaseDistributionAffinityEnumStringValues() []string {
return []string{
"MINIMUM_DISTRIBUTION",
"MAXIMUM_DISTRIBUTION",
}
}

// GetMappingAutonomousContainerDatabaseDistributionAffinityEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingAutonomousContainerDatabaseDistributionAffinityEnum(val string) (AutonomousContainerDatabaseDistributionAffinityEnum, bool) {
enum, ok := mappingAutonomousContainerDatabaseDistributionAffinityEnumLowerCase[strings.ToLower(val)]
return enum, ok
}

// AutonomousContainerDatabaseNetServicesArchitectureEnum Enum with underlying type: string
type AutonomousContainerDatabaseNetServicesArchitectureEnum string

// Set of constants representing the allowable values for AutonomousContainerDatabaseNetServicesArchitectureEnum
const (
AutonomousContainerDatabaseNetServicesArchitectureDedicated AutonomousContainerDatabaseNetServicesArchitectureEnum = "DEDICATED"
AutonomousContainerDatabaseNetServicesArchitectureShared AutonomousContainerDatabaseNetServicesArchitectureEnum = "SHARED"
)

var mappingAutonomousContainerDatabaseNetServicesArchitectureEnum = map[string]AutonomousContainerDatabaseNetServicesArchitectureEnum{
"DEDICATED": AutonomousContainerDatabaseNetServicesArchitectureDedicated,
"SHARED": AutonomousContainerDatabaseNetServicesArchitectureShared,
}

var mappingAutonomousContainerDatabaseNetServicesArchitectureEnumLowerCase = map[string]AutonomousContainerDatabaseNetServicesArchitectureEnum{
"dedicated": AutonomousContainerDatabaseNetServicesArchitectureDedicated,
"shared": AutonomousContainerDatabaseNetServicesArchitectureShared,
}

// GetAutonomousContainerDatabaseNetServicesArchitectureEnumValues Enumerates the set of values for AutonomousContainerDatabaseNetServicesArchitectureEnum
func GetAutonomousContainerDatabaseNetServicesArchitectureEnumValues() []AutonomousContainerDatabaseNetServicesArchitectureEnum {
values := make([]AutonomousContainerDatabaseNetServicesArchitectureEnum, 0)
for _, v := range mappingAutonomousContainerDatabaseNetServicesArchitectureEnum {
values = append(values, v)
}
return values
}

// GetAutonomousContainerDatabaseNetServicesArchitectureEnumStringValues Enumerates the set of values in String for AutonomousContainerDatabaseNetServicesArchitectureEnum
func GetAutonomousContainerDatabaseNetServicesArchitectureEnumStringValues() []string {
return []string{
"DEDICATED",
"SHARED",
}
}

// GetMappingAutonomousContainerDatabaseNetServicesArchitectureEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingAutonomousContainerDatabaseNetServicesArchitectureEnum(val string) (AutonomousContainerDatabaseNetServicesArchitectureEnum, bool) {
enum, ok := mappingAutonomousContainerDatabaseNetServicesArchitectureEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
Loading

0 comments on commit baeb260

Please sign in to comment.