Upgrade oci-go-sdk to latest

This commit is contained in:
Andrew Pryde 2021-03-19 13:30:43 +00:00
parent 9f647ba2bb
commit a915ec8e05
755 changed files with 12424 additions and 2305 deletions

View File

@ -4,7 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/oracle/oci-go-sdk/core" "github.com/oracle/oci-go-sdk/v36/core"
) )
// Artifact is an artifact implementation that contains a built Custom Image. // Artifact is an artifact implementation that contains a built Custom Image.

View File

@ -12,7 +12,7 @@ import (
"github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps" "github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
ocommon "github.com/hashicorp/packer/builder/oracle/common" ocommon "github.com/hashicorp/packer/builder/oracle/common"
"github.com/oracle/oci-go-sdk/core" "github.com/oracle/oci-go-sdk/v36/core"
) )
// BuilderId uniquely identifies the builder // BuilderId uniquely identifies the builder

View File

@ -19,8 +19,8 @@ import (
"github.com/hashicorp/packer-plugin-sdk/pathing" "github.com/hashicorp/packer-plugin-sdk/pathing"
"github.com/hashicorp/packer-plugin-sdk/template/config" "github.com/hashicorp/packer-plugin-sdk/template/config"
"github.com/hashicorp/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer-plugin-sdk/template/interpolate"
ocicommon "github.com/oracle/oci-go-sdk/common" ocicommon "github.com/oracle/oci-go-sdk/v36/common"
ociauth "github.com/oracle/oci-go-sdk/common/auth" ociauth "github.com/oracle/oci-go-sdk/v36/common/auth"
) )
type CreateVNICDetails struct { type CreateVNICDetails struct {
@ -222,7 +222,7 @@ func (c *Config) Prepare(raws ...interface{}) error {
} }
providers := []ocicommon.ConfigurationProvider{ providers := []ocicommon.ConfigurationProvider{
NewRawConfigurationProvider(c.TenancyID, c.UserID, c.Region, c.Fingerprint, string(keyContent), &c.PassPhrase), ocicommon.NewRawConfigurationProvider(c.TenancyID, c.UserID, c.Region, c.Fingerprint, string(keyContent), &c.PassPhrase),
} }
if fileProvider != nil { if fileProvider != nil {

View File

@ -1,76 +0,0 @@
package oci
import (
"crypto/rsa"
"errors"
"fmt"
"github.com/oracle/oci-go-sdk/common"
)
// rawConfigurationProvider allows a user to simply construct a configuration
// provider from raw values. It errors on access when those values are empty.
type rawConfigurationProvider struct {
tenancy string
user string
region string
fingerprint string
privateKey string
privateKeyPassphrase *string
}
// NewRawConfigurationProvider will create a rawConfigurationProvider.
func NewRawConfigurationProvider(tenancy, user, region, fingerprint, privateKey string, privateKeyPassphrase *string) common.ConfigurationProvider {
return rawConfigurationProvider{tenancy, user, region, fingerprint, privateKey, privateKeyPassphrase}
}
func (p rawConfigurationProvider) PrivateRSAKey() (key *rsa.PrivateKey, err error) {
return common.PrivateKeyFromBytes([]byte(p.privateKey), p.privateKeyPassphrase)
}
func (p rawConfigurationProvider) KeyID() (keyID string, err error) {
tenancy, err := p.TenancyOCID()
if err != nil {
return
}
user, err := p.UserOCID()
if err != nil {
return
}
fingerprint, err := p.KeyFingerprint()
if err != nil {
return
}
return fmt.Sprintf("%s/%s/%s", tenancy, user, fingerprint), nil
}
func (p rawConfigurationProvider) TenancyOCID() (string, error) {
if p.tenancy == "" {
return "", errors.New("no tenancy provided")
}
return p.tenancy, nil
}
func (p rawConfigurationProvider) UserOCID() (string, error) {
if p.user == "" {
return "", errors.New("no user provided")
}
return p.user, nil
}
func (p rawConfigurationProvider) KeyFingerprint() (string, error) {
if p.fingerprint == "" {
return "", errors.New("no fingerprint provided")
}
return p.fingerprint, nil
}
func (p rawConfigurationProvider) Region() (string, error) {
if p.region == "" {
return "", errors.New("no region provided")
}
return p.region, nil
}

View File

@ -131,7 +131,7 @@ func TestConfig(t *testing.T) {
t.Run("NoAccessConfig", func(t *testing.T) { t.Run("NoAccessConfig", func(t *testing.T) {
raw := testConfig(cfgFile) raw := testConfig(cfgFile)
delete(raw, "access_cfg_file") raw["access_cfg_file"] = "/tmp/random/access/config/file/should/not/exist"
var c Config var c Config
errs := c.Prepare(raw) errs := c.Prepare(raw)
@ -140,6 +140,10 @@ func TestConfig(t *testing.T) {
"'user_ocid'", "'tenancy_ocid'", "'fingerprint'", "'key_file'", "'user_ocid'", "'tenancy_ocid'", "'fingerprint'", "'key_file'",
} }
if errs == nil {
t.Fatalf("Expected errors %q but got none", expectedErrors)
}
s := errs.Error() s := errs.Error()
for _, expected := range expectedErrors { for _, expected := range expectedErrors {
if !strings.Contains(s, expected) { if !strings.Contains(s, expected) {

View File

@ -3,7 +3,7 @@ package oci
import ( import (
"context" "context"
"github.com/oracle/oci-go-sdk/core" "github.com/oracle/oci-go-sdk/v36/core"
) )
// Driver interfaces between the builder steps and the OCI SDK. // Driver interfaces between the builder steps and the OCI SDK.

View File

@ -3,7 +3,7 @@ package oci
import ( import (
"context" "context"
"github.com/oracle/oci-go-sdk/core" "github.com/oracle/oci-go-sdk/v36/core"
) )
// driverMock implements the Driver interface and communicates with Oracle // driverMock implements the Driver interface and communicates with Oracle

View File

@ -11,8 +11,8 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
core "github.com/oracle/oci-go-sdk/core" core "github.com/oracle/oci-go-sdk/v36/core"
) )
// driverOCI implements the Driver interface and communicates with Oracle // driverOCI implements the Driver interface and communicates with Oracle

View File

@ -3,6 +3,8 @@ package oci
import ( import (
"crypto/rand" "crypto/rand"
"crypto/rsa" "crypto/rsa"
"github.com/oracle/oci-go-sdk/v36/common"
) )
// Mock struct to be used during testing to obtain Instance Principals. // Mock struct to be used during testing to obtain Instance Principals.
@ -32,3 +34,10 @@ func (p instancePrincipalConfigurationProviderMock) KeyFingerprint() (string, er
func (p instancePrincipalConfigurationProviderMock) Region() (string, error) { func (p instancePrincipalConfigurationProviderMock) Region() (string, error) {
return "some_random_region", nil return "some_random_region", nil
} }
func (p instancePrincipalConfigurationProviderMock) AuthType() (common.AuthConfig, error) {
return common.AuthConfig{
AuthType: common.InstancePrincipal,
IsFromConfigFile: false,
OboToken: nil}, nil
}

4
go.mod
View File

@ -64,12 +64,14 @@ require (
github.com/mitchellh/cli v1.1.0 github.com/mitchellh/cli v1.1.0
github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed
github.com/mitchellh/gox v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.0 github.com/mitchellh/mapstructure v1.4.0
github.com/mitchellh/panicwrap v1.0.0 github.com/mitchellh/panicwrap v1.0.0
github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784 github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784
github.com/mitchellh/reflectwalk v1.0.0 github.com/mitchellh/reflectwalk v1.0.0
github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b
github.com/oracle/oci-go-sdk v24.3.0+incompatible github.com/oracle/oci-go-sdk v18.0.0+incompatible // indirect
github.com/oracle/oci-go-sdk/v36 v36.2.0
github.com/outscale/osc-sdk-go/osc v0.0.0-20200722135656-d654809d0699 github.com/outscale/osc-sdk-go/osc v0.0.0-20200722135656-d654809d0699
github.com/pierrec/lz4 v2.0.5+incompatible github.com/pierrec/lz4 v2.0.5+incompatible
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1

4
go.sum
View File

@ -526,6 +526,7 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX
github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4=
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI=
github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4=
github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
@ -552,9 +553,12 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ
github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b h1:LGItPaClbzopugAomw5VFKnG3h1dUr9QW5KOU+m8gu0= github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b h1:LGItPaClbzopugAomw5VFKnG3h1dUr9QW5KOU+m8gu0=
github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/oracle/oci-go-sdk v18.0.0+incompatible h1:FLV4KixsVfF3rwyVTMI6Ryp/Q+OSb9sR5TawbfjFLN4=
github.com/oracle/oci-go-sdk v18.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= github.com/oracle/oci-go-sdk v18.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
github.com/oracle/oci-go-sdk v24.3.0+incompatible h1:x4mcfb4agelf1O4/1/auGlZ1lr97jXRSSN5MxTgG/zU= github.com/oracle/oci-go-sdk v24.3.0+incompatible h1:x4mcfb4agelf1O4/1/auGlZ1lr97jXRSSN5MxTgG/zU=
github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
github.com/oracle/oci-go-sdk/v36 v36.2.0 h1:oBaN/FnBDy3ohMyVZ/rKfekYxnyksG2KK0YAhT5HSnk=
github.com/oracle/oci-go-sdk/v36 v36.2.0/go.mod h1:t8Y/M3Lh8X4BOJhtThJKe1skRTg7qom7oWyHiNjo4RM=
github.com/outscale/osc-sdk-go/osc v0.0.0-20200722135656-d654809d0699 h1:SHe9i7h5cHe+cB77fQ6lsEgIwKg3ckNU90P03CjGMnI= github.com/outscale/osc-sdk-go/osc v0.0.0-20200722135656-d654809d0699 h1:SHe9i7h5cHe+cB77fQ6lsEgIwKg3ckNU90P03CjGMnI=
github.com/outscale/osc-sdk-go/osc v0.0.0-20200722135656-d654809d0699/go.mod h1:5AqqNH1X8zCHescKVlpSHRzrat1KCKDXqZoQPe8fY3A= github.com/outscale/osc-sdk-go/osc v0.0.0-20200722135656-d654809d0699/go.mod h1:5AqqNH1X8zCHescKVlpSHRzrat1KCKDXqZoQPe8fY3A=
github.com/packer-community/winrmcp v0.0.0-20180921204643-0fd363d6159a h1:A3QMuteviunoaY/8ex+RKFqwhcZJ/Cf3fCW3IwL2wx4= github.com/packer-community/winrmcp v0.0.0-20180921204643-0fd363d6159a h1:A3QMuteviunoaY/8ex+RKFqwhcZJ/Cf3fCW3IwL2wx4=

View File

@ -1,34 +0,0 @@
// Copyright (c) 2016, 2018, 2020, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"github.com/oracle/oci-go-sdk/common"
)
// InstanceConfigurationLaunchInstanceAgentConfigDetails Instance agent configuration options to choose for launching the instance
type InstanceConfigurationLaunchInstanceAgentConfigDetails struct {
// Whether the agent running on the instance can gather performance metrics and monitor the instance.
// Default value is false.
IsMonitoringDisabled *bool `mandatory:"false" json:"isMonitoringDisabled"`
// Whether the agent running on the instance can run all the available management plugins.
// Default value is false.
IsManagementDisabled *bool `mandatory:"false" json:"isManagementDisabled"`
}
func (m InstanceConfigurationLaunchInstanceAgentConfigDetails) String() string {
return common.PointerString(m)
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 auth package auth
@ -9,7 +9,7 @@ import (
"crypto/x509" "crypto/x509"
"encoding/pem" "encoding/pem"
"fmt" "fmt"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"sync" "sync"
) )

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 auth package auth
@ -6,7 +6,7 @@ package auth
import ( import (
"crypto/rsa" "crypto/rsa"
"fmt" "fmt"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
type instancePrincipalConfigurationProvider struct { type instancePrincipalConfigurationProvider struct {
@ -104,3 +104,7 @@ func (p instancePrincipalConfigurationProvider) Region() (string, error) {
} }
return string(*p.region), nil return string(*p.region), nil
} }
func (p instancePrincipalConfigurationProvider) AuthType() (common.AuthConfig, error) {
return common.AuthConfig{common.InstancePrincipal, false, nil}, fmt.Errorf("unsupported, keep the interface")
}

View File

@ -1,9 +1,9 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 auth package auth
import "github.com/oracle/oci-go-sdk/common" import "github.com/oracle/oci-go-sdk/v36/common"
//dispatcherModifier gives ability to modify a HTTPRequestDispatcher before use. //dispatcherModifier gives ability to modify a HTTPRequestDispatcher before use.
type dispatcherModifier struct { type dispatcherModifier struct {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 auth provides supporting functions and structs for authentication // Package auth provides supporting functions and structs for authentication
@ -12,7 +12,7 @@ import (
"encoding/pem" "encoding/pem"
"errors" "errors"
"fmt" "fmt"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"os" "os"
@ -107,7 +107,7 @@ func newFileBasedFederationClient(securityTokenPath string, supplier sessionKeyS
} }
var newToken securityToken var newToken securityToken
if newToken, err = newInstancePrincipalToken(string(content)); err != nil { if newToken, err = newPrincipalToken(string(content)); err != nil {
return nil, fmt.Errorf("failed to read security token from :%s. Due to: %s", securityTokenPath, err.Error()) return nil, fmt.Errorf("failed to read security token from :%s. Due to: %s", securityTokenPath, err.Error())
} }
@ -119,7 +119,7 @@ func newFileBasedFederationClient(securityTokenPath string, supplier sessionKeyS
func newStaticFederationClient(sessionToken string, supplier sessionKeySupplier) (*genericFederationClient, error) { func newStaticFederationClient(sessionToken string, supplier sessionKeySupplier) (*genericFederationClient, error) {
var newToken securityToken var newToken securityToken
var err error var err error
if newToken, err = newInstancePrincipalToken(string(sessionToken)); err != nil { if newToken, err = newPrincipalToken(string(sessionToken)); err != nil {
return nil, fmt.Errorf("failed to read security token. Due to: %s", err.Error()) return nil, fmt.Errorf("failed to read security token. Due to: %s", err.Error())
} }
@ -307,7 +307,7 @@ func (c *x509FederationClient) getSecurityToken() (securityToken, error) {
return nil, fmt.Errorf("failed to unmarshal the response: %s", err.Error()) return nil, fmt.Errorf("failed to unmarshal the response: %s", err.Error())
} }
return newInstancePrincipalToken(response.Token.Token) return newPrincipalToken(response.Token.Token)
} }
func (c *x509FederationClient) GetClaim(key string) (interface{}, error) { func (c *x509FederationClient) GetClaim(key string) (interface{}, error) {
@ -535,24 +535,24 @@ type securityToken interface {
ClaimHolder ClaimHolder
} }
type instancePrincipalToken struct { type principalToken struct {
tokenString string tokenString string
jwtToken *jwtToken jwtToken *jwtToken
} }
func newInstancePrincipalToken(tokenString string) (newToken securityToken, err error) { func newPrincipalToken(tokenString string) (newToken securityToken, err error) {
var jwtToken *jwtToken var jwtToken *jwtToken
if jwtToken, err = parseJwt(tokenString); err != nil { if jwtToken, err = parseJwt(tokenString); err != nil {
return nil, fmt.Errorf("failed to parse the token string \"%s\": %s", tokenString, err.Error()) return nil, fmt.Errorf("failed to parse the token string \"%s\": %s", tokenString, err.Error())
} }
return &instancePrincipalToken{tokenString, jwtToken}, nil return &principalToken{tokenString, jwtToken}, nil
} }
func (t *instancePrincipalToken) String() string { func (t *principalToken) String() string {
return t.tokenString return t.tokenString
} }
func (t *instancePrincipalToken) Valid() bool { func (t *principalToken) Valid() bool {
return !t.jwtToken.expired() return !t.jwtToken.expired()
} }
@ -561,7 +561,7 @@ var (
ErrNoSuchClaim = errors.New("no such claim") ErrNoSuchClaim = errors.New("no such claim")
) )
func (t *instancePrincipalToken) GetClaim(key string) (interface{}, error) { func (t *principalToken) GetClaim(key string) (interface{}, error) {
if value, ok := t.jwtToken.payload[key]; ok { if value, ok := t.jwtToken.payload[key]; ok {
return value, nil return value, nil
} }

View File

@ -0,0 +1,67 @@
// Copyright (c) 2016, 2018, 2021, 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 auth
import (
"crypto/rsa"
"fmt"
"github.com/oracle/oci-go-sdk/v36/common"
)
type instancePrincipalDelegationTokenConfigurationProvider struct {
instancePrincipalKeyProvider instancePrincipalKeyProvider
delegationToken string
}
//InstancePrincipalDelegationTokenConfigurationProvider returns a configuration for obo token instance principals
func InstancePrincipalDelegationTokenConfigurationProvider(delegationToken *string) (common.ConfigurationProvider, error) {
if delegationToken == nil || len(*delegationToken) == 0 {
return nil, fmt.Errorf("failed to create a delagationTokenConfigurationProvider: token is a mondatory input paras")
}
return newInstancePrincipalDelegationTokenConfigurationProvider(delegationToken, nil)
}
func newInstancePrincipalDelegationTokenConfigurationProvider(delegationToken *string, modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher,
error)) (common.ConfigurationProvider, error) {
keyProvider, err := newInstancePrincipalKeyProvider(modifier)
if err != nil {
return nil, fmt.Errorf("failed to create a new key provider for instance principal: %s", err.Error())
}
return instancePrincipalDelegationTokenConfigurationProvider{*keyProvider, *delegationToken}, err
}
func (p instancePrincipalDelegationTokenConfigurationProvider) getInstancePrincipalDelegationTokenConfigurationProvider() (instancePrincipalDelegationTokenConfigurationProvider, error) {
return p, nil
}
func (p instancePrincipalDelegationTokenConfigurationProvider) PrivateRSAKey() (*rsa.PrivateKey, error) {
return p.instancePrincipalKeyProvider.PrivateRSAKey()
}
func (p instancePrincipalDelegationTokenConfigurationProvider) KeyID() (string, error) {
return p.instancePrincipalKeyProvider.KeyID()
}
func (p instancePrincipalDelegationTokenConfigurationProvider) TenancyOCID() (string, error) {
return p.instancePrincipalKeyProvider.TenancyOCID()
}
func (p instancePrincipalDelegationTokenConfigurationProvider) UserOCID() (string, error) {
return "", nil
}
func (p instancePrincipalDelegationTokenConfigurationProvider) KeyFingerprint() (string, error) {
return "", nil
}
func (p instancePrincipalDelegationTokenConfigurationProvider) Region() (string, error) {
region := p.instancePrincipalKeyProvider.RegionForFederationClient()
return string(region), nil
}
func (p instancePrincipalDelegationTokenConfigurationProvider) AuthType() (common.AuthConfig, error) {
token := p.delegationToken
return common.AuthConfig{common.InstancePrincipalDelegationToken, false, &token}, nil
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 auth package auth
@ -7,7 +7,7 @@ import (
"bytes" "bytes"
"crypto/rsa" "crypto/rsa"
"fmt" "fmt"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
"strings" "strings"
) )

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 auth package auth
@ -8,7 +8,7 @@ import (
"encoding/base64" "encoding/base64"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"strings" "strings"
"time" "time"
) )

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 auth package auth
@ -7,13 +7,13 @@ import (
"crypto/rsa" "crypto/rsa"
"errors" "errors"
"fmt" "fmt"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"os" "os"
"path" "path"
) )
const ( const (
//ResourcePrincipalVersion2_2 supported version for resource principals //ResourcePrincipalVersion2_2 is a supported version for resource principals
ResourcePrincipalVersion2_2 = "2.2" ResourcePrincipalVersion2_2 = "2.2"
//ResourcePrincipalVersionEnvVar environment var name for version //ResourcePrincipalVersionEnvVar environment var name for version
ResourcePrincipalVersionEnvVar = "OCI_RESOURCE_PRINCIPAL_VERSION" ResourcePrincipalVersionEnvVar = "OCI_RESOURCE_PRINCIPAL_VERSION"
@ -26,6 +26,13 @@ const (
//ResourcePrincipalRegionEnvVar environment variable holding a region //ResourcePrincipalRegionEnvVar environment variable holding a region
ResourcePrincipalRegionEnvVar = "OCI_RESOURCE_PRINCIPAL_REGION" ResourcePrincipalRegionEnvVar = "OCI_RESOURCE_PRINCIPAL_REGION"
//ResourcePrincipalVersion1_1 is a supported version for resource principals
ResourcePrincipalVersion1_1 = "1.1"
//ResourcePrincipalSessionTokenEndpoint endpoint for retrieving the Resource Principal Session Token
ResourcePrincipalSessionTokenEndpoint = "OCI_RESOURCE_PRINCIPAL_RPST_ENDPOINT"
//ResourcePrincipalTokenEndpoint endpoint for retrieving the Resource Principal Token
ResourcePrincipalTokenEndpoint = "OCI_RESOURCE_PRINCIPAL_RPT_ENDPOINT"
// TenancyOCIDClaimKey is the key used to look up the resource tenancy in an RPST // TenancyOCIDClaimKey is the key used to look up the resource tenancy in an RPST
TenancyOCIDClaimKey = "res_tenant" TenancyOCIDClaimKey = "res_tenant"
// CompartmentOCIDClaimKey is the key used to look up the resource compartment in an RPST // CompartmentOCIDClaimKey is the key used to look up the resource compartment in an RPST
@ -65,11 +72,45 @@ func ResourcePrincipalConfigurationProvider() (ConfigurationProviderWithClaimAcc
} }
return newResourcePrincipalKeyProvider22( return newResourcePrincipalKeyProvider22(
*rpst, *private, passphrase, *region) *rpst, *private, passphrase, *region)
case ResourcePrincipalVersion1_1:
return newResourcePrincipalKeyProvider11(DefaultRptPathProvider{})
default: default:
return nil, fmt.Errorf("can not create resource principal, environment variable: %s, must be valid", ResourcePrincipalVersionEnvVar) return nil, fmt.Errorf("can not create resource principal, environment variable: %s, must be valid", ResourcePrincipalVersionEnvVar)
} }
} }
// ResourcePrincipalConfigurationProviderWithPathProvider returns a resource principal configuration provider using path provider.
func ResourcePrincipalConfigurationProviderWithPathProvider(pathProvider PathProvider) (ConfigurationProviderWithClaimAccess, error) {
var version string
var ok bool
if version, ok = os.LookupEnv(ResourcePrincipalVersionEnvVar); !ok {
return nil, fmt.Errorf("can not create resource principal, environment variable: %s, not present", ResourcePrincipalVersionEnvVar)
} else if version != ResourcePrincipalVersion1_1 {
return nil, fmt.Errorf("can not create resource principal, environment variable: %s, must be %s", ResourcePrincipalVersionEnvVar, ResourcePrincipalVersion1_1)
}
return newResourcePrincipalKeyProvider11(pathProvider)
}
func newResourcePrincipalKeyProvider11(pathProvider PathProvider) (ConfigurationProviderWithClaimAccess, error) {
rptEndpoint := requireEnv(ResourcePrincipalTokenEndpoint)
if rptEndpoint == nil {
return nil, fmt.Errorf("can not create resource principal, environment variable: %s, not present", ResourcePrincipalTokenEndpoint)
}
rptPath, err := pathProvider.Path()
if err != nil {
return nil, fmt.Errorf("can not create resource principal, due to: %s ", err.Error())
}
resourceID, err := pathProvider.ResourceID()
if err != nil {
return nil, fmt.Errorf("can not create resource principal, due to: %s ", err.Error())
}
rp, err := resourcePrincipalConfigurationProviderV1(*rptEndpoint+*rptPath, *resourceID)
if err != nil {
return nil, fmt.Errorf("can not create resource principal, due to: %s ", err.Error())
}
return rp, nil
}
func requireEnv(key string) *string { func requireEnv(key string) *string {
if val, ok := os.LookupEnv(key); ok { if val, ok := os.LookupEnv(key); ok {
return &val return &val
@ -179,6 +220,10 @@ func (p *resourcePrincipalKeyProvider) UserOCID() (string, error) {
return "", nil return "", nil
} }
func (p *resourcePrincipalKeyProvider) AuthType() (common.AuthConfig, error) {
return common.AuthConfig{common.UnknownAuthenticationType, false, nil}, fmt.Errorf("unsupported, keep the interface")
}
// By contract for the the content of a resource principal to be considered path, it needs to be // By contract for the the content of a resource principal to be considered path, it needs to be
// an absolute path. // an absolute path.
func isPath(str string) bool { func isPath(str string) bool {

View File

@ -0,0 +1,138 @@
// Copyright (c) 2016, 2018, 2021, 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 auth
import (
"fmt"
"io/ioutil"
"net/http"
)
const (
imdsPathTemplate = "/20180711/resourcePrincipalToken/{id}"
instanceIDURL = `http://169.254.169.254/opc/v2/instance/id`
//ResourcePrincipalTokenPath path for retrieving the Resource Principal Token
ResourcePrincipalTokenPath = "OCI_RESOURCE_PRINCIPAL_RPT_PATH"
//ResourceID OCID for the resource for Resource Principal
ResourceID = "OCI_RESOURCE_PRINCIPAL_RPT_ID"
)
// PathProvider is an interface that returns path and resource ID
type PathProvider interface {
Path() (*string, error)
ResourceID() (*string, error)
}
// StringRptPathProvider is a simple path provider that takes a string and returns it
type StringRptPathProvider struct {
path string
resourceID string
}
// Path returns the resource principal token path
func (pp StringRptPathProvider) Path() (*string, error) {
return &pp.path, nil
}
// ResourceID returns the resource associated with the resource principal
func (pp StringRptPathProvider) ResourceID() (*string, error) {
return &pp.resourceID, nil
}
// ImdsRptPathProvider sets the path from a default value and the resource ID from instance metadata
type ImdsRptPathProvider struct{}
// Path returns the resource principal token path
func (pp ImdsRptPathProvider) Path() (*string, error) {
path := imdsPathTemplate
return &path, nil
}
// ResourceID returns the resource associated with the resource principal
func (pp ImdsRptPathProvider) ResourceID() (*string, error) {
instanceID, err := getInstanceIDFromMetadata()
return &instanceID, err
}
// EnvRptPathProvider sets the path and resource ID from environment variables
type EnvRptPathProvider struct{}
// Path returns the resource principal token path
func (pp EnvRptPathProvider) Path() (*string, error) {
path := requireEnv(ResourcePrincipalTokenPath)
if path == nil {
return nil, fmt.Errorf("missing %s env var", ResourcePrincipalTokenPath)
}
return path, nil
}
// ResourceID returns the resource associated with the resource principal
func (pp EnvRptPathProvider) ResourceID() (*string, error) {
rpID := requireEnv(ResourceID)
if rpID == nil {
return nil, fmt.Errorf("missing %s env var", ResourceID)
}
return rpID, nil
}
//DefaultRptPathProvider path provider makes sure the behavior happens with the correct fallback.
//
//For the path,
//Use the contents of the OCI_RESOURCE_PRINCIPAL_RPT_PATH environment variable, if set.
//Otherwise, use the current path: "/20180711/resourcePrincipalToken/{id}"
//
//For the resource id,
//Use the contents of the OCI_RESOURCE_PRINCIPAL_RPT_ID environment variable, if set.
//Otherwise, use IMDS to get the instance id
//
//This path provider is used when the caller doesn't provide a specific path provider to the resource principals signer
type DefaultRptPathProvider struct {
path string
resourceID string
}
// Path returns the resource principal token path
func (pp DefaultRptPathProvider) Path() (*string, error) {
path := requireEnv(ResourcePrincipalTokenPath)
if path == nil {
rpPath := imdsPathTemplate
return &rpPath, nil
}
return path, nil
}
// ResourceID returns the resource associated with the resource principal
func (pp DefaultRptPathProvider) ResourceID() (*string, error) {
rpID := requireEnv(ResourceID)
if rpID == nil {
instanceID, err := getInstanceIDFromMetadata()
if err != nil {
return nil, err
}
return &instanceID, nil
}
return rpID, nil
}
func getInstanceIDFromMetadata() (instanceID string, err error) {
client := &http.Client{}
req, err := http.NewRequest("GET", instanceIDURL, nil)
if err != nil {
return "", err
}
req.Header.Set("Authorization", "Bearer Oracle")
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
bodyBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
bodyString := string(bodyBytes)
return bodyString, nil
}

View File

@ -0,0 +1,373 @@
// Copyright (c) 2016, 2018, 2021, 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 auth
import (
"context"
"crypto/rsa"
"fmt"
"github.com/oracle/oci-go-sdk/v36/common"
"net/http"
"net/url"
"sync"
"time"
)
// resourcePrincipalFederationClient is the client used to to talk acquire resource principals
// No auth client, leaf or intermediate retrievers. We use certificates retrieved by instance principals to sign the operations of
// resource principals
type resourcePrincipalFederationClient struct {
tenancyID string
instanceID string
sessionKeySupplier sessionKeySupplier
mux sync.Mutex
securityToken securityToken
path string
//instancePrincipalKeyProvider the instance Principal Key container
instancePrincipalKeyProvider instancePrincipalKeyProvider
//ResourcePrincipalTargetServiceClient client that calls the target service to acquire a resource principal token
ResourcePrincipalTargetServiceClient common.BaseClient
//ResourcePrincipalSessionTokenClient. The client used to communicate with identity to exchange a resource principal for
// resource principal session token
ResourcePrincipalSessionTokenClient common.BaseClient
}
type resourcePrincipalTokenRequest struct {
InstanceID string `contributesTo:"path" name:"id"`
}
type resourcePrincipalTokenResponse struct {
Body struct {
ResourcePrincipalToken string `json:"resourcePrincipalToken"`
ServicePrincipalSessionToken string `json:"servicePrincipalSessionToken"`
} `presentIn:"body"`
}
type resourcePrincipalSessionTokenRequestBody struct {
ResourcePrincipalToken string `json:"resourcePrincipalToken,omitempty"`
ServicePrincipalSessionToken string `json:"servicePrincipalSessionToken,omitempty"`
SessionPublicKey string `json:"sessionPublicKey,omitempty"`
}
type resourcePrincipalSessionTokenRequest struct {
Body resourcePrincipalSessionTokenRequestBody `contributesTo:"body"`
}
//acquireResourcePrincipalToken acquires the resource principal from the target service
func (c *resourcePrincipalFederationClient) acquireResourcePrincipalToken() (tokenResponse resourcePrincipalTokenResponse, err error) {
rpServiceClient := c.ResourcePrincipalTargetServiceClient
//Set the signer of this client to be the instance principal provider
rpServiceClient.Signer = common.DefaultRequestSigner(&c.instancePrincipalKeyProvider)
//Create a request with the instanceId
request, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, c.path, resourcePrincipalTokenRequest{InstanceID: c.instanceID})
if err != nil {
return
}
//Call the target service
response, err := rpServiceClient.Call(context.Background(), &request)
if err != nil {
return
}
defer common.CloseBodyIfValid(response)
tokenResponse = resourcePrincipalTokenResponse{}
err = common.UnmarshalResponse(response, &tokenResponse)
return
}
//exchangeToken exchanges a resource principal token from the target service with a session token from identity
func (c *resourcePrincipalFederationClient) exchangeToken(publicKeyBase64 string, tokenResponse resourcePrincipalTokenResponse) (sessionToken string, err error) {
rpServiceClient := c.ResourcePrincipalSessionTokenClient
//Set the signer of this client to be the instance principal provider
rpServiceClient.Signer = common.DefaultRequestSigner(&c.instancePrincipalKeyProvider)
// Call identity service to get resource principal session token
sessionTokenReq := resourcePrincipalSessionTokenRequest{
resourcePrincipalSessionTokenRequestBody{
ServicePrincipalSessionToken: tokenResponse.Body.ServicePrincipalSessionToken,
ResourcePrincipalToken: tokenResponse.Body.ResourcePrincipalToken,
SessionPublicKey: publicKeyBase64,
},
}
sessionTokenHTTPReq, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost,
"", sessionTokenReq)
if err != nil {
return
}
sessionTokenHTTPRes, err := rpServiceClient.Call(context.Background(), &sessionTokenHTTPReq)
if err != nil {
return
}
defer common.CloseBodyIfValid(sessionTokenHTTPRes)
sessionTokenRes := x509FederationResponse{}
err = common.UnmarshalResponse(sessionTokenHTTPRes, &sessionTokenRes)
if err != nil {
return
}
sessionToken = sessionTokenRes.Token.Token
return
}
//getSecurityToken makes the appropiate calls to acquire a resource principal security token
func (c *resourcePrincipalFederationClient) getSecurityToken() (securityToken, error) {
var err error
ipFederationClient := c.instancePrincipalKeyProvider.FederationClient
common.Debugf("Refreshing instance principal token")
//Refresh instance principal token
if refreshable, ok := ipFederationClient.(*x509FederationClient); ok {
err = refreshable.renewSecurityTokenIfNotValid()
if err != nil {
return nil, err
}
}
//Acquire resource principal token from target service
common.Debugf("Acquiring resource principal token from target service")
tokenResponse, err := c.acquireResourcePrincipalToken()
if err != nil {
return nil, err
}
//Read the public key from the session supplier.
pem := c.sessionKeySupplier.PublicKeyPemRaw()
pemSanitized := sanitizeCertificateString(string(pem))
//Exchange resource principal token for session token from identity
common.Debugf("Exchanging resource principal token for resource principal session token")
sessionToken, err := c.exchangeToken(pemSanitized, tokenResponse)
if err != nil {
return nil, err
}
return newPrincipalToken(sessionToken) // should be a resource principal token
}
func (c *resourcePrincipalFederationClient) renewSecurityToken() (err error) {
if err = c.sessionKeySupplier.Refresh(); err != nil {
return fmt.Errorf("failed to refresh session key: %s", err.Error())
}
common.Logf("Renewing resource principal security token at: %v\n", time.Now().Format("15:04:05.000"))
if c.securityToken, err = c.getSecurityToken(); err != nil {
return fmt.Errorf("failed to get security token: %s", err.Error())
}
common.Logf("Resource principal security token renewed at: %v\n", time.Now().Format("15:04:05.000"))
return nil
}
//ResourcePrincipal Key provider in charge of resource principal acquiring tokens
type resourcePrincipalKeyProviderV1 struct {
ResourcePrincipalClient resourcePrincipalFederationClient
}
func (c *resourcePrincipalFederationClient) renewSecurityTokenIfNotValid() (err error) {
if c.securityToken == nil || !c.securityToken.Valid() {
if err = c.renewSecurityToken(); err != nil {
return fmt.Errorf("failed to renew resource prinicipal security token: %s", err.Error())
}
}
return nil
}
func (c *resourcePrincipalFederationClient) PrivateKey() (*rsa.PrivateKey, error) {
c.mux.Lock()
defer c.mux.Unlock()
if err := c.renewSecurityTokenIfNotValid(); err != nil {
return nil, err
}
return c.sessionKeySupplier.PrivateKey(), nil
}
func (c *resourcePrincipalFederationClient) SecurityToken() (token string, err error) {
c.mux.Lock()
defer c.mux.Unlock()
if err = c.renewSecurityTokenIfNotValid(); err != nil {
return "", err
}
return c.securityToken.String(), nil
}
func (p *resourcePrincipalConfigurationProvider) PrivateRSAKey() (privateKey *rsa.PrivateKey, err error) {
if privateKey, err = p.keyProvider.ResourcePrincipalClient.PrivateKey(); err != nil {
err = fmt.Errorf("failed to get resource principal private key: %s", err.Error())
return nil, err
}
return privateKey, nil
}
func (p *resourcePrincipalConfigurationProvider) KeyID() (string, error) {
var securityToken string
var err error
if securityToken, err = p.keyProvider.ResourcePrincipalClient.SecurityToken(); err != nil {
return "", fmt.Errorf("failed to get resource principal security token: %s", err.Error())
}
return fmt.Sprintf("ST$%s", securityToken), nil
}
func (p *resourcePrincipalConfigurationProvider) TenancyOCID() (string, error) {
return p.keyProvider.ResourcePrincipalClient.instancePrincipalKeyProvider.TenancyOCID()
}
// todo what is this
func (p *resourcePrincipalConfigurationProvider) GetClaim(key string) (interface{}, error) {
return nil, nil
}
//Resource Principals
type resourcePrincipalConfigurationProvider struct {
keyProvider resourcePrincipalKeyProviderV1
region *common.Region
}
func newResourcePrincipalKeyProvider(ipKeyProvider instancePrincipalKeyProvider, rpTokenTargetServiceClient, rpSessionTokenClient common.BaseClient, instanceID, path string) (keyProvider resourcePrincipalKeyProviderV1, err error) {
rpFedClient := resourcePrincipalFederationClient{}
rpFedClient.tenancyID = ipKeyProvider.TenancyID
rpFedClient.instanceID = instanceID
rpFedClient.sessionKeySupplier = newSessionKeySupplier()
rpFedClient.ResourcePrincipalTargetServiceClient = rpTokenTargetServiceClient
rpFedClient.ResourcePrincipalSessionTokenClient = rpSessionTokenClient
rpFedClient.instancePrincipalKeyProvider = ipKeyProvider
rpFedClient.path = path
keyProvider = resourcePrincipalKeyProviderV1{ResourcePrincipalClient: rpFedClient}
return
}
func (p *resourcePrincipalConfigurationProvider) AuthType() (common.AuthConfig, error) {
return common.AuthConfig{common.UnknownAuthenticationType, false, nil},
fmt.Errorf("unsupported, keep the interface")
}
func (p resourcePrincipalConfigurationProvider) UserOCID() (string, error) {
return "", nil
}
func (p resourcePrincipalConfigurationProvider) KeyFingerprint() (string, error) {
return "", nil
}
func (p resourcePrincipalConfigurationProvider) Region() (string, error) {
if p.region == nil {
region := p.keyProvider.ResourcePrincipalClient.instancePrincipalKeyProvider.RegionForFederationClient()
common.Debugf("Region in resource principal configuration provider is nil. Returning instance principal federation clients region: %s", region)
return string(region), nil
}
return string(*p.region), nil
}
// resourcePrincipalConfigurationProviderForInstanceWithClients returns a configuration for instance principals
// resourcePrincipalTargetServiceTokenClient and resourcePrincipalSessionTokenClient are clients that at last need to have
// their base path and host properly set for their respective services. Additionally the clients can be further customized
// to provide mocking or any other customization for the requests/responses
func resourcePrincipalConfigurationProviderForInstanceWithClients(instancePrincipalProvider common.ConfigurationProvider,
resourcePrincipalTargetServiceTokenClient, resourcePrincipalSessionTokenClient common.BaseClient, instanceID, path string) (*resourcePrincipalConfigurationProvider, error) {
var ok bool
var ip instancePrincipalConfigurationProvider
if ip, ok = instancePrincipalProvider.(instancePrincipalConfigurationProvider); !ok {
return nil, fmt.Errorf("instancePrincipalConfigurationProvider needs to be of type vald Instance Principal Configuration Provider")
}
keyProvider, err := newResourcePrincipalKeyProvider(ip.keyProvider, resourcePrincipalTargetServiceTokenClient, resourcePrincipalSessionTokenClient, instanceID, path)
if err != nil {
return nil, err
}
provider := &resourcePrincipalConfigurationProvider{
region: nil,
keyProvider: keyProvider,
}
return provider, nil
}
const identityResourcePrincipalSessionTokenPath = "/v1/resourcePrincipalSessionToken"
// resourcePrincipalConfigurationProviderForInstanceWithInterceptor creates a resource principal configuration provider with
// a interceptor used to customize the call going to the resource principal token request to the target service
// for a given instance ID
func resourcePrincipalConfigurationProviderForInstanceWithInterceptor(instancePrincipalProvider common.ConfigurationProvider, resourcePrincipalTokenEndpoint, instanceID string, interceptor common.RequestInterceptor) (provider *resourcePrincipalConfigurationProvider, err error) {
//Build the target service client
rpTargetServiceClient, err := common.NewClientWithConfig(instancePrincipalProvider)
if err != nil {
return
}
rpTokenURL, err := url.Parse(resourcePrincipalTokenEndpoint)
if err != nil {
return
}
rpTargetServiceClient.Host = rpTokenURL.Scheme + "://" + rpTokenURL.Host
rpTargetServiceClient.Interceptor = interceptor
var path string
if rpTokenURL.Path != "" {
path = rpTokenURL.Path
} else {
path = identityResourcePrincipalSessionTokenPath
}
//Build the identity client for token service
rpTokenSessionClient, err := common.NewClientWithConfig(instancePrincipalProvider)
if err != nil {
return
}
// Set RPST endpoint if passed in from env var, otherwise create it from region
resourcePrincipalSessionTokenEndpoint := requireEnv(ResourcePrincipalSessionTokenEndpoint)
if resourcePrincipalSessionTokenEndpoint != nil {
rpSessionTokenURL, err := url.Parse(*resourcePrincipalSessionTokenEndpoint)
if err != nil {
return nil, err
}
rpTokenSessionClient.Host = rpSessionTokenURL.Scheme + "://" + rpSessionTokenURL.Host
} else {
regionStr, err := instancePrincipalProvider.Region()
if err != nil {
return nil, fmt.Errorf("missing RPST env var and cannot determine region: %v", err)
}
region := common.StringToRegion(regionStr)
rpTokenSessionClient.Host = fmt.Sprintf("https://%s", region.Endpoint("auth"))
}
rpTokenSessionClient.BasePath = identityResourcePrincipalSessionTokenPath
return resourcePrincipalConfigurationProviderForInstanceWithClients(instancePrincipalProvider, rpTargetServiceClient, rpTokenSessionClient, instanceID, path)
}
// ResourcePrincipalConfigurationProviderWithInterceptor creates a resource principal configuration provider with endpoints
// a interceptor used to customize the call going to the resource principal token request to the target service
// see https://godoc.org/github.com/oracle/oci-go-sdk/common#RequestInterceptor
func ResourcePrincipalConfigurationProviderWithInterceptor(instancePrincipalProvider common.ConfigurationProvider,
resourcePrincipalTokenEndpoint, resourcePrincipalSessionTokenEndpoint string,
interceptor common.RequestInterceptor) (common.ConfigurationProvider, error) {
return resourcePrincipalConfigurationProviderForInstanceWithInterceptor(instancePrincipalProvider, resourcePrincipalTokenEndpoint, "", interceptor)
}
// resourcePrincipalConfigurationProviderV1 creates a resource principal configuration provider with
// endpoints for both resource principal token and resource principal token session
func resourcePrincipalConfigurationProviderV1(resourcePrincipalTokenEndpoint, resourceID string) (*resourcePrincipalConfigurationProvider, error) {
instancePrincipalProvider, err := InstancePrincipalConfigurationProvider()
if err != nil {
return nil, err
}
return resourcePrincipalConfigurationProviderForInstanceWithInterceptor(instancePrincipalProvider, resourcePrincipalTokenEndpoint, resourceID, nil)
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 auth package auth
@ -8,7 +8,7 @@ import (
"crypto/sha1" "crypto/sha1"
"crypto/x509" "crypto/x509"
"fmt" "fmt"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
"net/http/httputil" "net/http/httputil"
"strings" "strings"
@ -68,3 +68,27 @@ func colonSeparatedString(fingerprint [sha1.Size]byte) string {
spaceSeparated := fmt.Sprintf("% x", fingerprint) spaceSeparated := fmt.Sprintf("% x", fingerprint)
return strings.Replace(spaceSeparated, " ", ":", -1) return strings.Replace(spaceSeparated, " ", ":", -1)
} }
func sanitizeCertificateString(certString string) string {
certString = strings.Replace(certString, "-----BEGIN CERTIFICATE-----", "", -1)
certString = strings.Replace(certString, "-----END CERTIFICATE-----", "", -1)
certString = strings.Replace(certString, "-----BEGIN PUBLIC KEY-----", "", -1)
certString = strings.Replace(certString, "-----END PUBLIC KEY-----", "", -1)
certString = strings.Replace(certString, "\n", "", -1)
return certString
}
// GetGenericConfigurationProvider checks auth config paras in config file and return the final configuration provider
func GetGenericConfigurationProvider(configProvider common.ConfigurationProvider) (common.ConfigurationProvider, error) {
if authConfig, err := configProvider.AuthType(); err == nil && authConfig.IsFromConfigFile {
switch authConfig.AuthType {
case common.InstancePrincipalDelegationToken:
return InstancePrincipalDelegationTokenConfigurationProvider(authConfig.OboToken)
case common.InstancePrincipal:
return InstancePrincipalConfigurationProvider()
case common.UserPrincipal:
return configProvider, nil
}
}
return configProvider, nil
}

View File

@ -1,12 +1,15 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 provides supporting functions and structs used by service packages // Package common provides supporting functions and structs used by service packages
package common package common
import ( import (
"bytes"
"context" "context"
"fmt" "fmt"
"io"
"io/ioutil"
"math/rand" "math/rand"
"net/http" "net/http"
"net/http/httputil" "net/http/httputil"
@ -71,8 +74,9 @@ const (
defaultConfigFileName = "config" defaultConfigFileName = "config"
defaultConfigDirName = ".oci" defaultConfigDirName = ".oci"
configFilePathEnvVarName = "OCI_CONFIG_FILE" configFilePathEnvVarName = "OCI_CONFIG_FILE"
secondaryConfigDirName = ".oraclebmc"
maxBodyLenForDebug = 1024 * 1000 secondaryConfigDirName = ".oraclebmc"
maxBodyLenForDebug = 1024 * 1000
) )
// RequestInterceptor function used to customize the request before calling the underlying service // RequestInterceptor function used to customize the request before calling the underlying service
@ -84,6 +88,11 @@ type HTTPRequestDispatcher interface {
Do(req *http.Request) (*http.Response, error) Do(req *http.Request) (*http.Response, error)
} }
// CustomClientConfiguration contains configurations set at client level, currently it only includes RetryPolicy
type CustomClientConfiguration struct {
RetryPolicy *RetryPolicy
}
// BaseClient struct implements all basic operations to call oci web services. // BaseClient struct implements all basic operations to call oci web services.
type BaseClient struct { type BaseClient struct {
//HTTPClient performs the http network operations //HTTPClient performs the http network operations
@ -103,10 +112,36 @@ type BaseClient struct {
//Base path for all operations of this client //Base path for all operations of this client
BasePath string BasePath string
Configuration CustomClientConfiguration
}
// SetCustomClientConfiguration sets client with retry and other custom configurations
func (client *BaseClient) SetCustomClientConfiguration(config CustomClientConfiguration) {
client.Configuration = config
}
// RetryPolicy returns the retryPolicy configured for client
func (client *BaseClient) RetryPolicy() *RetryPolicy {
return client.Configuration.RetryPolicy
}
// Endpoint returns the enpoint configured for client
func (client *BaseClient) Endpoint() string {
host := client.Host
if !strings.Contains(host, "http") &&
!strings.Contains(host, "https") {
host = fmt.Sprintf("%s://%s", defaultScheme, host)
}
return host
} }
func defaultUserAgent() string { func defaultUserAgent() string {
userAgent := fmt.Sprintf(defaultUserAgentTemplate, defaultSDKMarker, Version(), runtime.GOOS, runtime.GOARCH, runtime.Version()) userAgent := fmt.Sprintf(defaultUserAgentTemplate, defaultSDKMarker, Version(), runtime.GOOS, runtime.GOARCH, runtime.Version())
appendUA := os.Getenv("OCI_SDK_APPEND_USER_AGENT")
if appendUA != "" {
userAgent = fmt.Sprintf("%s %s", userAgent, appendUA)
}
return userAgent return userAgent
} }
@ -158,6 +193,11 @@ func NewClientWithConfig(configProvider ConfigurationProvider) (client BaseClien
client = defaultBaseClient(configProvider) client = defaultBaseClient(configProvider)
if authConfig, e := configProvider.AuthType(); e == nil && authConfig.OboToken != nil {
Debugf("authConfig's authType is %s, and token content is %s", authConfig.AuthType, *authConfig.OboToken)
signOboToken(&client, *authConfig.OboToken, configProvider)
}
return return
} }
@ -168,6 +208,13 @@ func NewClientWithOboToken(configProvider ConfigurationProvider, oboToken string
return return
} }
signOboToken(&client, oboToken, configProvider)
return
}
// Add obo token header to Interceptor and sign to client
func signOboToken(client *BaseClient, oboToken string, configProvider ConfigurationProvider) {
// Interceptor to add obo token header // Interceptor to add obo token header
client.Interceptor = func(request *http.Request) error { client.Interceptor = func(request *http.Request) error {
request.Header.Add(requestHeaderOpcOboToken, oboToken) request.Header.Add(requestHeaderOpcOboToken, oboToken)
@ -176,8 +223,6 @@ func NewClientWithOboToken(configProvider ConfigurationProvider, oboToken string
// Obo token will also be signed // Obo token will also be signed
defaultHeaders := append(DefaultGenericHeaders(), requestHeaderOpcOboToken) defaultHeaders := append(DefaultGenericHeaders(), requestHeaderOpcOboToken)
client.Signer = RequestSigner(configProvider, defaultHeaders, DefaultBodyHeaders()) client.Signer = RequestSigner(configProvider, defaultHeaders, DefaultBodyHeaders())
return
} }
func getHomeFolder() string { func getHomeFolder() string {
@ -285,14 +330,72 @@ func (client BaseClient) intercept(request *http.Request) (err error) {
return return
} }
func checkForSuccessfulResponse(res *http.Response) error { // checkForSuccessfulResponse checks if the response is successful
// If Error Code is 4XX/5XX and debug level is set to info, will log the request and response
func checkForSuccessfulResponse(res *http.Response, requestBody *io.ReadCloser) error {
familyStatusCode := res.StatusCode / 100 familyStatusCode := res.StatusCode / 100
if familyStatusCode == 4 || familyStatusCode == 5 { if familyStatusCode == 4 || familyStatusCode == 5 {
IfInfo(func() {
// If debug level is set to verbose, the request and request body will be dumped and logged under debug level, this is to avoid duplicate logging
if defaultLogger.LogLevel() < verboseLogging {
logRequest(res.Request, Logf, noLogging)
if requestBody != nil && *requestBody != http.NoBody {
bodyContent, _ := ioutil.ReadAll(*requestBody)
Logf("Dump Request Body: \n%s", string(bodyContent))
}
}
logResponse(res, Logf, infoLogging)
})
return newServiceFailureFromResponse(res) return newServiceFailureFromResponse(res)
} }
IfDebug(func() {
logResponse(res, Debugf, verboseLogging)
})
return nil return nil
} }
func logRequest(request *http.Request, fn func(format string, v ...interface{}), bodyLoggingLevel int) {
if request == nil {
return
}
dumpBody := true
if checkBodyLengthExceedLimit(request.ContentLength) {
fn("not dumping body too big\n")
dumpBody = false
}
dumpBody = dumpBody && defaultLogger.LogLevel() >= bodyLoggingLevel && bodyLoggingLevel != noLogging
if dump, e := httputil.DumpRequestOut(request, dumpBody); e == nil {
fn("Dump Request %s", string(dump))
} else {
fn("%v\n", e)
}
}
func logResponse(response *http.Response, fn func(format string, v ...interface{}), bodyLoggingLevel int) {
if response == nil {
return
}
dumpBody := true
if checkBodyLengthExceedLimit(response.ContentLength) {
fn("not dumping body too big\n")
dumpBody = false
}
dumpBody = dumpBody && defaultLogger.LogLevel() >= bodyLoggingLevel && bodyLoggingLevel != noLogging
if dump, e := httputil.DumpResponse(response, dumpBody); e == nil {
fn("Dump Response %s", string(dump))
} else {
fn("%v\n", e)
}
}
func checkBodyLengthExceedLimit(contentLength int64) bool {
if contentLength > maxBodyLenForDebug {
return true
}
return false
}
// OCIRequest is any request made to an OCI service. // OCIRequest is any request made to an OCI service.
type OCIRequest interface { type OCIRequest interface {
// HTTPRequest assembles an HTTP request. // HTTPRequest assembles an HTTP request.
@ -329,7 +432,7 @@ func (client BaseClient) Call(ctx context.Context, request *http.Request) (respo
// CallWithDetails executes the http request, the given context using details specified in the paremeters, this function // CallWithDetails executes the http request, the given context using details specified in the paremeters, this function
// provides a way to override some settings present in the client // provides a way to override some settings present in the client
func (client BaseClient) CallWithDetails(ctx context.Context, request *http.Request, details ClientCallDetails) (response *http.Response, err error) { func (client BaseClient) CallWithDetails(ctx context.Context, request *http.Request, details ClientCallDetails) (response *http.Response, err error) {
Debugln("Atempting to call downstream service") Debugln("Attempting to call downstream service")
request = request.WithContext(ctx) request = request.WithContext(ctx)
err = client.prepareRequest(request) err = client.prepareRequest(request)
@ -349,48 +452,28 @@ func (client BaseClient) CallWithDetails(ctx context.Context, request *http.Requ
return return
} }
//Copy request body and save for logging
dumpRequestBody := ioutil.NopCloser(bytes.NewBuffer(nil))
if request.Body != nil && !checkBodyLengthExceedLimit(request.ContentLength) {
if dumpRequestBody, request.Body, err = drainBody(request.Body); err != nil {
dumpRequestBody = ioutil.NopCloser(bytes.NewBuffer(nil))
}
}
IfDebug(func() { IfDebug(func() {
dumpBody := true logRequest(request, Debugf, verboseLogging)
if request.ContentLength > maxBodyLenForDebug {
Debugf("not dumping body too big\n")
dumpBody = false
}
dumpBody = dumpBody && defaultLogger.LogLevel() == verboseLogging
if dump, e := httputil.DumpRequestOut(request, dumpBody); e == nil {
Debugf("Dump Request %s", string(dump))
} else {
Debugf("%v\n", e)
}
}) })
//Execute the http request //Execute the http request
response, err = client.HTTPClient.Do(request) response, err = client.HTTPClient.Do(request)
IfDebug(func() {
if err != nil {
Debugf("%v\n", err)
return
}
dumpBody := true
if response.ContentLength > maxBodyLenForDebug {
Debugf("not dumping body too big\n")
dumpBody = false
}
dumpBody = dumpBody && defaultLogger.LogLevel() == verboseLogging
if dump, e := httputil.DumpResponse(response, dumpBody); e == nil {
Debugf("Dump Response %s", string(dump))
} else {
Debugf("%v\n", e)
}
})
if err != nil { if err != nil {
IfInfo(func() {
Logf("%v\n", err)
})
return return
} }
err = checkForSuccessfulResponse(response) err = checkForSuccessfulResponse(response, &dumpRequestBody)
return return
} }

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 package common
@ -33,10 +33,15 @@ const (
RegionIAD Region = "us-ashburn-1" RegionIAD Region = "us-ashburn-1"
//RegionSJC1 region SJC //RegionSJC1 region SJC
RegionSJC1 Region = "us-sanjose-1" RegionSJC1 Region = "us-sanjose-1"
//RegionFRA region FRA //RegionFRA region FRA
RegionFRA Region = "eu-frankfurt-1" RegionFRA Region = "eu-frankfurt-1"
//RegionUKCardiff1 region for Cardiff
RegionUKCardiff1 Region = "uk-cardiff-1"
//RegionLHR region LHR //RegionLHR region LHR
RegionLHR Region = "uk-london-1" RegionLHR Region = "uk-london-1"
//RegionAPTokyo1 region for Tokyo //RegionAPTokyo1 region for Tokyo
RegionAPTokyo1 Region = "ap-tokyo-1" RegionAPTokyo1 Region = "ap-tokyo-1"
//RegionAPOsaka1 region for Osaka //RegionAPOsaka1 region for Osaka
@ -55,14 +60,21 @@ const (
RegionAPMelbourne1 Region = "ap-melbourne-1" RegionAPMelbourne1 Region = "ap-melbourne-1"
//RegionAPSydney1 region for Sydney //RegionAPSydney1 region for Sydney
RegionAPSydney1 Region = "ap-sydney-1" RegionAPSydney1 Region = "ap-sydney-1"
//RegionMEJeddah1 region for Jeddah //RegionMEJeddah1 region for Jeddah
RegionMEJeddah1 Region = "me-jeddah-1" RegionMEJeddah1 Region = "me-jeddah-1"
//RegionMEDubai1 region for Dubai
RegionMEDubai1 Region = "me-dubai-1"
//RegionEUZurich1 region for Zurich //RegionEUZurich1 region for Zurich
RegionEUZurich1 Region = "eu-zurich-1" RegionEUZurich1 Region = "eu-zurich-1"
//RegionEUAmsterdam1 region for Amsterdam //RegionEUAmsterdam1 region for Amsterdam
RegionEUAmsterdam1 Region = "eu-amsterdam-1" RegionEUAmsterdam1 Region = "eu-amsterdam-1"
//RegionSASaopaulo1 region for Sao Paulo //RegionSASaopaulo1 region for Sao Paulo
RegionSASaopaulo1 Region = "sa-saopaulo-1" RegionSASaopaulo1 Region = "sa-saopaulo-1"
//RegionSASantiago1 region for santiago
RegionSASantiago1 Region = "sa-santiago-1"
//RegionUSLangley1 region for Langley //RegionUSLangley1 region for Langley
RegionUSLangley1 Region = "us-langley-1" RegionUSLangley1 Region = "us-langley-1"
@ -100,6 +112,7 @@ var shortNameRegion = map[string]Region{
"iad": RegionIAD, "iad": RegionIAD,
"fra": RegionFRA, "fra": RegionFRA,
"lhr": RegionLHR, "lhr": RegionLHR,
"cwl": RegionUKCardiff1,
"ams": RegionEUAmsterdam1, "ams": RegionEUAmsterdam1,
"zrh": RegionEUZurich1, "zrh": RegionEUZurich1,
"mel": RegionAPMelbourne1, "mel": RegionAPMelbourne1,
@ -110,12 +123,14 @@ var shortNameRegion = map[string]Region{
"nrt": RegionAPTokyo1, "nrt": RegionAPTokyo1,
"kix": RegionAPOsaka1, "kix": RegionAPOsaka1,
"nja": RegionAPChiyoda1, "nja": RegionAPChiyoda1,
"jed": RegionMEJeddah1,
"dxb": RegionMEDubai1,
"syd": RegionAPSydney1, "syd": RegionAPSydney1,
"yul": RegionCAMontreal1, "yul": RegionCAMontreal1,
"yyz": RegionCAToronto1, "yyz": RegionCAToronto1,
"sjc": RegionSJC1, "sjc": RegionSJC1,
"gru": RegionSASaopaulo1, "gru": RegionSASaopaulo1,
"jed": RegionMEJeddah1, "scl": RegionSASantiago1,
"ltn": RegionUKGovLondon1, "ltn": RegionUKGovLondon1,
"brs": RegionUKGovCardiff1, "brs": RegionUKGovCardiff1,
} }
@ -129,13 +144,17 @@ var realm = map[string]string{
} }
var regionRealm = map[Region]string{ var regionRealm = map[Region]string{
RegionPHX: "oc1", RegionPHX: "oc1",
RegionIAD: "oc1", RegionIAD: "oc1",
RegionFRA: "oc1", RegionFRA: "oc1",
RegionLHR: "oc1", RegionLHR: "oc1",
RegionCAToronto1: "oc1", RegionSJC1: "oc1",
RegionCAMontreal1: "oc1",
RegionSJC1: "oc1", RegionUKCardiff1: "oc1",
RegionCAToronto1: "oc1",
RegionCAMontreal1: "oc1",
RegionAPTokyo1: "oc1", RegionAPTokyo1: "oc1",
RegionAPOsaka1: "oc1", RegionAPOsaka1: "oc1",
RegionAPSeoul1: "oc1", RegionAPSeoul1: "oc1",
@ -144,13 +163,19 @@ var regionRealm = map[Region]string{
RegionAPMumbai1: "oc1", RegionAPMumbai1: "oc1",
RegionAPHyderabad1: "oc1", RegionAPHyderabad1: "oc1",
RegionAPMelbourne1: "oc1", RegionAPMelbourne1: "oc1",
RegionMEJeddah1: "oc1",
RegionMEJeddah1: "oc1",
RegionMEDubai1: "oc1",
RegionEUZurich1: "oc1", RegionEUZurich1: "oc1",
RegionEUAmsterdam1: "oc1", RegionEUAmsterdam1: "oc1",
RegionSASaopaulo1: "oc1",
RegionUSLangley1: "oc2", RegionSASaopaulo1: "oc1",
RegionUSLuke1: "oc2", RegionSASantiago1: "oc1",
RegionUSLangley1: "oc2",
RegionUSLuke1: "oc2",
RegionUSGovAshburn1: "oc3", RegionUSGovAshburn1: "oc3",
RegionUSGovChicago1: "oc3", RegionUSGovChicago1: "oc3",
RegionUSGovPhoenix1: "oc3", RegionUSGovPhoenix1: "oc3",

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 package common
@ -14,6 +14,28 @@ import (
"strings" "strings"
) )
// AuthenticationType for auth
type AuthenticationType string
const (
// UserPrincipal is default auth type
UserPrincipal AuthenticationType = "user_principal"
// InstancePrincipal is used for instance principle auth type
InstancePrincipal AuthenticationType = "instance_principal"
// InstancePrincipalDelegationToken is used for instance principle delegation token auth type
InstancePrincipalDelegationToken AuthenticationType = "instance_principle_delegation_token"
// UnknownAuthenticationType is used for none meaningful auth type
UnknownAuthenticationType AuthenticationType = "unknown_auth_type"
)
// AuthConfig is used for getting auth related paras in config file
type AuthConfig struct {
AuthType AuthenticationType
// IsFromConfigFile is used to point out if the authConfig is from configuration file
IsFromConfigFile bool
OboToken *string
}
// ConfigurationProvider wraps information about the account owner // ConfigurationProvider wraps information about the account owner
type ConfigurationProvider interface { type ConfigurationProvider interface {
KeyProvider KeyProvider
@ -21,9 +43,12 @@ type ConfigurationProvider interface {
UserOCID() (string, error) UserOCID() (string, error)
KeyFingerprint() (string, error) KeyFingerprint() (string, error)
Region() (string, error) Region() (string, error)
// AuthType() is used for specify the needed auth type, like UserPrincipal, InstancePrincipal, etc.
AuthType() (AuthConfig, error)
} }
// IsConfigurationProviderValid Tests all parts of the configuration provider do not return an error // IsConfigurationProviderValid Tests all parts of the configuration provider do not return an error, this method will
// not check AuthType(), since authType() is not required to be there.
func IsConfigurationProviderValid(conf ConfigurationProvider) (ok bool, err error) { func IsConfigurationProviderValid(conf ConfigurationProvider) (ok bool, err error) {
baseFn := []func() (string, error){conf.TenancyOCID, conf.UserOCID, conf.KeyFingerprint, conf.Region, conf.KeyID} baseFn := []func() (string, error){conf.TenancyOCID, conf.UserOCID, conf.KeyFingerprint, conf.Region, conf.KeyID}
for _, fn := range baseFn { for _, fn := range baseFn {
@ -105,6 +130,10 @@ func (p rawConfigurationProvider) Region() (string, error) {
return canStringBeRegion(p.region) return canStringBeRegion(p.region)
} }
func (p rawConfigurationProvider) AuthType() (AuthConfig, error) {
return AuthConfig{UnknownAuthenticationType, false, nil}, nil
}
// environmentConfigurationProvider reads configuration from environment variables // environmentConfigurationProvider reads configuration from environment variables
type environmentConfigurationProvider struct { type environmentConfigurationProvider struct {
PrivateKeyPassword string PrivateKeyPassword string
@ -199,6 +228,11 @@ func (p environmentConfigurationProvider) Region() (value string, err error) {
return canStringBeRegion(value) return canStringBeRegion(value)
} }
func (p environmentConfigurationProvider) AuthType() (AuthConfig, error) {
return AuthConfig{UnknownAuthenticationType, false, nil},
fmt.Errorf("unsupported, keep the interface")
}
// fileConfigurationProvider. reads configuration information from a file // fileConfigurationProvider. reads configuration information from a file
type fileConfigurationProvider struct { type fileConfigurationProvider struct {
//The path to the configuration file //The path to the configuration file
@ -241,8 +275,9 @@ func ConfigurationProviderFromFileWithProfile(configFilePath, profile, privateKe
} }
type configFileInfo struct { type configFileInfo struct {
UserOcid, Fingerprint, KeyFilePath, TenancyOcid, Region, Passphrase, SecurityTokenFilePath string UserOcid, Fingerprint, KeyFilePath, TenancyOcid, Region, Passphrase, SecurityTokenFilePath, DelegationTokenFilePath,
PresentConfiguration byte AuthenticationType string
PresentConfiguration rune
} }
const ( const (
@ -253,6 +288,8 @@ const (
hasKeyFile hasKeyFile
hasPassphrase hasPassphrase
hasSecurityTokenFile hasSecurityTokenFile
hasDelegationTokenFile
hasAuthenticationType
none none
) )
@ -279,7 +316,7 @@ func parseConfigFile(data []byte, profile string) (info *configFileInfo, err err
} }
func parseConfigAtLine(start int, content []string) (info *configFileInfo, err error) { func parseConfigAtLine(start int, content []string) (info *configFileInfo, err error) {
var configurationPresent byte var configurationPresent rune
info = &configFileInfo{} info = &configFileInfo{}
for i := start; i < len(content); i++ { for i := start; i < len(content); i++ {
line := content[i] line := content[i]
@ -314,6 +351,12 @@ func parseConfigAtLine(start int, content []string) (info *configFileInfo, err e
case "security_token_file": case "security_token_file":
configurationPresent = configurationPresent | hasSecurityTokenFile configurationPresent = configurationPresent | hasSecurityTokenFile
info.SecurityTokenFilePath = value info.SecurityTokenFilePath = value
case "delegation_token_file":
configurationPresent = configurationPresent | hasDelegationTokenFile
info.DelegationTokenFilePath = value
case "authentication_type":
configurationPresent = configurationPresent | hasAuthenticationType
info.AuthenticationType = value
} }
} }
info.PresentConfiguration = configurationPresent info.PresentConfiguration = configurationPresent
@ -366,7 +409,7 @@ func (p fileConfigurationProvider) readAndParseConfigFile() (info *configFileInf
return p.FileInfo, err return p.FileInfo, err
} }
func presentOrError(value string, expectedConf, presentConf byte, confMissing string) (string, error) { func presentOrError(value string, expectedConf, presentConf rune, confMissing string) (string, error) {
if presentConf&expectedConf == expectedConf { if presentConf&expectedConf == expectedConf {
return value, nil return value, nil
} }
@ -421,7 +464,11 @@ func (p fileConfigurationProvider) KeyID() (keyID string, err error) {
return fmt.Sprintf("%s/%s/%s", info.TenancyOcid, info.UserOcid, info.Fingerprint), nil return fmt.Sprintf("%s/%s/%s", info.TenancyOcid, info.UserOcid, info.Fingerprint), nil
} }
if filePath, err := presentOrError(info.SecurityTokenFilePath, hasSecurityTokenFile, info.PresentConfiguration, "securityTokenFilePath"); err == nil { if filePath, err := presentOrError(info.SecurityTokenFilePath, hasSecurityTokenFile, info.PresentConfiguration, "securityTokenFilePath"); err == nil {
return getSecurityToken(filePath) rawString, err := getTokenContent(filePath)
if err != nil {
return "", err
}
return "ST$" + rawString, nil
} }
err = fmt.Errorf("can not read SecurityTokenFilePath from configuration file due to: %s", err.Error()) err = fmt.Errorf("can not read SecurityTokenFilePath from configuration file due to: %s", err.Error())
return return
@ -476,14 +523,39 @@ func (p fileConfigurationProvider) Region() (value string, err error) {
return canStringBeRegion(value) return canStringBeRegion(value)
} }
func getSecurityToken(filePath string) (string, error) { func (p fileConfigurationProvider) AuthType() (AuthConfig, error) {
info, err := p.readAndParseConfigFile()
if err != nil {
err = fmt.Errorf("can not read tenancy configuration due to: %s", err.Error())
return AuthConfig{UnknownAuthenticationType, true, nil}, err
}
val, err := presentOrError(info.AuthenticationType, hasAuthenticationType, info.PresentConfiguration, "authentication_type")
if val == "instance_principal" {
if filePath, err := presentOrError(info.DelegationTokenFilePath, hasDelegationTokenFile, info.PresentConfiguration, "delegationTokenFilePath"); err == nil {
if delegationToken, err := getTokenContent(filePath); err == nil && delegationToken != "" {
Debugf("delegation token content is %s, and error is %s ", delegationToken, err)
return AuthConfig{InstancePrincipalDelegationToken, true, &delegationToken}, nil
}
return AuthConfig{UnknownAuthenticationType, true, nil}, err
}
// normal instance principle
return AuthConfig{InstancePrincipal, true, nil}, nil
}
// by default, if no "authentication_type" is provided, just treated as user principle type, and will not return error
return AuthConfig{UserPrincipal, true, nil}, nil
}
func getTokenContent(filePath string) (string, error) {
expandedPath := expandPath(filePath) expandedPath := expandPath(filePath)
tokenFileContent, err := ioutil.ReadFile(expandedPath) tokenFileContent, err := ioutil.ReadFile(expandedPath)
if err != nil { if err != nil {
err = fmt.Errorf("can not read PrivateKey from configuration file due to: %s", err.Error()) err = fmt.Errorf("can not read token content from configuration file due to: %s", err.Error())
return "", err return "", err
} }
return fmt.Sprintf("ST$%s", tokenFileContent), nil return fmt.Sprintf("%s", tokenFileContent), nil
} }
// A configuration provider that look for information in multiple configuration providers // A configuration provider that look for information in multiple configuration providers
@ -569,6 +641,15 @@ func (c composingConfigurationProvider) PrivateRSAKey() (*rsa.PrivateKey, error)
return nil, fmt.Errorf("did not find a proper configuration for private key") return nil, fmt.Errorf("did not find a proper configuration for private key")
} }
func (c composingConfigurationProvider) AuthType() (AuthConfig, error) {
// only check the first default fileConfigProvider
authConfig, err := c.Providers[0].AuthType()
if err == nil && authConfig.AuthType != UnknownAuthenticationType {
return authConfig, nil
}
return AuthConfig{UnknownAuthenticationType, false, nil}, fmt.Errorf("did not find a proper configuration for auth type")
}
func getRegionFromEnvVar() (string, error) { func getRegionFromEnvVar() (string, error) {
regionEnvVar := "OCI_REGION" regionEnvVar := "OCI_REGION"
if region, existed := os.LookupEnv(regionEnvVar); existed { if region, existed := os.LookupEnv(regionEnvVar); existed {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 package common

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 package common
@ -9,6 +9,7 @@ import (
"crypto/x509" "crypto/x509"
"encoding/pem" "encoding/pem"
"fmt" "fmt"
"net/textproto"
"reflect" "reflect"
"strconv" "strconv"
"strings" "strings"
@ -255,6 +256,16 @@ func parsePKCSPrivateKey(decryptedKey []byte) (*rsa.PrivateKey, error) {
return nil, fmt.Errorf("failed to parse private key") return nil, fmt.Errorf("failed to parse private key")
} }
// parseContentLength trims whitespace from cl and returns -1 if can't purse uint, or the value if it's no less than 0
func parseContentLength(cl string) int64 {
cl = textproto.TrimString(cl)
n, err := strconv.ParseUint(cl, 10, 63)
if err != nil {
return -1
}
return int64(n)
}
func generateRandUUID() (string, error) { func generateRandUUID() (string, error) {
b := make([]byte, 16) b := make([]byte, 16)
_, err := rand.Read(b) _, err := rand.Read(b)

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 package common
@ -11,6 +11,7 @@ import (
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"os"
"reflect" "reflect"
"regexp" "regexp"
"strconv" "strconv"
@ -249,7 +250,7 @@ func removeNilFieldsInJSONWithTaggedStruct(rawJSON []byte, value reflect.Value)
return json.Marshal(fixedMap) return json.Marshal(fixedMap)
} }
func addToBody(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { func addToBody(request *http.Request, value reflect.Value, field reflect.StructField, binaryBodySpecified *bool) (e error) {
Debugln("Marshaling to body from field:", field.Name) Debugln("Marshaling to body from field:", field.Name)
if request.Body != nil { if request.Body != nil {
Logf("The body of the request is already set. Structure: %s will overwrite it\n", field.Name) Logf("The body of the request is already set. Structure: %s will overwrite it\n", field.Name)
@ -258,6 +259,7 @@ func addToBody(request *http.Request, value reflect.Value, field reflect.StructF
encoding := tag.Get("encoding") encoding := tag.Get("encoding")
if encoding == "binary" { if encoding == "binary" {
*binaryBodySpecified = true
return addBinaryBody(request, value, field) return addBinaryBody(request, value, field)
} }
@ -279,12 +281,52 @@ func addToBody(request *http.Request, value reflect.Value, field reflect.StructF
request.Header.Set(requestHeaderContentLength, strconv.FormatInt(request.ContentLength, 10)) request.Header.Set(requestHeaderContentLength, strconv.FormatInt(request.ContentLength, 10))
request.Header.Set(requestHeaderContentType, "application/json") request.Header.Set(requestHeaderContentType, "application/json")
request.Body = ioutil.NopCloser(bodyBytes) request.Body = ioutil.NopCloser(bodyBytes)
snapshot := *bodyBytes
request.GetBody = func() (io.ReadCloser, error) { request.GetBody = func() (io.ReadCloser, error) {
return ioutil.NopCloser(bodyBytes), nil r := snapshot
return ioutil.NopCloser(&r), nil
} }
return return
} }
func checkBinaryBodyLength(request *http.Request) (contentLen int64, err error) {
if reflect.TypeOf(request.Body) == reflect.TypeOf(ioutil.NopCloser(nil)) {
ioReader := reflect.ValueOf(request.Body).Field(0).Interface().(io.Reader)
switch t := ioReader.(type) {
case *bytes.Reader:
return int64(t.Len()), nil
case *bytes.Buffer:
return int64(t.Len()), nil
case *strings.Reader:
return int64(t.Len()), nil
default:
return getNormalBinaryBodyLength(request)
}
}
if reflect.TypeOf(request.Body) == reflect.TypeOf((*os.File)(nil)) {
fi, err := (request.Body.(*os.File)).Stat()
if err != nil {
return contentLen, err
}
return fi.Size(), nil
}
return getNormalBinaryBodyLength(request)
}
func getNormalBinaryBodyLength(request *http.Request) (contentLen int64, err error) {
dumpRequestBody := ioutil.NopCloser(bytes.NewBuffer(nil))
if dumpRequestBody, request.Body, err = drainBody(request.Body); err != nil {
dumpRequestBody = ioutil.NopCloser(bytes.NewBuffer(nil))
return contentLen, err
}
contentBody, err := ioutil.ReadAll(dumpRequestBody)
if err != nil {
return contentLen, err
}
return int64(len(contentBody)), nil
}
func addToQuery(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { func addToQuery(request *http.Request, value reflect.Value, field reflect.StructField) (e error) {
Debugln("Marshaling to query from field: ", field.Name) Debugln("Marshaling to query from field: ", field.Name)
if request.URL == nil { if request.URL == nil {
@ -401,7 +443,7 @@ func addToPath(request *http.Request, value reflect.Value, field reflect.StructF
return return
} }
func setWellKnownHeaders(request *http.Request, headerName, headerValue string) (e error) { func setWellKnownHeaders(request *http.Request, headerName, headerValue string, contentLenSpecified *bool) (e error) {
switch strings.ToLower(headerName) { switch strings.ToLower(headerName) {
case "content-length": case "content-length":
var len int var len int
@ -410,11 +452,12 @@ func setWellKnownHeaders(request *http.Request, headerName, headerValue string)
return return
} }
request.ContentLength = int64(len) request.ContentLength = int64(len)
*contentLenSpecified = true
} }
return nil return nil
} }
func addToHeader(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { func addToHeader(request *http.Request, value reflect.Value, field reflect.StructField, contentLenSpecified *bool) (e error) {
Debugln("Marshaling to header from field: ", field.Name) Debugln("Marshaling to header from field: ", field.Name)
if request.Header == nil { if request.Header == nil {
request.Header = http.Header{} request.Header = http.Header{}
@ -445,7 +488,7 @@ func addToHeader(request *http.Request, value reflect.Value, field reflect.Struc
return return
} }
if e = setWellKnownHeaders(request, headerName, headerValue); e != nil { if e = setWellKnownHeaders(request, headerName, headerValue, contentLenSpecified); e != nil {
return return
} }
@ -459,7 +502,7 @@ func addToHeader(request *http.Request, value reflect.Value, field reflect.Struc
// Check if the header is required to be unique // Check if the header is required to be unique
func isUniqueHeaderRequired(headerName string) bool { func isUniqueHeaderRequired(headerName string) bool {
return strings.EqualFold(headerName, requestHeaderContentType) return strings.EqualFold(headerName, requestHeaderContentType) || strings.EqualFold(headerName, requestHeaderContentLength)
} }
// Header collection is a map of string to string that gets rendered as individual headers with a given prefix // Header collection is a map of string to string that gets rendered as individual headers with a given prefix
@ -526,6 +569,8 @@ func checkForValidRequestStruct(s interface{}) (*reflect.Value, error) {
// nested structs are followed recursively depth-first. // nested structs are followed recursively depth-first.
func structToRequestPart(request *http.Request, val reflect.Value) (err error) { func structToRequestPart(request *http.Request, val reflect.Value) (err error) {
typ := val.Type() typ := val.Type()
contentLenSpecified := false
binaryBodySpecified := false
for i := 0; i < typ.NumField(); i++ { for i := 0; i < typ.NumField(); i++ {
if err != nil { if err != nil {
return return
@ -541,7 +586,7 @@ func structToRequestPart(request *http.Request, val reflect.Value) (err error) {
tag := sf.Tag.Get("contributesTo") tag := sf.Tag.Get("contributesTo")
switch tag { switch tag {
case "header": case "header":
err = addToHeader(request, sv, sf) err = addToHeader(request, sv, sf, &contentLenSpecified)
case "header-collection": case "header-collection":
err = addToHeaderCollection(request, sv, sf) err = addToHeaderCollection(request, sv, sf)
case "path": case "path":
@ -549,7 +594,7 @@ func structToRequestPart(request *http.Request, val reflect.Value) (err error) {
case "query": case "query":
err = addToQuery(request, sv, sf) err = addToQuery(request, sv, sf)
case "body": case "body":
err = addToBody(request, sv, sf) err = addToBody(request, sv, sf, &binaryBodySpecified)
case "": case "":
Debugln(sf.Name, " does not contain contributes tag. Skipping.") Debugln(sf.Name, " does not contain contributes tag. Skipping.")
default: default:
@ -557,6 +602,20 @@ func structToRequestPart(request *http.Request, val reflect.Value) (err error) {
} }
} }
// if content-length is not specified but with binary body, calculate the content length according to request body
if !contentLenSpecified && binaryBodySpecified && request.Body != nil && request.Body != http.NoBody {
contentLen, err := checkBinaryBodyLength(request)
if err == nil {
request.Header.Set(requestHeaderContentLength, strconv.FormatInt(contentLen, 10))
request.ContentLength = contentLen
}
}
//If content length is zero, to avoid sending transfer-coding: chunked header, need to explicitly set the body to nil/Nobody.
if request.Header != nil && request.Body != nil && request.Body != http.NoBody &&
parseContentLength(request.Header.Get(requestHeaderContentLength)) == 0 {
request.Body = http.NoBody
}
//If headers are and the content type was not set, we default to application/json //If headers are and the content type was not set, we default to application/json
if request.Header != nil && request.Header.Get(requestHeaderContentType) == "" { if request.Header != nil && request.Header.Get(requestHeaderContentType) == "" {
request.Header.Set(requestHeaderContentType, "application/json") request.Header.Set(requestHeaderContentType, "application/json")
@ -750,7 +809,7 @@ func analyzeValue(stringValue string, kind reflect.Kind, field reflect.StructFie
return return
} }
// Sets the field of a struct, with the appropiate value of the string // Sets the field of a struct, with the appropriate value of the string
// Only sets basic types // Only sets basic types
func fromStringValue(newValue string, val *reflect.Value, field reflect.StructField) (err error) { func fromStringValue(newValue string, val *reflect.Value, field reflect.StructField) (err error) {
@ -767,11 +826,12 @@ func fromStringValue(newValue string, val *reflect.Value, field reflect.StructFi
} }
value, valPtr, err := analyzeValue(newValue, kind, field) value, valPtr, err := analyzeValue(newValue, kind, field)
valueType := val.Type()
if err != nil { if err != nil {
return return
} }
if !isPointer { if !isPointer {
val.Set(value) val.Set(value.Convert(valueType))
} else { } else {
val.Set(valPtr) val.Set(valPtr)
} }

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 package common

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 package common
@ -80,7 +80,7 @@ func newSDKLogger() (defaultSDKLogger, error) {
configured, isLogEnabled := os.LookupEnv("OCI_GO_SDK_DEBUG") configured, isLogEnabled := os.LookupEnv("OCI_GO_SDK_DEBUG")
// If env variable not present turn logging of // If env variable not present turn logging off
if !isLogEnabled { if !isLogEnabled {
logger.currentLoggingLevel = noLogging logger.currentLoggingLevel = noLogging
} else { } else {
@ -132,7 +132,7 @@ func (l defaultSDKLogger) getLoggerForLevel(logLevel int) *log.Logger {
// Output mode is switched based on environment variable "OCI_GO_SDK_LOG_OUPUT_MODE" // Output mode is switched based on environment variable "OCI_GO_SDK_LOG_OUPUT_MODE"
// "file" outputs log to a specific file // "file" outputs log to a specific file
// "combine" outputs log to both stderr and specific file // "combine" outputs log to both stderr and specific file
// other unsupported value ouputs log to stderr // other unsupported value outputs log to stderr
// output file can be set via environment variable "OCI_GO_SDK_LOG_FILE" // output file can be set via environment variable "OCI_GO_SDK_LOG_FILE"
// if this environment variable is not set, a default log file will be created under project root path // if this environment variable is not set, a default log file will be created under project root path
func logOutputModeConfig(logger defaultSDKLogger) { func logOutputModeConfig(logger defaultSDKLogger) {
@ -221,3 +221,10 @@ func IfDebug(fn func()) {
fn() fn()
} }
} }
// IfInfo executes closure if info is enabled
func IfInfo(fn func()) {
if defaultLogger.LogLevel() >= infoLogging {
fn()
}
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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 package common

View File

@ -11,8 +11,8 @@ import (
) )
const ( const (
major = "24" major = "36"
minor = "3" minor = "2"
patch = "0" patch = "0"
tag = "" tag = ""
) )

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,11 +14,13 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AddImageShapeCompatibilityEntryDetails Image shape compatibility details. // AddImageShapeCompatibilityEntryDetails Image shape compatibility details.
type AddImageShapeCompatibilityEntryDetails struct { type AddImageShapeCompatibilityEntryDetails struct {
MemoryConstraints *ImageMemoryConstraints `mandatory:"false" json:"memoryConstraints"`
OcpuConstraints *ImageOcpuConstraints `mandatory:"false" json:"ocpuConstraints"` OcpuConstraints *ImageOcpuConstraints `mandatory:"false" json:"ocpuConstraints"`
} }

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// AddImageShapeCompatibilityEntryRequest wrapper for the AddImageShapeCompatibilityEntry operation // AddImageShapeCompatibilityEntryRequest wrapper for the AddImageShapeCompatibilityEntry operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AddImageShapeCompatibilityEntry.go.html to see an example of how to use AddImageShapeCompatibilityEntryRequest.
type AddImageShapeCompatibilityEntryRequest struct { type AddImageShapeCompatibilityEntryRequest struct {
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image. // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AddNetworkSecurityGroupSecurityRulesDetails The representation of AddNetworkSecurityGroupSecurityRulesDetails // AddNetworkSecurityGroupSecurityRulesDetails The representation of AddNetworkSecurityGroupSecurityRulesDetails

View File

@ -1,18 +1,22 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// AddNetworkSecurityGroupSecurityRulesRequest wrapper for the AddNetworkSecurityGroupSecurityRules operation // AddNetworkSecurityGroupSecurityRulesRequest wrapper for the AddNetworkSecurityGroupSecurityRules operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AddNetworkSecurityGroupSecurityRules.go.html to see an example of how to use AddNetworkSecurityGroupSecurityRulesRequest.
type AddNetworkSecurityGroupSecurityRulesRequest struct { type AddNetworkSecurityGroupSecurityRulesRequest struct {
// The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the network security group.
NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"` NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"`
// Request with one or more security rules to be associated with the network security group. // Request with one or more security rules to be associated with the network security group.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,21 +14,20 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// LaunchInstanceAgentConfigDetails Instance agent configuration options to choose for launching the instance // AddPublicIpPoolCapacityDetails The information used to add capacity to an IP pool.
type LaunchInstanceAgentConfigDetails struct { type AddPublicIpPoolCapacityDetails struct {
// Whether the agent running on the instance can gather performance metrics and monitor the instance. // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the `ByoipRange` resource to which the CIDR block belongs.
// Default value is false. ByoipRangeId *string `mandatory:"true" json:"byoipRangeId"`
IsMonitoringDisabled *bool `mandatory:"false" json:"isMonitoringDisabled"`
// Whether the agent running on the instance can run all the available management plugins. // The CIDR block to add to the public IP pool. It could be all of the CIDR block identified in `byoipRangeId`, or a subrange.
// Default value is false. // Example: `10.0.1.0/24`
IsManagementDisabled *bool `mandatory:"false" json:"isManagementDisabled"` CidrBlock *string `mandatory:"true" json:"cidrBlock"`
} }
func (m LaunchInstanceAgentConfigDetails) String() string { func (m AddPublicIpPoolCapacityDetails) String() string {
return common.PointerString(m) return common.PointerString(m)
} }

View File

@ -0,0 +1,79 @@
// Copyright (c) 2016, 2018, 2021, 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 core
import (
"github.com/oracle/oci-go-sdk/v36/common"
"net/http"
)
// AddPublicIpPoolCapacityRequest wrapper for the AddPublicIpPoolCapacity operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AddPublicIpPoolCapacity.go.html to see an example of how to use AddPublicIpPoolCapacityRequest.
type AddPublicIpPoolCapacityRequest struct {
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the public IP pool.
PublicIpPoolId *string `mandatory:"true" contributesTo:"path" name:"publicIpPoolId"`
// Byoip Range prefix and a cidr from it
AddPublicIpPoolCapacityDetails `contributesTo:"body"`
// Unique identifier for the request.
// If you need to contact Oracle about a particular request, please provide the request ID.
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
// may 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 AddPublicIpPoolCapacityRequest) String() string {
return common.PointerString(request)
}
// HTTPRequest implements the OCIRequest interface
func (request AddPublicIpPoolCapacityRequest) HTTPRequest(method, path string) (http.Request, error) {
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
}
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (request AddPublicIpPoolCapacityRequest) RetryPolicy() *common.RetryPolicy {
return request.RequestMetadata.RetryPolicy
}
// AddPublicIpPoolCapacityResponse wrapper for the AddPublicIpPoolCapacity operation
type AddPublicIpPoolCapacityResponse struct {
// The underlying http response
RawResponse *http.Response
// The PublicIpPool instance
PublicIpPool `presentIn:"body"`
// For optimistic concurrency control. See `if-match`.
Etag *string `presentIn:"header" name:"etag"`
// 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 AddPublicIpPoolCapacityResponse) String() string {
return common.PointerString(response)
}
// HTTPResponse implements the OCIResponse interface
func (response AddPublicIpPoolCapacityResponse) HTTPResponse() *http.Response {
return response.RawResponse
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,13 +14,14 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AddSecurityRuleDetails A rule for allowing inbound (INGRESS) or outbound (EGRESS) IP packets. // AddSecurityRuleDetails A rule for allowing inbound (INGRESS) or outbound (EGRESS) IP packets.
type AddSecurityRuleDetails struct { type AddSecurityRuleDetails struct {
// Direction of the security rule. Set to `EGRESS` for rules to allow outbound IP packets, or `INGRESS` for rules to allow inbound IP packets. // Direction of the security rule. Set to `EGRESS` for rules to allow outbound IP packets,
// or `INGRESS` for rules to allow inbound IP packets.
Direction AddSecurityRuleDetailsDirectionEnum `mandatory:"true" json:"direction"` Direction AddSecurityRuleDetailsDirectionEnum `mandatory:"true" json:"direction"`
// The transport protocol. Specify either `all` or an IPv4 protocol number as // The transport protocol. Specify either `all` or an IPv4 protocol number as
@ -37,7 +38,7 @@ type AddSecurityRuleDetails struct {
// Allowed values: // Allowed values:
// * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56` // * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56`
// Note that IPv6 addressing is currently supported only in certain regions. See // Note that IPv6 addressing is currently supported only in certain regions. See
// IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // IPv6 Addresses (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/ipv6.htm).
// * The `cidrBlock` value for a Service, if you're // * The `cidrBlock` value for a Service, if you're
// setting up a security rule for traffic destined for a particular `Service` through // setting up a security rule for traffic destined for a particular `Service` through
// a service gateway. For example: `oci-phx-objectstorage`. // a service gateway. For example: `oci-phx-objectstorage`.
@ -56,15 +57,6 @@ type AddSecurityRuleDetails struct {
// NetworkSecurityGroup. // NetworkSecurityGroup.
DestinationType AddSecurityRuleDetailsDestinationTypeEnum `mandatory:"false" json:"destinationType,omitempty"` DestinationType AddSecurityRuleDetailsDestinationTypeEnum `mandatory:"false" json:"destinationType,omitempty"`
// Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code
// as defined in:
// - ICMP Parameters (http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml)
// - ICMPv6 Parameters (https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml)
// If you specify ICMP or ICMPv6 as the protocol but omit this object, then all ICMP types and
// codes are allowed. If you do provide this object, the type is required and the code is optional.
// To enable MTU negotiation for ingress internet traffic via IPv4, make sure to allow type 3 ("Destination
// Unreachable") code 4 ("Fragmentation Needed and Don't Fragment was Set"). If you need to specify
// multiple codes for a single type, create a separate security list rule for each.
IcmpOptions *IcmpOptions `mandatory:"false" json:"icmpOptions"` IcmpOptions *IcmpOptions `mandatory:"false" json:"icmpOptions"`
// A stateless rule allows traffic in one direction. Remember to add a corresponding // A stateless rule allows traffic in one direction. Remember to add a corresponding
@ -79,7 +71,7 @@ type AddSecurityRuleDetails struct {
// Allowed values: // Allowed values:
// * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56` // * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56`
// Note that IPv6 addressing is currently supported only in certain regions. See // Note that IPv6 addressing is currently supported only in certain regions. See
// IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // IPv6 Addresses (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/ipv6.htm).
// * The `cidrBlock` value for a Service, if you're // * The `cidrBlock` value for a Service, if you're
// setting up a security rule for traffic coming from a particular `Service` through // setting up a security rule for traffic coming from a particular `Service` through
// a service gateway. For example: `oci-phx-objectstorage`. // a service gateway. For example: `oci-phx-objectstorage`.
@ -97,12 +89,8 @@ type AddSecurityRuleDetails struct {
// NetworkSecurityGroup. // NetworkSecurityGroup.
SourceType AddSecurityRuleDetailsSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` SourceType AddSecurityRuleDetailsSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"`
// Optional and valid only for TCP. Use to specify particular destination ports for TCP rules.
// If you specify TCP as the protocol but omit this object, then all destination ports are allowed.
TcpOptions *TcpOptions `mandatory:"false" json:"tcpOptions"` TcpOptions *TcpOptions `mandatory:"false" json:"tcpOptions"`
// Optional and valid only for UDP. Use to specify particular destination ports for UDP rules.
// If you specify UDP as the protocol but omit this object, then all destination ports are allowed.
UdpOptions *UdpOptions `mandatory:"false" json:"udpOptions"` UdpOptions *UdpOptions `mandatory:"false" json:"udpOptions"`
} }

View File

@ -0,0 +1,29 @@
// Copyright (c) 2016, 2018, 2021, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"github.com/oracle/oci-go-sdk/v36/common"
)
// AddVcnCidrDetails Details for adding a CIDR block to a VCN.
type AddVcnCidrDetails struct {
// The CIDR block to add.
CidrBlock *string `mandatory:"true" json:"cidrBlock"`
}
func (m AddVcnCidrDetails) String() string {
return common.PointerString(m)
}

View File

@ -0,0 +1,82 @@
// Copyright (c) 2016, 2018, 2021, 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 core
import (
"github.com/oracle/oci-go-sdk/v36/common"
"net/http"
)
// AddVcnCidrRequest wrapper for the AddVcnCidr operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AddVcnCidr.go.html to see an example of how to use AddVcnCidrRequest.
type AddVcnCidrRequest struct {
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VCN.
VcnId *string `mandatory:"true" contributesTo:"path" name:"vcnId"`
// Details object for deleting a VCN CIDR.
AddVcnCidrDetails `contributesTo:"body"`
// Unique identifier for the request.
// If you need to contact Oracle about a particular request, please provide the request ID.
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
// may be rejected).
OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"`
// 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 AddVcnCidrRequest) String() string {
return common.PointerString(request)
}
// HTTPRequest implements the OCIRequest interface
func (request AddVcnCidrRequest) HTTPRequest(method, path string) (http.Request, error) {
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
}
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (request AddVcnCidrRequest) RetryPolicy() *common.RetryPolicy {
return request.RequestMetadata.RetryPolicy
}
// AddVcnCidrResponse wrapper for the AddVcnCidr operation
type AddVcnCidrResponse struct {
// The underlying http response
RawResponse *http.Response
// 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"`
// The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest)
// with this ID to track the status of the request.
OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"`
}
func (response AddVcnCidrResponse) String() string {
return common.PointerString(response)
}
// HTTPResponse implements the OCIResponse interface
func (response AddVcnCidrResponse) HTTPResponse() *http.Response {
return response.RawResponse
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AddedNetworkSecurityGroupSecurityRules The representation of AddedNetworkSecurityGroupSecurityRules // AddedNetworkSecurityGroupSecurityRules The representation of AddedNetworkSecurityGroupSecurityRules

View File

@ -0,0 +1,63 @@
// Copyright (c) 2016, 2018, 2021, 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 core
import (
"github.com/oracle/oci-go-sdk/v36/common"
"net/http"
)
// AdvertiseByoipRangeRequest wrapper for the AdvertiseByoipRange operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AdvertiseByoipRange.go.html to see an example of how to use AdvertiseByoipRangeRequest.
type AdvertiseByoipRangeRequest struct {
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the `ByoipRange` resource containing the BYOIP CIDR block.
ByoipRangeId *string `mandatory:"true" contributesTo:"path" name:"byoipRangeId"`
// Unique identifier for the request.
// If you need to contact Oracle about a particular request, please provide the request ID.
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 AdvertiseByoipRangeRequest) String() string {
return common.PointerString(request)
}
// HTTPRequest implements the OCIRequest interface
func (request AdvertiseByoipRangeRequest) HTTPRequest(method, path string) (http.Request, error) {
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
}
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (request AdvertiseByoipRangeRequest) RetryPolicy() *common.RetryPolicy {
return request.RequestMetadata.RetryPolicy
}
// AdvertiseByoipRangeResponse wrapper for the AdvertiseByoipRange operation
type AdvertiseByoipRangeResponse struct {
// The underlying http response
RawResponse *http.Response
// 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 AdvertiseByoipRangeResponse) String() string {
return common.PointerString(response)
}
// HTTPResponse implements the OCIResponse interface
func (response AdvertiseByoipRangeResponse) HTTPResponse() *http.Response {
return response.RawResponse
}

View File

@ -0,0 +1,71 @@
// Copyright (c) 2016, 2018, 2021, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"encoding/json"
"github.com/oracle/oci-go-sdk/v36/common"
)
// AmdMilanBmLaunchInstancePlatformConfig The platform configuration used when launching a bare metal instance specific to the AMD Milan platform.
type AmdMilanBmLaunchInstancePlatformConfig struct {
// The number of NUMA nodes per socket.
NumaNodesPerSocket AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum `mandatory:"false" json:"numaNodesPerSocket,omitempty"`
}
func (m AmdMilanBmLaunchInstancePlatformConfig) String() string {
return common.PointerString(m)
}
// MarshalJSON marshals to json representation
func (m AmdMilanBmLaunchInstancePlatformConfig) MarshalJSON() (buff []byte, e error) {
type MarshalTypeAmdMilanBmLaunchInstancePlatformConfig AmdMilanBmLaunchInstancePlatformConfig
s := struct {
DiscriminatorParam string `json:"type"`
MarshalTypeAmdMilanBmLaunchInstancePlatformConfig
}{
"AMD_MILAN_BM",
(MarshalTypeAmdMilanBmLaunchInstancePlatformConfig)(m),
}
return json.Marshal(&s)
}
// AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum Enum with underlying type: string
type AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum string
// Set of constants representing the allowable values for AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum
const (
AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps0 AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS0"
AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1 AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1"
AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2 AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2"
AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4 AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4"
)
var mappingAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocket = map[string]AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{
"NPS0": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps0,
"NPS1": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1,
"NPS2": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2,
"NPS4": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4,
}
// GetAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum
func GetAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues() []AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum {
values := make([]AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum, 0)
for _, v := range mappingAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocket {
values = append(values, v)
}
return values
}

View File

@ -0,0 +1,71 @@
// Copyright (c) 2016, 2018, 2021, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"encoding/json"
"github.com/oracle/oci-go-sdk/v36/common"
)
// AmdMilanBmPlatformConfig The platform configuration of a bare metal instance specific to the AMD Milan platform.
type AmdMilanBmPlatformConfig struct {
// The number of NUMA nodes per socket.
NumaNodesPerSocket AmdMilanBmPlatformConfigNumaNodesPerSocketEnum `mandatory:"false" json:"numaNodesPerSocket,omitempty"`
}
func (m AmdMilanBmPlatformConfig) String() string {
return common.PointerString(m)
}
// MarshalJSON marshals to json representation
func (m AmdMilanBmPlatformConfig) MarshalJSON() (buff []byte, e error) {
type MarshalTypeAmdMilanBmPlatformConfig AmdMilanBmPlatformConfig
s := struct {
DiscriminatorParam string `json:"type"`
MarshalTypeAmdMilanBmPlatformConfig
}{
"AMD_MILAN_BM",
(MarshalTypeAmdMilanBmPlatformConfig)(m),
}
return json.Marshal(&s)
}
// AmdMilanBmPlatformConfigNumaNodesPerSocketEnum Enum with underlying type: string
type AmdMilanBmPlatformConfigNumaNodesPerSocketEnum string
// Set of constants representing the allowable values for AmdMilanBmPlatformConfigNumaNodesPerSocketEnum
const (
AmdMilanBmPlatformConfigNumaNodesPerSocketNps0 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS0"
AmdMilanBmPlatformConfigNumaNodesPerSocketNps1 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS1"
AmdMilanBmPlatformConfigNumaNodesPerSocketNps2 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS2"
AmdMilanBmPlatformConfigNumaNodesPerSocketNps4 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS4"
)
var mappingAmdMilanBmPlatformConfigNumaNodesPerSocket = map[string]AmdMilanBmPlatformConfigNumaNodesPerSocketEnum{
"NPS0": AmdMilanBmPlatformConfigNumaNodesPerSocketNps0,
"NPS1": AmdMilanBmPlatformConfigNumaNodesPerSocketNps1,
"NPS2": AmdMilanBmPlatformConfigNumaNodesPerSocketNps2,
"NPS4": AmdMilanBmPlatformConfigNumaNodesPerSocketNps4,
}
// GetAmdMilanBmPlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for AmdMilanBmPlatformConfigNumaNodesPerSocketEnum
func GetAmdMilanBmPlatformConfigNumaNodesPerSocketEnumValues() []AmdMilanBmPlatformConfigNumaNodesPerSocketEnum {
values := make([]AmdMilanBmPlatformConfigNumaNodesPerSocketEnum, 0)
for _, v := range mappingAmdMilanBmPlatformConfigNumaNodesPerSocket {
values = append(values, v)
}
return values
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AppCatalogListing Listing details. // AppCatalogListing Listing details.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AppCatalogListingResourceVersion Listing Resource Version // AppCatalogListingResourceVersion Listing Resource Version

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AppCatalogListingResourceVersionAgreements Agreements for a listing resource version. // AppCatalogListingResourceVersionAgreements Agreements for a listing resource version.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AppCatalogListingResourceVersionSummary Listing Resource Version summary // AppCatalogListingResourceVersionSummary Listing Resource Version summary

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AppCatalogListingSummary A summary of a listing. // AppCatalogListingSummary A summary of a listing.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AppCatalogSubscription a subscription for a listing resource version. // AppCatalogSubscription a subscription for a listing resource version.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AppCatalogSubscriptionSummary a subscription summary for a listing resource version. // AppCatalogSubscriptionSummary a subscription summary for a listing resource version.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AttachBootVolumeDetails The representation of AttachBootVolumeDetails // AttachBootVolumeDetails The representation of AttachBootVolumeDetails

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// AttachBootVolumeRequest wrapper for the AttachBootVolume operation // AttachBootVolumeRequest wrapper for the AttachBootVolume operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AttachBootVolume.go.html to see an example of how to use AttachBootVolumeRequest.
type AttachBootVolumeRequest struct { type AttachBootVolumeRequest struct {
// Attach boot volume request // Attach boot volume request

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -15,7 +15,7 @@ package core
import ( import (
"encoding/json" "encoding/json"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AttachEmulatedVolumeDetails The representation of AttachEmulatedVolumeDetails // AttachEmulatedVolumeDetails The representation of AttachEmulatedVolumeDetails

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -15,7 +15,7 @@ package core
import ( import (
"encoding/json" "encoding/json"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AttachIScsiVolumeDetails The representation of AttachIScsiVolumeDetails // AttachIScsiVolumeDetails The representation of AttachIScsiVolumeDetails

View File

@ -0,0 +1,29 @@
// Copyright (c) 2016, 2018, 2021, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"github.com/oracle/oci-go-sdk/v36/common"
)
// AttachInstancePoolInstanceDetails Contains an instance and availability domain information for attaching an instance to the pool.
type AttachInstancePoolInstanceDetails struct {
// the instance ocid to attach.
InstanceId *string `mandatory:"true" json:"instanceId"`
}
func (m AttachInstancePoolInstanceDetails) String() string {
return common.PointerString(m)
}

View File

@ -0,0 +1,86 @@
// Copyright (c) 2016, 2018, 2021, 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 core
import (
"github.com/oracle/oci-go-sdk/v36/common"
"net/http"
)
// AttachInstancePoolInstanceRequest wrapper for the AttachInstancePoolInstance operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AttachInstancePoolInstance.go.html to see an example of how to use AttachInstancePoolInstanceRequest.
type AttachInstancePoolInstanceRequest struct {
// The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool.
InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"`
// Attach an instance to a pool
AttachInstancePoolInstanceDetails `contributesTo:"body"`
// 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
// may be rejected).
OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"`
// Unique Oracle-assigned identifier for the request.
// If you need to contact Oracle about a particular request, please provide the request ID.
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 AttachInstancePoolInstanceRequest) String() string {
return common.PointerString(request)
}
// HTTPRequest implements the OCIRequest interface
func (request AttachInstancePoolInstanceRequest) HTTPRequest(method, path string) (http.Request, error) {
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
}
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (request AttachInstancePoolInstanceRequest) RetryPolicy() *common.RetryPolicy {
return request.RequestMetadata.RetryPolicy
}
// AttachInstancePoolInstanceResponse wrapper for the AttachInstancePoolInstance operation
type AttachInstancePoolInstanceResponse struct {
// The underlying http response
RawResponse *http.Response
// The InstancePoolInstance instance
InstancePoolInstance `presentIn:"body"`
// Unique Oracle-assigned identifier for the request. If you need to contact
// Oracle about a particular request, please provide the request ID.
OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
// For optimistic concurrency control. See `if-match`.
Etag *string `presentIn:"header" name:"etag"`
// The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest)
// with this ID to track the status of the request.
OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"`
// Location of the resource.
Location *string `presentIn:"header" name:"location"`
}
func (response AttachInstancePoolInstanceResponse) String() string {
return common.PointerString(response)
}
// HTTPResponse implements the OCIResponse interface
func (response AttachInstancePoolInstanceResponse) HTTPResponse() *http.Response {
return response.RawResponse
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AttachLoadBalancerDetails Represents a load balancer that is to be attached to an instance pool. // AttachLoadBalancerDetails Represents a load balancer that is to be attached to an instance pool.
@ -29,7 +29,9 @@ type AttachLoadBalancerDetails struct {
// The port value to use when creating the backend set. // The port value to use when creating the backend set.
Port *int `mandatory:"true" json:"port"` Port *int `mandatory:"true" json:"port"`
// Indicates which VNIC on each instance in the pool should be used to associate with the load balancer. Possible values are "PrimaryVnic" or the displayName of one of the secondary VNICs on the instance configuration that is associated with the instance pool. // Indicates which VNIC on each instance in the pool should be used to associate with the load balancer.
// Possible values are "PrimaryVnic" or the displayName of one of the secondary VNICs on the instance configuration
// that is associated with the instance pool.
VnicSelection *string `mandatory:"true" json:"vnicSelection"` VnicSelection *string `mandatory:"true" json:"vnicSelection"`
} }

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// AttachLoadBalancerRequest wrapper for the AttachLoadBalancer operation // AttachLoadBalancerRequest wrapper for the AttachLoadBalancer operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AttachLoadBalancer.go.html to see an example of how to use AttachLoadBalancerRequest.
type AttachLoadBalancerRequest struct { type AttachLoadBalancerRequest struct {
// The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool.
@ -26,7 +30,7 @@ type AttachLoadBalancerRequest struct {
OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"`
// For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // 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 // 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. // 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"` IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"`

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -15,7 +15,7 @@ package core
import ( import (
"encoding/json" "encoding/json"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AttachParavirtualizedVolumeDetails The representation of AttachParavirtualizedVolumeDetails // AttachParavirtualizedVolumeDetails The representation of AttachParavirtualizedVolumeDetails

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -15,7 +15,7 @@ package core
import ( import (
"encoding/json" "encoding/json"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AttachServiceDeterminedVolumeDetails The representation of AttachServiceDeterminedVolumeDetails // AttachServiceDeterminedVolumeDetails The representation of AttachServiceDeterminedVolumeDetails

View File

@ -1,25 +1,29 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// AttachServiceIdRequest wrapper for the AttachServiceId operation // AttachServiceIdRequest wrapper for the AttachServiceId operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AttachServiceId.go.html to see an example of how to use AttachServiceIdRequest.
type AttachServiceIdRequest struct { type AttachServiceIdRequest struct {
// The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // The service gateway's OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"`
// ServiceId of Service to be attached to a service gateway. // ServiceId of Service to be attached to a service gateway.
AttachServiceDetails ServiceIdRequestDetails `contributesTo:"body"` AttachServiceDetails ServiceIdRequestDetails `contributesTo:"body"`
// For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // 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 // 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. // 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"` IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"`

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,13 +14,11 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AttachVnicDetails The representation of AttachVnicDetails // AttachVnicDetails The representation of AttachVnicDetails
type AttachVnicDetails struct { type AttachVnicDetails struct {
// Details for creating a new VNIC.
CreateVnicDetails *CreateVnicDetails `mandatory:"true" json:"createVnicDetails"` CreateVnicDetails *CreateVnicDetails `mandatory:"true" json:"createVnicDetails"`
// The OCID of the instance. // The OCID of the instance.

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// AttachVnicRequest wrapper for the AttachVnic operation // AttachVnicRequest wrapper for the AttachVnic operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AttachVnic.go.html to see an example of how to use AttachVnicRequest.
type AttachVnicRequest struct { type AttachVnicRequest struct {
// Attach VNIC details. // Attach VNIC details.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -15,7 +15,7 @@ package core
import ( import (
"encoding/json" "encoding/json"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// AttachVolumeDetails The representation of AttachVolumeDetails // AttachVolumeDetails The representation of AttachVolumeDetails

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// AttachVolumeRequest wrapper for the AttachVolume operation // AttachVolumeRequest wrapper for the AttachVolume operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AttachVolume.go.html to see an example of how to use AttachVolumeRequest.
type AttachVolumeRequest struct { type AttachVolumeRequest struct {
// Attach volume request // Attach volume request

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BgpSessionInfo Information for establishing a BGP session for the IPSec tunnel. // BgpSessionInfo Information for establishing a BGP session for the IPSec tunnel.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -15,7 +15,7 @@ package core
import ( import (
"encoding/json" "encoding/json"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BooleanImageCapabilitySchemaDescriptor Boolean type ImageCapabilitySchemaDescriptor // BooleanImageCapabilitySchemaDescriptor Boolean type ImageCapabilitySchemaDescriptor

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -15,7 +15,7 @@ package core
import ( import (
"encoding/json" "encoding/json"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BootVolume A detachable boot volume device that contains the image used to boot a Compute instance. For more information, see // BootVolume A detachable boot volume device that contains the image used to boot a Compute instance. For more information, see
@ -69,7 +69,8 @@ type BootVolume struct {
// The image OCID used to create the boot volume. // The image OCID used to create the boot volume.
ImageId *string `mandatory:"false" json:"imageId"` ImageId *string `mandatory:"false" json:"imageId"`
// Specifies whether the boot volume's data has finished copying from the source boot volume or boot volume backup. // Specifies whether the boot volume's data has finished copying
// from the source boot volume or boot volume backup.
IsHydrated *bool `mandatory:"false" json:"isHydrated"` IsHydrated *bool `mandatory:"false" json:"isHydrated"`
// The number of volume performance units (VPUs) that will be applied to this boot volume per GB, // The number of volume performance units (VPUs) that will be applied to this boot volume per GB,
@ -83,8 +84,6 @@ type BootVolume struct {
// The size of the boot volume in GBs. // The size of the boot volume in GBs.
SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"`
// The boot volume source, either an existing boot volume in the same availability domain or a boot volume backup.
// If null, this means that the boot volume was created from an image.
SourceDetails BootVolumeSourceDetails `mandatory:"false" json:"sourceDetails"` SourceDetails BootVolumeSourceDetails `mandatory:"false" json:"sourceDetails"`
// The OCID of the source volume group. // The OCID of the source volume group.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BootVolumeAttachment Represents an attachment between a boot volume and an instance. // BootVolumeAttachment Represents an attachment between a boot volume and an instance.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BootVolumeBackup A point-in-time copy of a boot volume that can then be used to create // BootVolumeBackup A point-in-time copy of a boot volume that can then be used to create

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BootVolumeKmsKey The Key Management master encryption key associated with this volume. // BootVolumeKmsKey The Key Management master encryption key associated with this volume.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -15,7 +15,7 @@ package core
import ( import (
"encoding/json" "encoding/json"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BootVolumeSourceDetails The representation of BootVolumeSourceDetails // BootVolumeSourceDetails The representation of BootVolumeSourceDetails

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -15,7 +15,7 @@ package core
import ( import (
"encoding/json" "encoding/json"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BootVolumeSourceFromBootVolumeBackupDetails Specifies the boot volume backup. // BootVolumeSourceFromBootVolumeBackupDetails Specifies the boot volume backup.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -15,7 +15,7 @@ package core
import ( import (
"encoding/json" "encoding/json"
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BootVolumeSourceFromBootVolumeDetails Specifies the source boot volume. // BootVolumeSourceFromBootVolumeDetails Specifies the source boot volume.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BulkAddVirtualCircuitPublicPrefixesDetails The representation of BulkAddVirtualCircuitPublicPrefixesDetails // BulkAddVirtualCircuitPublicPrefixesDetails The representation of BulkAddVirtualCircuitPublicPrefixesDetails

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// BulkAddVirtualCircuitPublicPrefixesRequest wrapper for the BulkAddVirtualCircuitPublicPrefixes operation // BulkAddVirtualCircuitPublicPrefixesRequest wrapper for the BulkAddVirtualCircuitPublicPrefixes operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/BulkAddVirtualCircuitPublicPrefixes.go.html to see an example of how to use BulkAddVirtualCircuitPublicPrefixesRequest.
type BulkAddVirtualCircuitPublicPrefixesRequest struct { type BulkAddVirtualCircuitPublicPrefixesRequest struct {
// The OCID of the virtual circuit. // The OCID of the virtual circuit.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// BulkDeleteVirtualCircuitPublicPrefixesDetails The representation of BulkDeleteVirtualCircuitPublicPrefixesDetails // BulkDeleteVirtualCircuitPublicPrefixesDetails The representation of BulkDeleteVirtualCircuitPublicPrefixesDetails

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// BulkDeleteVirtualCircuitPublicPrefixesRequest wrapper for the BulkDeleteVirtualCircuitPublicPrefixes operation // BulkDeleteVirtualCircuitPublicPrefixesRequest wrapper for the BulkDeleteVirtualCircuitPublicPrefixes operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/BulkDeleteVirtualCircuitPublicPrefixes.go.html to see an example of how to use BulkDeleteVirtualCircuitPublicPrefixesRequest.
type BulkDeleteVirtualCircuitPublicPrefixesRequest struct { type BulkDeleteVirtualCircuitPublicPrefixesRequest struct {
// The OCID of the virtual circuit. // The OCID of the virtual circuit.

View File

@ -0,0 +1,29 @@
// Copyright (c) 2016, 2018, 2021, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"github.com/oracle/oci-go-sdk/v36/common"
)
// ByoipAllocatedRangeCollection Results of a `ListByoipAllocatedRanges` operation.
type ByoipAllocatedRangeCollection struct {
// A list of subranges of a BYOIP CIDR block allocated to an IP pool.
Items []ByoipAllocatedRangeSummary `mandatory:"true" json:"items"`
}
func (m ByoipAllocatedRangeCollection) String() string {
return common.PointerString(m)
}

View File

@ -0,0 +1,32 @@
// Copyright (c) 2016, 2018, 2021, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"github.com/oracle/oci-go-sdk/v36/common"
)
// ByoipAllocatedRangeSummary A summary of CIDR block subranges that are currently allocated to an IP pool.
type ByoipAllocatedRangeSummary struct {
// The BYOIP CIDR block range or subrange allocated to an IP pool. This could be all or part of a BYOIP CIDR block.
CidrBlock *string `mandatory:"false" json:"cidrBlock"`
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the IP pool containing the CIDR block.
PublicIpPoolId *string `mandatory:"false" json:"publicIpPoolId"`
}
func (m ByoipAllocatedRangeSummary) String() string {
return common.PointerString(m)
}

View File

@ -0,0 +1,141 @@
// Copyright (c) 2016, 2018, 2021, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"github.com/oracle/oci-go-sdk/v36/common"
)
// ByoipRange Oracle offers the ability to Bring Your Own IP (BYOIP), importing public IP addresses that you currently own to Oracle Cloud Infrastructure. A `ByoipRange` resource is a record of the imported address block (a BYOIP CIDR block) and also some associated metadata.
// The process used to Bring Your Own IP (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/BYOIP.htm) is explained in the documentation.
type ByoipRange struct {
// The public IPv4 CIDR block being imported from on-premises to the Oracle cloud.
CidrBlock *string `mandatory:"true" json:"cidrBlock"`
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the BYOIP CIDR block.
CompartmentId *string `mandatory:"true" json:"compartmentId"`
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the `ByoipRange` resource.
Id *string `mandatory:"true" json:"id"`
// The `ByoipRange` resource's current state.
LifecycleState ByoipRangeLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
// The date and time the `ByoipRange` resource was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339).
// Example: `2016-08-25T21:10:29.600Z`
TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
// The validation token is an internally-generated ASCII string used in the validation process. See Importing a CIDR block (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/BYOIP.htm#import_cidr) for details.
ValidationToken *string `mandatory:"true" json:"validationToken"`
// Defined tags for this resource. Each key is predefined and scoped to a
// namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
// Example: `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// A user-friendly name. Does not have to be unique, and it's changeable. Avoid
// entering confidential information.
DisplayName *string `mandatory:"false" json:"displayName"`
// 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/Content/General/Concepts/resourcetags.htm).
// Example: `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
// The `ByoipRange` resource's current status.
LifecycleDetails ByoipRangeLifecycleDetailsEnum `mandatory:"false" json:"lifecycleDetails,omitempty"`
// The date and time the `ByoipRange` resource was validated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339).
// Example: `2016-08-25T21:10:29.600Z`
TimeValidated *common.SDKTime `mandatory:"false" json:"timeValidated"`
// The date and time the `ByoipRange` resource was advertised to the internet by BGP, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339).
// Example: `2016-08-25T21:10:29.600Z`
TimeAdvertised *common.SDKTime `mandatory:"false" json:"timeAdvertised"`
// The date and time the `ByoipRange` resource was withdrawn from advertisement by BGP to the internet, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339).
// Example: `2016-08-25T21:10:29.600Z`
TimeWithdrawn *common.SDKTime `mandatory:"false" json:"timeWithdrawn"`
}
func (m ByoipRange) String() string {
return common.PointerString(m)
}
// ByoipRangeLifecycleDetailsEnum Enum with underlying type: string
type ByoipRangeLifecycleDetailsEnum string
// Set of constants representing the allowable values for ByoipRangeLifecycleDetailsEnum
const (
ByoipRangeLifecycleDetailsCreating ByoipRangeLifecycleDetailsEnum = "CREATING"
ByoipRangeLifecycleDetailsValidating ByoipRangeLifecycleDetailsEnum = "VALIDATING"
ByoipRangeLifecycleDetailsProvisioned ByoipRangeLifecycleDetailsEnum = "PROVISIONED"
ByoipRangeLifecycleDetailsActive ByoipRangeLifecycleDetailsEnum = "ACTIVE"
ByoipRangeLifecycleDetailsFailed ByoipRangeLifecycleDetailsEnum = "FAILED"
ByoipRangeLifecycleDetailsDeleting ByoipRangeLifecycleDetailsEnum = "DELETING"
ByoipRangeLifecycleDetailsDeleted ByoipRangeLifecycleDetailsEnum = "DELETED"
ByoipRangeLifecycleDetailsAdvertising ByoipRangeLifecycleDetailsEnum = "ADVERTISING"
ByoipRangeLifecycleDetailsWithdrawing ByoipRangeLifecycleDetailsEnum = "WITHDRAWING"
)
var mappingByoipRangeLifecycleDetails = map[string]ByoipRangeLifecycleDetailsEnum{
"CREATING": ByoipRangeLifecycleDetailsCreating,
"VALIDATING": ByoipRangeLifecycleDetailsValidating,
"PROVISIONED": ByoipRangeLifecycleDetailsProvisioned,
"ACTIVE": ByoipRangeLifecycleDetailsActive,
"FAILED": ByoipRangeLifecycleDetailsFailed,
"DELETING": ByoipRangeLifecycleDetailsDeleting,
"DELETED": ByoipRangeLifecycleDetailsDeleted,
"ADVERTISING": ByoipRangeLifecycleDetailsAdvertising,
"WITHDRAWING": ByoipRangeLifecycleDetailsWithdrawing,
}
// GetByoipRangeLifecycleDetailsEnumValues Enumerates the set of values for ByoipRangeLifecycleDetailsEnum
func GetByoipRangeLifecycleDetailsEnumValues() []ByoipRangeLifecycleDetailsEnum {
values := make([]ByoipRangeLifecycleDetailsEnum, 0)
for _, v := range mappingByoipRangeLifecycleDetails {
values = append(values, v)
}
return values
}
// ByoipRangeLifecycleStateEnum Enum with underlying type: string
type ByoipRangeLifecycleStateEnum string
// Set of constants representing the allowable values for ByoipRangeLifecycleStateEnum
const (
ByoipRangeLifecycleStateInactive ByoipRangeLifecycleStateEnum = "INACTIVE"
ByoipRangeLifecycleStateUpdating ByoipRangeLifecycleStateEnum = "UPDATING"
ByoipRangeLifecycleStateActive ByoipRangeLifecycleStateEnum = "ACTIVE"
ByoipRangeLifecycleStateDeleting ByoipRangeLifecycleStateEnum = "DELETING"
ByoipRangeLifecycleStateDeleted ByoipRangeLifecycleStateEnum = "DELETED"
)
var mappingByoipRangeLifecycleState = map[string]ByoipRangeLifecycleStateEnum{
"INACTIVE": ByoipRangeLifecycleStateInactive,
"UPDATING": ByoipRangeLifecycleStateUpdating,
"ACTIVE": ByoipRangeLifecycleStateActive,
"DELETING": ByoipRangeLifecycleStateDeleting,
"DELETED": ByoipRangeLifecycleStateDeleted,
}
// GetByoipRangeLifecycleStateEnumValues Enumerates the set of values for ByoipRangeLifecycleStateEnum
func GetByoipRangeLifecycleStateEnumValues() []ByoipRangeLifecycleStateEnum {
values := make([]ByoipRangeLifecycleStateEnum, 0)
for _, v := range mappingByoipRangeLifecycleState {
values = append(values, v)
}
return values
}

View File

@ -0,0 +1,29 @@
// Copyright (c) 2016, 2018, 2021, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"github.com/oracle/oci-go-sdk/v36/common"
)
// ByoipRangeCollection The results returned by a `ListByoipRange` operation.
type ByoipRangeCollection struct {
// A list of `ByoipRange` resource summaries.
Items []ByoipRangeSummary `mandatory:"true" json:"items"`
}
func (m ByoipRangeCollection) String() string {
return common.PointerString(m)
}

View File

@ -0,0 +1,59 @@
// Copyright (c) 2016, 2018, 2021, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"github.com/oracle/oci-go-sdk/v36/common"
)
// ByoipRangeSummary Information about a `ByoipRange` resource.
type ByoipRangeSummary struct {
// The public IPv4 address range you are importing to the Oracle cloud.
CidrBlock *string `mandatory:"false" json:"cidrBlock"`
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the `ByoipRange` resource.
CompartmentId *string `mandatory:"false" json:"compartmentId"`
// Defined tags for this resource. Each key is predefined and scoped to a
// namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
// Example: `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// A user-friendly name. Does not have to be unique, and it's changeable. Avoid
// entering confidential information.
DisplayName *string `mandatory:"false" json:"displayName"`
// 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/Content/General/Concepts/resourcetags.htm).
// Example: `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the `ByoipRange` resource.
Id *string `mandatory:"false" json:"id"`
// The `ByoipRange` resource's current state.
LifecycleState ByoipRangeLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"`
// The Byoip Range's current lifeCycle substate.
LifecycleDetails ByoipRangeLifecycleDetailsEnum `mandatory:"false" json:"lifecycleDetails,omitempty"`
// The date and time the `ByoipRange` resource was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339).
// Example: `2016-08-25T21:10:29.600Z`
TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
}
func (m ByoipRangeSummary) String() string {
return common.PointerString(m)
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// CaptureConsoleHistoryDetails The representation of CaptureConsoleHistoryDetails // CaptureConsoleHistoryDetails The representation of CaptureConsoleHistoryDetails

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// CaptureConsoleHistoryRequest wrapper for the CaptureConsoleHistory operation // CaptureConsoleHistoryRequest wrapper for the CaptureConsoleHistory operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/CaptureConsoleHistory.go.html to see an example of how to use CaptureConsoleHistoryRequest.
type CaptureConsoleHistoryRequest struct { type CaptureConsoleHistoryRequest struct {
// Console history details // Console history details

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// ChangeBootVolumeBackupCompartmentDetails Contains the details for the compartment to move the boot volume backup to. // ChangeBootVolumeBackupCompartmentDetails Contains the details for the compartment to move the boot volume backup to.

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// ChangeBootVolumeBackupCompartmentRequest wrapper for the ChangeBootVolumeBackupCompartment operation // ChangeBootVolumeBackupCompartmentRequest wrapper for the ChangeBootVolumeBackupCompartment operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/ChangeBootVolumeBackupCompartment.go.html to see an example of how to use ChangeBootVolumeBackupCompartmentRequest.
type ChangeBootVolumeBackupCompartmentRequest struct { type ChangeBootVolumeBackupCompartmentRequest struct {
// The OCID of the boot volume backup. // The OCID of the boot volume backup.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// ChangeBootVolumeCompartmentDetails Contains the details for the compartment to move the boot volume to. // ChangeBootVolumeCompartmentDetails Contains the details for the compartment to move the boot volume to.

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// ChangeBootVolumeCompartmentRequest wrapper for the ChangeBootVolumeCompartment operation // ChangeBootVolumeCompartmentRequest wrapper for the ChangeBootVolumeCompartment operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/ChangeBootVolumeCompartment.go.html to see an example of how to use ChangeBootVolumeCompartmentRequest.
type ChangeBootVolumeCompartmentRequest struct { type ChangeBootVolumeCompartmentRequest struct {
// The OCID of the boot volume. // The OCID of the boot volume.

View File

@ -0,0 +1,29 @@
// Copyright (c) 2016, 2018, 2021, 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.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"github.com/oracle/oci-go-sdk/v36/common"
)
// ChangeByoipRangeCompartmentDetails The configuration details for the move operation.
type ChangeByoipRangeCompartmentDetails struct {
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the destination compartment for the BYOIP CIDR block move.
CompartmentId *string `mandatory:"true" json:"compartmentId"`
}
func (m ChangeByoipRangeCompartmentDetails) String() string {
return common.PointerString(m)
}

View File

@ -0,0 +1,73 @@
// Copyright (c) 2016, 2018, 2021, 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 core
import (
"github.com/oracle/oci-go-sdk/v36/common"
"net/http"
)
// ChangeByoipRangeCompartmentRequest wrapper for the ChangeByoipRangeCompartment operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/ChangeByoipRangeCompartment.go.html to see an example of how to use ChangeByoipRangeCompartmentRequest.
type ChangeByoipRangeCompartmentRequest struct {
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the `ByoipRange` resource containing the BYOIP CIDR block.
ByoipRangeId *string `mandatory:"true" contributesTo:"path" name:"byoipRangeId"`
// Request to change the compartment of a BYOIP CIDR block.
ChangeByoipRangeCompartmentDetails `contributesTo:"body"`
// Unique identifier for the request.
// If you need to contact Oracle about a particular request, please provide the request ID.
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
// may 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 ChangeByoipRangeCompartmentRequest) String() string {
return common.PointerString(request)
}
// HTTPRequest implements the OCIRequest interface
func (request ChangeByoipRangeCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) {
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
}
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (request ChangeByoipRangeCompartmentRequest) RetryPolicy() *common.RetryPolicy {
return request.RequestMetadata.RetryPolicy
}
// ChangeByoipRangeCompartmentResponse wrapper for the ChangeByoipRangeCompartment operation
type ChangeByoipRangeCompartmentResponse struct {
// The underlying http response
RawResponse *http.Response
// 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 ChangeByoipRangeCompartmentResponse) String() string {
return common.PointerString(response)
}
// HTTPResponse implements the OCIResponse interface
func (response ChangeByoipRangeCompartmentResponse) HTTPResponse() *http.Response {
return response.RawResponse
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// ChangeClusterNetworkCompartmentDetails The configuration details for the move operation. // ChangeClusterNetworkCompartmentDetails The configuration details for the move operation.

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// ChangeClusterNetworkCompartmentRequest wrapper for the ChangeClusterNetworkCompartment operation // ChangeClusterNetworkCompartmentRequest wrapper for the ChangeClusterNetworkCompartment operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/ChangeClusterNetworkCompartment.go.html to see an example of how to use ChangeClusterNetworkCompartmentRequest.
type ChangeClusterNetworkCompartmentRequest struct { type ChangeClusterNetworkCompartmentRequest struct {
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster network. // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster network.
@ -19,7 +23,7 @@ type ChangeClusterNetworkCompartmentRequest struct {
ChangeClusterNetworkCompartmentDetails `contributesTo:"body"` ChangeClusterNetworkCompartmentDetails `contributesTo:"body"`
// For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // 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 // 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. // 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"` IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"`

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
@ -14,7 +14,7 @@
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
) )
// ChangeComputeImageCapabilitySchemaCompartmentDetails The configuration details for the move operation. // ChangeComputeImageCapabilitySchemaCompartmentDetails The configuration details for the move operation.

View File

@ -1,15 +1,19 @@
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2016, 2018, 2021, 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. // 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. // Code generated. DO NOT EDIT.
package core package core
import ( import (
"github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/v36/common"
"net/http" "net/http"
) )
// ChangeComputeImageCapabilitySchemaCompartmentRequest wrapper for the ChangeComputeImageCapabilitySchemaCompartment operation // ChangeComputeImageCapabilitySchemaCompartmentRequest wrapper for the ChangeComputeImageCapabilitySchemaCompartment operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/ChangeComputeImageCapabilitySchemaCompartment.go.html to see an example of how to use ChangeComputeImageCapabilitySchemaCompartmentRequest.
type ChangeComputeImageCapabilitySchemaCompartmentRequest struct { type ChangeComputeImageCapabilitySchemaCompartmentRequest struct {
// The id of the compute image capability schema or the image ocid // The id of the compute image capability schema or the image ocid
@ -19,7 +23,7 @@ type ChangeComputeImageCapabilitySchemaCompartmentRequest struct {
ChangeComputeImageCapabilitySchemaCompartmentDetails `contributesTo:"body"` ChangeComputeImageCapabilitySchemaCompartmentDetails `contributesTo:"body"`
// For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // 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 // 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. // 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"` IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"`

Some files were not shown because too many files have changed in this diff Show More