oci

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package oci allows you to interact with Oracle Cloud Infrastructure (OCI) resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteImage deprecated

func DeleteImage(t testing.TestingT, ocid string)

DeleteImage deletes a custom image with given OCID.

Deprecated: Use DeleteImageContext instead.

func DeleteImageContext added in v1.0.0

func DeleteImageContext(t testing.TestingT, ctx context.Context, ocid string)

DeleteImageContext deletes a custom image with given OCID. This function will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func DeleteImageContextE added in v1.0.0

func DeleteImageContextE(t testing.TestingT, ctx context.Context, ocid string) error

DeleteImageContextE deletes a custom image with given OCID. The ctx parameter supports cancellation and timeouts.

func DeleteImageE deprecated

func DeleteImageE(t testing.TestingT, ocid string) error

DeleteImageE deletes a custom image with given OCID.

Deprecated: Use DeleteImageContextE instead.

func GetAllAvailabilityDomains deprecated

func GetAllAvailabilityDomains(t testing.TestingT, compartmentID string) []string

GetAllAvailabilityDomains gets the list of availability domains available in the given compartment.

Deprecated: Use GetAllAvailabilityDomainsContext instead.

func GetAllAvailabilityDomainsContext added in v1.0.0

func GetAllAvailabilityDomainsContext(t testing.TestingT, ctx context.Context, compartmentID string) []string

GetAllAvailabilityDomainsContext gets the list of availability domains available in the given compartment. This function will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetAllAvailabilityDomainsContextE added in v1.0.0

func GetAllAvailabilityDomainsContextE(t testing.TestingT, ctx context.Context, compartmentID string) ([]string, error)

GetAllAvailabilityDomainsContextE gets the list of availability domains available in the given compartment. The ctx parameter supports cancellation and timeouts.

func GetAllAvailabilityDomainsE deprecated

func GetAllAvailabilityDomainsE(t testing.TestingT, compartmentID string) ([]string, error)

GetAllAvailabilityDomainsE gets the list of availability domains available in the given compartment.

Deprecated: Use GetAllAvailabilityDomainsContextE instead.

func GetAllVcnIDs deprecated

func GetAllVcnIDs(t testing.TestingT, compartmentID string) []string

GetAllVcnIDs gets the list of VCNs available in the given compartment.

Deprecated: Use GetAllVcnIDsContext instead.

func GetAllVcnIDsContext added in v1.0.0

func GetAllVcnIDsContext(t testing.TestingT, ctx context.Context, compartmentID string) []string

GetAllVcnIDsContext gets the list of VCNs available in the given compartment. This function will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetAllVcnIDsContextE added in v1.0.0

func GetAllVcnIDsContextE(t testing.TestingT, ctx context.Context, compartmentID string) ([]string, error)

GetAllVcnIDsContextE gets the list of VCNs available in the given compartment. The ctx parameter supports cancellation and timeouts.

func GetAllVcnIDsE deprecated

func GetAllVcnIDsE(t testing.TestingT, compartmentID string) ([]string, error)

GetAllVcnIDsE gets the list of VCNs available in the given compartment.

Deprecated: Use GetAllVcnIDsContextE instead.

func GetCompartmentIDFromEnvVar

func GetCompartmentIDFromEnvVar() string

GetCompartmentIDFromEnvVar returns the compartment OCID for use with testing.

func GetMostRecentImageID deprecated

func GetMostRecentImageID(t testing.TestingT, compartmentID string, osName string, osVersion string) string

GetMostRecentImageID gets the OCID of the most recent image in the given compartment that has the given OS name and version.

Deprecated: Use GetMostRecentImageIDContext instead.

func GetMostRecentImageIDContext added in v1.0.0

func GetMostRecentImageIDContext(t testing.TestingT, ctx context.Context, compartmentID string, osName string, osVersion string) string

GetMostRecentImageIDContext gets the OCID of the most recent image in the given compartment that has the given OS name and version. This function will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetMostRecentImageIDContextE added in v1.0.0

func GetMostRecentImageIDContextE(t testing.TestingT, ctx context.Context, compartmentID string, osName string, osVersion string) (string, error)

GetMostRecentImageIDContextE gets the OCID of the most recent image in the given compartment that has the given OS name and version. The ctx parameter supports cancellation and timeouts.

func GetMostRecentImageIDE deprecated

func GetMostRecentImageIDE(t testing.TestingT, compartmentID string, osName string, osVersion string) (string, error)

GetMostRecentImageIDE gets the OCID of the most recent image in the given compartment that has the given OS name and version.

Deprecated: Use GetMostRecentImageIDContextE instead.

func GetPassPhraseFromEnvVar

func GetPassPhraseFromEnvVar() string

GetPassPhraseFromEnvVar returns the pass phrase for use with testing.

func GetRandomAvailabilityDomain deprecated

func GetRandomAvailabilityDomain(t testing.TestingT, compartmentID string) string

GetRandomAvailabilityDomain gets a randomly chosen availability domain for given compartment. The returned value can be overridden by of the environment variable TF_VAR_availability_domain.

Deprecated: Use GetRandomAvailabilityDomainContext instead.

func GetRandomAvailabilityDomainContext added in v1.0.0

func GetRandomAvailabilityDomainContext(t testing.TestingT, ctx context.Context, compartmentID string) string

GetRandomAvailabilityDomainContext gets a randomly chosen availability domain for given compartment. The returned value can be overridden by of the environment variable TF_VAR_availability_domain. This function will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetRandomAvailabilityDomainContextE added in v1.0.0

func GetRandomAvailabilityDomainContextE(t testing.TestingT, ctx context.Context, compartmentID string) (string, error)

GetRandomAvailabilityDomainContextE gets a randomly chosen availability domain for given compartment. The returned value can be overridden by of the environment variable TF_VAR_availability_domain. The ctx parameter supports cancellation and timeouts.

func GetRandomAvailabilityDomainE deprecated

func GetRandomAvailabilityDomainE(t testing.TestingT, compartmentID string) (string, error)

GetRandomAvailabilityDomainE gets a randomly chosen availability domain for given compartment. The returned value can be overridden by of the environment variable TF_VAR_availability_domain.

Deprecated: Use GetRandomAvailabilityDomainContextE instead.

func GetRandomSubnetID deprecated

func GetRandomSubnetID(t testing.TestingT, compartmentID string, availabilityDomain string) string

GetRandomSubnetID gets a randomly chosen subnet OCID in the given availability domain. The returned value can be overridden by of the environment variable TF_VAR_subnet_ocid.

Deprecated: Use GetRandomSubnetIDContext instead.

func GetRandomSubnetIDContext added in v1.0.0

func GetRandomSubnetIDContext(t testing.TestingT, ctx context.Context, compartmentID string, availabilityDomain string) string

GetRandomSubnetIDContext gets a randomly chosen subnet OCID in the given availability domain. The returned value can be overridden by of the environment variable TF_VAR_subnet_ocid. This function will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetRandomSubnetIDContextE added in v1.0.0

func GetRandomSubnetIDContextE(t testing.TestingT, ctx context.Context, compartmentID string, availabilityDomain string) (string, error)

GetRandomSubnetIDContextE gets a randomly chosen subnet OCID in the given availability domain. The returned value can be overridden by of the environment variable TF_VAR_subnet_ocid. The ctx parameter supports cancellation and timeouts.

func GetRandomSubnetIDE deprecated

func GetRandomSubnetIDE(t testing.TestingT, compartmentID string, availabilityDomain string) (string, error)

GetRandomSubnetIDE gets a randomly chosen subnet OCID in the given availability domain. The returned value can be overridden by of the environment variable TF_VAR_subnet_ocid.

Deprecated: Use GetRandomSubnetIDContextE instead.

func GetRootCompartmentID deprecated

func GetRootCompartmentID(t testing.TestingT) string

GetRootCompartmentID gets an OCID of the root compartment (a.k.a. tenancy OCID).

Deprecated: Use GetRootCompartmentIDContext instead.

func GetRootCompartmentIDContext added in v1.0.0

func GetRootCompartmentIDContext(t testing.TestingT, ctx context.Context) string

GetRootCompartmentIDContext gets an OCID of the root compartment (a.k.a. tenancy OCID). This function will fail the test if there is an error. The ctx parameter is accepted for API consistency with other Context functions.

func GetRootCompartmentIDContextE added in v1.0.0

func GetRootCompartmentIDContextE(t testing.TestingT, ctx context.Context) (string, error)

GetRootCompartmentIDContextE gets an OCID of the root compartment (a.k.a. tenancy OCID). The ctx parameter is accepted for API consistency with other Context functions.

func GetRootCompartmentIDE deprecated

func GetRootCompartmentIDE(t testing.TestingT) (string, error)

GetRootCompartmentIDE gets an OCID of the root compartment (a.k.a. tenancy OCID).

Deprecated: Use GetRootCompartmentIDContextE instead.

func GetSubnetIDFromEnvVar

func GetSubnetIDFromEnvVar() string

GetSubnetIDFromEnvVar returns the subnet OCID for use with testing.

Types

type NoAvailabilityDomainsFoundError added in v1.0.0

type NoAvailabilityDomainsFoundError struct {
	CompartmentID string
}

NoAvailabilityDomainsFoundError is an error that occurs when no availability domains are found in a compartment.

func (NoAvailabilityDomainsFoundError) Error added in v1.0.0

type NoImagesFoundError added in v1.0.0

type NoImagesFoundError struct {
	OSName        string
	OSVersion     string
	CompartmentID string
}

NoImagesFoundError is an error that occurs when no images matching the given criteria are found in a compartment.

func (NoImagesFoundError) Error added in v1.0.0

func (err NoImagesFoundError) Error() string

type NoVCNsFoundError added in v1.0.0

type NoVCNsFoundError struct {
	CompartmentID string
}

NoVCNsFoundError is an error that occurs when no VCNs are found in a compartment.

func (NoVCNsFoundError) Error added in v1.0.0

func (err NoVCNsFoundError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL