Skip to content

Commit e99c354

Browse files
authored
Releasing version 17.0.0
Releasing version 17.0.0
2 parents 830d15d + 37cf513 commit e99c354

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+831
-121
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44

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

7+
## 17.0.0 - 2020-03-17
8+
### Added
9+
- Support for serial console connections in the Database service
10+
- Support for preview database versions in the Database service
11+
- Support for node reboot migration maintenance status and maintenance windows in the Database service
12+
- Support for using instance metadata API v2 for instance principals authentication
13+
14+
15+
### Breaking changes
16+
- Removed the model of `AutonomousExadataInfrastructureMaintenanceWindow` from Database service
17+
718
## 16.0.0 - 2020-03-10
819
### Added
920
- Support for Events service integration with alerts in the Budgets service

common/auth/certificate_retriever.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (r *urlBasedX509CertificateRetriever) Refresh() error {
7777

7878
func (r *urlBasedX509CertificateRetriever) renewCertificate(url string) (certificatePemRaw []byte, certificate *x509.Certificate, err error) {
7979
var body bytes.Buffer
80-
if body, err = httpGet(r.dispatcher, url); err != nil {
80+
if body, _, err = httpGet(r.dispatcher, url); err != nil {
8181
return nil, nil, fmt.Errorf("failed to get certificate from %s: %s", url, err.Error())
8282
}
8383

@@ -97,7 +97,7 @@ func (r *urlBasedX509CertificateRetriever) renewCertificate(url string) (certifi
9797

9898
func (r *urlBasedX509CertificateRetriever) renewPrivateKey(url, passphrase string) (privateKeyPemRaw []byte, privateKey *rsa.PrivateKey, err error) {
9999
var body bytes.Buffer
100-
if body, err = httpGet(r.dispatcher, url); err != nil {
100+
if body, _, err = httpGet(r.dispatcher, url); err != nil {
101101
return nil, nil, fmt.Errorf("failed to get private key from %s: %s", url, err.Error())
102102
}
103103

common/auth/instance_principal_key_provider.go

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,28 @@ import (
66
"bytes"
77
"crypto/rsa"
88
"fmt"
9-
"github.com/oracle/oci-go-sdk/common"
109
"net/http"
10+
"strings"
11+
"github.com/oracle/oci-go-sdk/common"
1112
)
1213

1314
const (
14-
regionURL = `http://169.254.169.254/opc/v1/instance/region`
15-
leafCertificateURL = `http://169.254.169.254/opc/v1/identity/cert.pem`
16-
leafCertificateKeyURL = `http://169.254.169.254/opc/v1/identity/key.pem`
15+
metadataBaseURL = `http://169.254.169.254/opc/v2`
16+
metadataFallbackURL = `http://169.254.169.254/opc/v1`
17+
regionPath = `/instance/region`
18+
leafCertificatePath = `/identity/cert.pem`
19+
leafCertificateKeyPath = `/identity/key.pem`
20+
intermediateCertificatePath = `/identity/intermediate.pem`
21+
1722
leafCertificateKeyPassphrase = `` // No passphrase for the private key for Compute instances
18-
intermediateCertificateURL = `http://169.254.169.254/opc/v1/identity/intermediate.pem`
1923
intermediateCertificateKeyURL = ``
2024
intermediateCertificateKeyPassphrase = `` // No passphrase for the private key for Compute instances
2125
)
2226

27+
var (
28+
regionURL, leafCertificateURL, leafCertificateKeyURL, intermediateCertificateURL string
29+
)
30+
2331
// instancePrincipalKeyProvider implements KeyProvider to provide a key ID and its corresponding private key
2432
// for an instance principal by getting a security token via x509FederationClient.
2533
//
@@ -40,6 +48,7 @@ type instancePrincipalKeyProvider struct {
4048
// KeyID that is not expired at the moment, the PrivateRSAKey that the client acquires at a next moment could be
4149
// invalid because the KeyID could be already expired.
4250
func newInstancePrincipalKeyProvider(modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (provider *instancePrincipalKeyProvider, err error) {
51+
updateX509CertRetrieverURLParas(metadataBaseURL)
4352
clientModifier := newDispatcherModifier(modifier)
4453

4554
client, err := clientModifier.Modify(&http.Client{})
@@ -83,12 +92,25 @@ func newInstancePrincipalKeyProvider(modifier func(common.HTTPRequestDispatcher)
8392

8493
func getRegionForFederationClient(dispatcher common.HTTPRequestDispatcher, url string) (r common.Region, err error) {
8594
var body bytes.Buffer
86-
if body, err = httpGet(dispatcher, url); err != nil {
95+
var statusCode int
96+
if body, statusCode, err = httpGet(dispatcher, url); err != nil {
97+
if statusCode == 404 && strings.Compare(url, metadataBaseURL+regionPath) == 0 {
98+
common.Logf("Falling back to http://169.254.169.254/opc/v1 to try again...\n")
99+
updateX509CertRetrieverURLParas(metadataFallbackURL)
100+
return getRegionForFederationClient(dispatcher, regionURL)
101+
}
87102
return
88103
}
89104
return common.StringToRegion(body.String()), nil
90105
}
91106

107+
func updateX509CertRetrieverURLParas(baseURL string) {
108+
regionURL = baseURL + regionPath
109+
leafCertificateURL = baseURL + leafCertificatePath
110+
leafCertificateKeyURL = baseURL + leafCertificateKeyPath
111+
intermediateCertificateURL = baseURL + intermediateCertificatePath
112+
}
113+
92114
func (p *instancePrincipalKeyProvider) RegionForFederationClient() common.Region {
93115
return p.Region
94116
}

common/auth/utils.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
// httpGet makes a simple HTTP GET request to the given URL, expecting only "200 OK" status code.
1717
// This is basically for the Instance Metadata Service.
18-
func httpGet(dispatcher common.HTTPRequestDispatcher, url string) (body bytes.Buffer, err error) {
18+
func httpGet(dispatcher common.HTTPRequestDispatcher, url string) (body bytes.Buffer, statusCode int, err error) {
1919
var response *http.Response
2020
request, err := http.NewRequest(http.MethodGet, url, nil)
2121

@@ -25,6 +25,7 @@ func httpGet(dispatcher common.HTTPRequestDispatcher, url string) (body bytes.Bu
2525
return
2626
}
2727

28+
statusCode = response.StatusCode
2829
common.IfDebug(func() {
2930
if dump, e := httputil.DumpResponse(response, true); e == nil {
3031
common.Logf("Dump Response %v", string(dump))
@@ -38,7 +39,7 @@ func httpGet(dispatcher common.HTTPRequestDispatcher, url string) (body bytes.Bu
3839
return
3940
}
4041

41-
if response.StatusCode != http.StatusOK {
42+
if statusCode != http.StatusOK {
4243
err = fmt.Errorf("HTTP Get failed: URL: %s, Status: %s, Message: %s",
4344
url, response.Status, body.String())
4445
return

common/version.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

database/autonomous_database.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ type AutonomousDatabase struct {
9595
// This restriction applies to both the client subnet and the backup subnet.
9696
SubnetId *string `mandatory:"false" json:"subnetId"`
9797

98-
// A list of the OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that this DB system belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see Security Rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm).
98+
// A list of the OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that this resource belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see Security Rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm).
99+
// **NsgIds restrictions:**
100+
// - Autonomous Databases with private access require at least 1 Network Security Group (NSG). The nsgIds array cannot be empty.
99101
NsgIds []string `mandatory:"false" json:"nsgIds"`
100102

101103
// The private endpoint for the resource.
@@ -110,7 +112,9 @@ type AutonomousDatabase struct {
110112
// Indicates if the Autonomous Database version is a preview version.
111113
IsPreview *bool `mandatory:"false" json:"isPreview"`
112114

113-
// The Autonomous Database workload type. OLTP indicates an Autonomous Transaction Processing database and DW indicates an Autonomous Data Warehouse database.
115+
// The Autonomous Database workload type. The following values are valid:
116+
// - OLTP - indicates an Autonomous Transaction Processing database
117+
// - DW - indicates an Autonomous Data Warehouse database
114118
DbWorkload AutonomousDatabaseDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"`
115119

116120
// The client IP access control list (ACL). This feature is available for databases on shared Exadata infrastructure (https://docs.cloud.oracle.com/Content/Database/Concepts/adboverview.htm#AEI) only.

database/autonomous_database_summary.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ type AutonomousDatabaseSummary struct {
9696
// This restriction applies to both the client subnet and the backup subnet.
9797
SubnetId *string `mandatory:"false" json:"subnetId"`
9898

99-
// A list of the OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that this DB system belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see Security Rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm).
99+
// A list of the OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that this resource belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see Security Rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm).
100+
// **NsgIds restrictions:**
101+
// - Autonomous Databases with private access require at least 1 Network Security Group (NSG). The nsgIds array cannot be empty.
100102
NsgIds []string `mandatory:"false" json:"nsgIds"`
101103

102104
// The private endpoint for the resource.
@@ -111,7 +113,9 @@ type AutonomousDatabaseSummary struct {
111113
// Indicates if the Autonomous Database version is a preview version.
112114
IsPreview *bool `mandatory:"false" json:"isPreview"`
113115

114-
// The Autonomous Database workload type. OLTP indicates an Autonomous Transaction Processing database and DW indicates an Autonomous Data Warehouse database.
116+
// The Autonomous Database workload type. The following values are valid:
117+
// - OLTP - indicates an Autonomous Transaction Processing database
118+
// - DW - indicates an Autonomous Data Warehouse database
115119
DbWorkload AutonomousDatabaseSummaryDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"`
116120

117121
// The client IP access control list (ACL). This feature is available for databases on shared Exadata infrastructure (https://docs.cloud.oracle.com/Content/Database/Concepts/adboverview.htm#AEI) only.

database/autonomous_db_preview_version_summary.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ type AutonomousDbPreviewVersionSummary struct {
2424
// The date and time when the preview version availability ends.
2525
TimePreviewEnd *common.SDKTime `mandatory:"false" json:"timePreviewEnd"`
2626

27-
// The Autonomous Database workload type. OLTP indicates an Autonomous Transaction Processing database and DW indicates an Autonomous Data Warehouse database.
27+
// The Autonomous Database workload type. The following values are valid:
28+
// - OLTP - indicates an Autonomous Transaction Processing database
29+
// - DW - indicates an Autonomous Data Warehouse database
2830
DbWorkload AutonomousDbPreviewVersionSummaryDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"`
2931

3032
// A URL that points to a detailed description of the preview version.

database/autonomous_db_version_summary.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ type AutonomousDbVersionSummary struct {
1818
// A valid Oracle Database version for Autonomous Database.
1919
Version *string `mandatory:"true" json:"version"`
2020

21-
// The Autonomous Database workload type. OLTP indicates an Autonomous Transaction Processing database and DW indicates an Autonomous Data Warehouse database.
21+
// The Autonomous Database workload type. The following values are valid:
22+
// - OLTP - indicates an Autonomous Transaction Processing database
23+
// - DW - indicates an Autonomous Data Warehouse database
2224
DbWorkload AutonomousDbVersionSummaryDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"`
2325

2426
// True if the database uses dedicated Exadata infrastructure (https://docs.cloud.oracle.com/Content/Database/Concepts/adbddoverview.htm).

database/autonomous_exadata_infrastructure.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ type AutonomousExadataInfrastructure struct {
4949

5050
MaintenanceWindow *MaintenanceWindow `mandatory:"true" json:"maintenanceWindow"`
5151

52-
// A list of the OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that this DB system belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see Security Rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm).
52+
// A list of the OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that this resource belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see Security Rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm).
53+
// **NsgIds restrictions:**
54+
// - Autonomous Databases with private access require at least 1 Network Security Group (NSG). The nsgIds array cannot be empty.
5355
NsgIds []string `mandatory:"false" json:"nsgIds"`
5456

5557
// Additional information about the current lifecycle state of the Autonomous Exadata Infrastructure.

database/autonomous_exadata_infrastructure_maintenance_window.go

Lines changed: 0 additions & 62 deletions
This file was deleted.

database/autonomous_exadata_infrastructure_summary.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ type AutonomousExadataInfrastructureSummary struct {
5858

5959
MaintenanceWindow *MaintenanceWindow `mandatory:"true" json:"maintenanceWindow"`
6060

61-
// A list of the OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that this DB system belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see Security Rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm).
61+
// A list of the OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that this resource belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see Security Rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm).
62+
// **NsgIds restrictions:**
63+
// - Autonomous Databases with private access require at least 1 Network Security Group (NSG). The nsgIds array cannot be empty.
6264
NsgIds []string `mandatory:"false" json:"nsgIds"`
6365

6466
// Additional information about the current lifecycle state of the Autonomous Exadata Infrastructure.

0 commit comments

Comments
 (0)