oci

package
v0.0.0-...-9fc8b42 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: UPL-1.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchitectureFromShape

func ArchitectureFromShape(shape string) string

func CreateEFIImageSchema

func CreateEFIImageSchema(compartmentId string, imageId string) error

func EnsureCompatibleImageShapes

func EnsureCompatibleImageShapes(imageId string, arch string) error

EnsureCompatibleImageShapes ensures that the image has the correct list of compatible image shapes, based on the image architecture.

func EnsureImage

func EnsureImage(imageName string, k8sVersion string, arch string, compartmentId string, bucketName string, objectName string) (string, string, error)

EnsureImage makes sure that an image with a given display name exists. If it already does, then it returns the OCID of that image. If not, it will start the process of importing the image from the given object storage description. A work request OCID is returned to as well to allow the caller to monitor pogress.

func EnsureObject

func EnsureObject(bucketName string, objectName string, contentLen int64, content io.ReadCloser, metadata map[string]string) error

EnsureObject ensures that an object exists in object storage and that the object is the same as the one that is desired. If the object exists and is the same, then the function simply returns. If not, it uploads the object to the given bucket and object name.

func GetCompartmentId

func GetCompartmentId(compartmentName string) (string, error)

Takes a path to a compartment name in the format compartment1/compartment2/compartment3 and locates the OCID of the indicated compartment by following the path.

func GetImage

func GetImage(imageName string, k8sVersion string, arch string, compartmentId string) (*core.Image, bool, error)

GetImage fetches the OCID of the latest image by name, Kubernetes version, and architecture.

func GetImageById

func GetImageById(ocid string) (*core.Image, error)

func GetNamespace

func GetNamespace() (string, error)

GetNamespace returns the object storage namespace for this tenancy

func GetWorkRequestStatus

func GetWorkRequestStatus(workRequestId string) (workrequests.WorkRequestStatusEnum, float32, error)

GetWorkRequestStatus gives a summary of a work request. Specifically, it returns the current status and completion percentage.

func ImportImage

func ImportImage(imageName string, k8sVersion string, arch string, compartmentId string, bucketName string, objectName string) (string, string, error)

ImportImage creates a custom compute image from the contents of an object storage bucket.

func UploadObject

func UploadObject(bucketName string, objectName string, contentLen int64, content io.ReadCloser, metadata map[string]string) error

UploadObject uploads the contents of a stream to an object storage bucket

func WaitForWorkRequest

func WaitForWorkRequest(workRequestId string, prefix string) error

WaitForWorkRequest waits for a work request to complete, while pretty printing the progress. If the work request fails, then an error is returned.

func WaitForWorkRequests

func WaitForWorkRequests(requests map[string]string) error

WaitForWorkRequestswaits for a set of work requests, to complete, while pretty printing the progress. If any work requests fail, an error is returned.

Types

type OciConfig

type OciConfig struct {
	Name                 string
	Fingerprint          string
	Key                  string
	Passphrase           string
	Region               string
	Tenancy              string
	UseInstancePrincipal bool
	User                 string
}

func GetConfig

func GetConfig() (*OciConfig, error)

Jump to

Keyboard shortcuts

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