oci

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceTypeCompartment        = "compartment"
	ResourceTypeAvailabilityDomain = "availabilityDomain"
	ResourceTypeShape              = "shape"
	ResourceTypeImage              = "image"
	ResourceTypeSubnet             = "subnet"
	ResourceTypeBlockVolume        = "blockVolume"
)
View Source
const (
	ComputeInstancePayloadType = "oci.computeInstanceCreated"
)
View Source
const (
	OnComputeInstanceCreatedPayloadType = "oci.onComputeInstanceCreated"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AvailabilityDomain

type AvailabilityDomain struct {
	Name          string `json:"name"`
	CompartmentID string `json:"compartmentId"`
}

type BlockVolume

type BlockVolume struct {
	ID             string `json:"id"`
	DisplayName    string `json:"displayName"`
	LifecycleState string `json:"lifecycleState"`
	SizeInGBs      int    `json:"sizeInGBs"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an OCI REST API client that signs requests using OCI API Key authentication.

func NewClient

func NewClient(httpCtx core.HTTPContext, integration core.IntegrationContext) (*Client, error)

func (*Client) AttachVolume

func (c *Client) AttachVolume(instanceID, volumeID string) (*VolumeAttachment, error)

AttachVolume attaches an existing block volume to a running instance using paravirtualised attachment.

func (*Client) CreateEventsRule

func (c *Client) CreateEventsRule(compartmentID, displayName, condition, topicID string) (*EventsRule, error)

CreateEventsRule creates an OCI Events rule that routes matching events to an ONS topic.

func (*Client) CreateONSSubscription

func (c *Client) CreateONSSubscription(compartmentID, topicID, endpoint string) (*ONSSubscription, error)

CreateONSSubscription creates an HTTPS subscription on an OCI Notifications topic.

func (*Client) CreateONSTopic

func (c *Client) CreateONSTopic(compartmentID, name string) (*ONSTopic, error)

CreateONSTopic creates a new OCI Notifications topic.

func (*Client) DeleteEventsRule

func (c *Client) DeleteEventsRule(ruleID string) error

DeleteEventsRule deletes an OCI Events rule by its OCID.

func (*Client) DeleteONSSubscription

func (c *Client) DeleteONSSubscription(subscriptionID string) error

DeleteONSSubscription deletes an OCI Notifications subscription by its OCID.

func (*Client) DeleteONSTopic

func (c *Client) DeleteONSTopic(topicID string) error

DeleteONSTopic deletes an OCI Notifications topic by its OCID. Deleting the topic also removes all its subscriptions.

func (*Client) GetInstance

func (c *Client) GetInstance(instanceID string) (*Instance, error)

GetInstance retrieves a Compute instance by OCID.

func (*Client) GetVNIC

func (c *Client) GetVNIC(vnicID string) (*VNIC, error)

GetVNIC retrieves a VNIC by OCID to obtain IP addresses.

func (*Client) LaunchInstance

func (c *Client) LaunchInstance(req LaunchInstanceRequest) (*Instance, error)

LaunchInstance starts a new OCI Compute instance.

func (*Client) ListAvailabilityDomains

func (c *Client) ListAvailabilityDomains(compartmentID string) ([]AvailabilityDomain, error)

func (*Client) ListBlockVolumes

func (c *Client) ListBlockVolumes(compartmentID string) ([]BlockVolume, error)

func (*Client) ListCompartments

func (c *Client) ListCompartments() ([]Compartment, error)

func (*Client) ListImages

func (c *Client) ListImages(compartmentID, operatingSystem string) ([]Image, error)

func (*Client) ListShapes

func (c *Client) ListShapes(compartmentID string) ([]Shape, error)

func (*Client) ListSubnets

func (c *Client) ListSubnets(compartmentID string) ([]Subnet, error)

func (*Client) ListVNICAttachments

func (c *Client) ListVNICAttachments(compartmentID, instanceID string) ([]VNICAttachment, error)

ListVNICAttachments lists VNIC attachments for an instance, used to find IP addresses.

func (*Client) ValidateCredentials

func (c *Client) ValidateCredentials() error

ValidateCredentials validates the OCI credentials by fetching the current user.

type Compartment

type Compartment struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	LifecycleState string `json:"lifecycleState"`
}

type ConfidentialInstanceOptions

type ConfidentialInstanceOptions struct {
	IsEnabled bool `json:"isEnabled"`
}

type Configuration

type Configuration struct {
	TenancyOCID string `json:"tenancyOcid" mapstructure:"tenancyOcid"`
	UserOCID    string `json:"userOcid" mapstructure:"userOcid"`
	Fingerprint string `json:"fingerprint" mapstructure:"fingerprint"`
	PrivateKey  string `json:"privateKey" mapstructure:"privateKey"`
	Region      string `json:"region" mapstructure:"region"`
}

type CreateComputeInstance

type CreateComputeInstance struct{}

func (*CreateComputeInstance) Cancel

func (*CreateComputeInstance) Cleanup

func (c *CreateComputeInstance) Cleanup(ctx core.SetupContext) error

func (*CreateComputeInstance) Color

func (c *CreateComputeInstance) Color() string

func (*CreateComputeInstance) Configuration

func (c *CreateComputeInstance) Configuration() []configuration.Field

func (*CreateComputeInstance) Description

func (c *CreateComputeInstance) Description() string

func (*CreateComputeInstance) Documentation

func (c *CreateComputeInstance) Documentation() string

func (*CreateComputeInstance) ExampleOutput

func (c *CreateComputeInstance) ExampleOutput() map[string]any

func (*CreateComputeInstance) Execute

func (*CreateComputeInstance) HandleHook

func (*CreateComputeInstance) HandleWebhook

func (*CreateComputeInstance) Hooks

func (c *CreateComputeInstance) Hooks() []core.Hook

func (*CreateComputeInstance) Icon

func (c *CreateComputeInstance) Icon() string

func (*CreateComputeInstance) Label

func (c *CreateComputeInstance) Label() string

func (*CreateComputeInstance) Name

func (c *CreateComputeInstance) Name() string

func (*CreateComputeInstance) OutputChannels

func (c *CreateComputeInstance) OutputChannels(configuration any) []core.OutputChannel

func (*CreateComputeInstance) ProcessQueueItem

func (c *CreateComputeInstance) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*CreateComputeInstance) Setup

type CreateComputeInstanceSpec

type CreateComputeInstanceSpec struct {
	CompartmentID               string   `json:"compartmentId" mapstructure:"compartmentId"`
	AvailabilityDomain          string   `json:"availabilityDomain" mapstructure:"availabilityDomain"`
	DisplayName                 string   `json:"displayName" mapstructure:"displayName"`
	ImageOs                     string   `json:"imageOs" mapstructure:"imageOs"`
	Shape                       string   `json:"shape" mapstructure:"shape"`
	ImageID                     string   `json:"imageId" mapstructure:"imageId"`
	SubnetID                    string   `json:"subnetId" mapstructure:"subnetId"`
	SSHPublicKey                string   `json:"sshPublicKey" mapstructure:"sshPublicKey"`
	OCPUs                       *float64 `json:"ocpus" mapstructure:"ocpus"`
	MemoryInGBs                 *float64 `json:"memoryInGBs" mapstructure:"memoryInGBs"`
	EnableShieldedInstance      bool     `json:"enableShieldedInstance" mapstructure:"enableShieldedInstance"`
	EnableConfidentialComputing bool     `json:"enableConfidentialComputing" mapstructure:"enableConfidentialComputing"`
	BootVolumeSizeGB            *float64 `json:"bootVolumeSizeGB" mapstructure:"bootVolumeSizeGB"`
	BootVolumeVpusPerGB         *float64 `json:"bootVolumeVpusPerGB" mapstructure:"bootVolumeVpusPerGB"`
	AttachBlockVolume           bool     `json:"attachBlockVolume" mapstructure:"attachBlockVolume"`
	BlockVolumeID               string   `json:"blockVolumeId" mapstructure:"blockVolumeId"`
}

type CreateInstanceExecutionMetadata

type CreateInstanceExecutionMetadata struct {
	InstanceID              string `json:"instanceId" mapstructure:"instanceId"`
	CompartmentID           string `json:"compartmentId" mapstructure:"compartmentId"`
	BlockVolumeID           string `json:"blockVolumeId" mapstructure:"blockVolumeId"`
	BlockVolumeAttachmentID string `json:"blockVolumeAttachmentId" mapstructure:"blockVolumeAttachmentId"`
	PollErrors              int    `json:"pollErrors" mapstructure:"pollErrors"`
	PollAttempts            int    `json:"pollAttempts" mapstructure:"pollAttempts"`
	StartedAt               string `json:"startedAt" mapstructure:"startedAt"`
}

type CreateVnicDetails

type CreateVnicDetails struct {
	SubnetID string `json:"subnetId"`
}

type EventsRule

type EventsRule struct {
	ID             string `json:"id"`
	DisplayName    string `json:"displayName"`
	LifecycleState string `json:"lifecycleState"`
}

type Image

type Image struct {
	ID             string `json:"id"`
	DisplayName    string `json:"displayName"`
	LifecycleState string `json:"lifecycleState"`
}

type Instance

type Instance struct {
	ID                 string `json:"id"`
	DisplayName        string `json:"displayName"`
	LifecycleState     string `json:"lifecycleState"`
	Shape              string `json:"shape"`
	AvailabilityDomain string `json:"availabilityDomain"`
	CompartmentID      string `json:"compartmentId"`
	Region             string `json:"region"`
	TimeCreated        string `json:"timeCreated"`
}

type InstanceShapeConfig

type InstanceShapeConfig struct {
	OCPUs       *float64 `json:"ocpus,omitempty"`
	MemoryInGBs *float64 `json:"memoryInGBs,omitempty"`
}

type InstanceSourceDetails

type InstanceSourceDetails struct {
	SourceType          string   `json:"sourceType"`
	ImageID             string   `json:"imageId"`
	BootVolumeSizeInGBs *float64 `json:"bootVolumeSizeInGBs,omitempty"`
	BootVolumeVpusPerGB *float64 `json:"bootVolumeVpusPerGB,omitempty"`
}

type IntegrationMetadata

type IntegrationMetadata struct {
	TopicID string `json:"topicId" mapstructure:"topicId"`
}

IntegrationMetadata holds resources created during integration setup.

type LaunchInstanceRequest

type LaunchInstanceRequest struct {
	CompartmentID               string                       `json:"compartmentId"`
	AvailabilityDomain          string                       `json:"availabilityDomain"`
	DisplayName                 string                       `json:"displayName,omitempty"`
	Shape                       string                       `json:"shape"`
	SourceDetails               InstanceSourceDetails        `json:"sourceDetails"`
	CreateVnicDetails           *CreateVnicDetails           `json:"createVnicDetails,omitempty"`
	Metadata                    map[string]string            `json:"metadata,omitempty"`
	ShapeConfig                 *InstanceShapeConfig         `json:"shapeConfig,omitempty"`
	ShieldedInstanceConfig      *ShieldedInstanceConfig      `json:"shieldedInstanceConfig,omitempty"`
	ConfidentialInstanceOptions *ConfidentialInstanceOptions `json:"confidentialInstanceOptions,omitempty"`
}

type OCI

type OCI struct{}

func (*OCI) Actions

func (o *OCI) Actions() []core.Action

func (*OCI) Cleanup

func (o *OCI) Cleanup(ctx core.IntegrationCleanupContext) error

func (*OCI) Configuration

func (o *OCI) Configuration() []configuration.Field

func (*OCI) Description

func (o *OCI) Description() string

func (*OCI) HandleHook

func (o *OCI) HandleHook(ctx core.IntegrationHookContext) error

func (*OCI) HandleRequest

func (o *OCI) HandleRequest(ctx core.HTTPRequestContext)

func (*OCI) Hooks

func (o *OCI) Hooks() []core.Hook

func (*OCI) Icon

func (o *OCI) Icon() string

func (*OCI) Instructions

func (o *OCI) Instructions() string

func (*OCI) Label

func (o *OCI) Label() string

func (*OCI) ListResources

func (o *OCI) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*OCI) Name

func (o *OCI) Name() string

func (*OCI) Sync

func (o *OCI) Sync(ctx core.SyncContext) error

func (*OCI) Triggers

func (o *OCI) Triggers() []core.Trigger

type ONSSubscription

type ONSSubscription struct {
	ID             string `json:"id"`
	TopicID        string `json:"topicId"`
	Protocol       string `json:"protocol"`
	Endpoint       string `json:"endpoint"`
	LifecycleState string `json:"lifecycleState"`
}

type ONSTopic

type ONSTopic struct {
	TopicID        string `json:"topicId"`
	Name           string `json:"name"`
	LifecycleState string `json:"lifecycleState"`
}

type OnComputeInstanceCreated

type OnComputeInstanceCreated struct{}

func (*OnComputeInstanceCreated) Cleanup

func (*OnComputeInstanceCreated) Color

func (t *OnComputeInstanceCreated) Color() string

func (*OnComputeInstanceCreated) Configuration

func (t *OnComputeInstanceCreated) Configuration() []configuration.Field

func (*OnComputeInstanceCreated) Description

func (t *OnComputeInstanceCreated) Description() string

func (*OnComputeInstanceCreated) Documentation

func (t *OnComputeInstanceCreated) Documentation() string

func (*OnComputeInstanceCreated) ExampleData

func (t *OnComputeInstanceCreated) ExampleData() map[string]any

func (*OnComputeInstanceCreated) HandleHook

func (t *OnComputeInstanceCreated) HandleHook(ctx core.TriggerHookContext) (map[string]any, error)

func (*OnComputeInstanceCreated) HandleWebhook

HandleWebhook processes inbound requests forwarded by OCI Notifications.

func (*OnComputeInstanceCreated) Hooks

func (t *OnComputeInstanceCreated) Hooks() []core.Hook

func (*OnComputeInstanceCreated) Icon

func (t *OnComputeInstanceCreated) Icon() string

func (*OnComputeInstanceCreated) Label

func (t *OnComputeInstanceCreated) Label() string

func (*OnComputeInstanceCreated) Name

func (t *OnComputeInstanceCreated) Name() string

func (*OnComputeInstanceCreated) Setup

type OnComputeInstanceCreatedConfiguration

type OnComputeInstanceCreatedConfiguration struct {
	CompartmentID string `json:"compartmentId" mapstructure:"compartmentId"`
}

type OnComputeInstanceCreatedMetadata

type OnComputeInstanceCreatedMetadata struct {
	CompartmentID string `json:"compartmentId" mapstructure:"compartmentId"`
	EventsRuleID  string `json:"eventsRuleId" mapstructure:"eventsRuleId"`
}

type Shape

type Shape struct {
	Shape string `json:"shape"`
}

type ShieldedInstanceConfig

type ShieldedInstanceConfig struct {
	IsSecureBootEnabled            bool `json:"isSecureBootEnabled"`
	IsMeasuredBootEnabled          bool `json:"isMeasuredBootEnabled"`
	IsTrustedPlatformModuleEnabled bool `json:"isTrustedPlatformModuleEnabled"`
}

type Subnet

type Subnet struct {
	ID             string `json:"id"`
	DisplayName    string `json:"displayName"`
	CIDRBlock      string `json:"cidrBlock"`
	LifecycleState string `json:"lifecycleState"`
}

type VNIC

type VNIC struct {
	ID        string `json:"id"`
	PublicIP  string `json:"publicIp"`
	PrivateIP string `json:"privateIp"`
}

type VNICAttachment

type VNICAttachment struct {
	VNICID         string `json:"vnicId"`
	SubnetID       string `json:"subnetId"`
	LifecycleState string `json:"lifecycleState"`
}

type VolumeAttachment

type VolumeAttachment struct {
	ID             string `json:"id"`
	InstanceID     string `json:"instanceId"`
	VolumeID       string `json:"volumeId"`
	LifecycleState string `json:"lifecycleState"`
	Device         string `json:"device"`
}

type WebhookConfiguration

type WebhookConfiguration struct {
	// CompartmentID is used when creating the ONS subscription (required by OCI).
	CompartmentID string `json:"compartmentId" mapstructure:"compartmentId"`
	// TopicID is the OCID of the ONS topic to subscribe to.
	TopicID string `json:"topicId" mapstructure:"topicId"`
}

WebhookConfiguration is stored on each OCI webhook record so the handler knows which ONS topic to subscribe / unsubscribe.

type WebhookHandler

type WebhookHandler struct{}

func (*WebhookHandler) Cleanup

Cleanup deletes the ONS subscription created during Setup.

func (*WebhookHandler) CompareConfig

func (h *WebhookHandler) CompareConfig(a, b any) (bool, error)

CompareConfig returns true when both configs point to the same ONS topic.

func (*WebhookHandler) Merge

func (h *WebhookHandler) Merge(current, requested any) (any, bool, error)

Merge returns the requested config unchanged (no merging needed for OCI webhooks).

func (*WebhookHandler) Setup

Setup creates an HTTPS subscription on the configured OCI Notifications topic, pointing to the SuperPlane-generated webhook URL.

type WebhookMetadata

type WebhookMetadata struct {
	SubscriptionID string `json:"subscriptionId" mapstructure:"subscriptionId"`
}

WebhookMetadata is persisted after a successful subscription and used during cleanup.

Jump to

Keyboard shortcuts

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