resources

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForUniqueBastion

func CheckForUniqueBastion(bastions map[string]string) (string, string)

Determine bastion name and then lookup ID

func CreateBastionSession

func CreateBastionSession(bastionClient bastion.BastionClient, bastionId string, sessionType string, publicKeyContent string, targetIp string, sshPort int, hostFwPort int, sessionTtl int, targetInstanceId string, sshUser string) *string

Create a port forward SSH bastion session

func FetchBastions

func FetchBastions(compartmentId string, client bastion.BastionClient) map[string]string

Fetch all bastions via OCI API call

func FetchClusterId

func FetchClusterId(containerEngineClient containerengine.ContainerEngineClient, compartmentId string, clusterName string) string

func FetchCompartments

func FetchCompartments(tenancyId string, identityClient identity.IdentityClient) map[string]string

Fetch compartments (names/IDs) from OCI

func FindCompartments

func FindCompartments(tenancyId string, tenancyName string, identityClient identity.IdentityClient, namePattern string)

func FindInstances

func FindInstances(computeClient core.ComputeClient, vnetClient core.VirtualNetworkClient, compartmentId string, flagSearchString string, retrieveImageInfo bool, compartment string, tenancyName string)

Find and print instances (OCI API call) TODO: Consider consolidating FindInstances and ListInstances similar to OKE

func FindPolicies

func FindPolicies(identityClient identity.IdentityClient, compartmentId string, flagPolicyFind string, flagPolicyFindStatement string, flagPolicyListNameOnly bool)

Find and print policies (OCI API call)

func ListBastionSessions

func ListBastionSessions(bastionClient bastion.BastionClient, bastionId string, tenancyName string, compartmentName string, listOnlyActiveSessions bool)

List and print all active bastion sessions

func ListBastions

func ListBastions(bastions map[string]string, tenancyName string, compartmentName string)

List and print bastions (OCI API call)

func ListCompartments

func ListCompartments(compartments map[string]string, tenancyId string, tenancyName string)

Sort, list, and print compartments

func ListImages

func ListImages(computeClient core.ComputeClient, compartmentId string, compartment string, tenancyName string)

List and print images (OCI API call)

func ListInstances

func ListInstances(computeClient core.ComputeClient, compartmentId string, vnetClient core.VirtualNetworkClient, retrieveImageInfo bool, compartment string, tenancyName string)

List and print instances (OCI API call)

func ListPolicies

func ListPolicies(identityClient identity.IdentityClient, compartmentId string, flagPolicyListNameOnly bool)

List and print policies (OCI API call)

func ListSubnets

func ListSubnets(client core.VirtualNetworkClient, compartmentId string)

List and print subnets (OCI API call)

func LookupCompartmentId

func LookupCompartmentId(compartments map[string]string, tenancyId string, tenancyName string, compartmentName string) string

Determine compartment name or ID, lookup name from ID if ID is given

func PrintClusters

func PrintClusters(clusters []Cluster, tenancyName string, compartmentName string)

Print clusters

func PrintDatabases added in v1.3.0

func PrintDatabases(databases []Database, tenancyName string, compartmentName string)

Print databases

func PrintManagedSshCommands

func PrintManagedSshCommands(bastionClient bastion.BastionClient, sessionId *string, instanceIp string, sshUser string, sshPort int, sshIdentityFile string, localFwPort int, hostFwPort int)

Print SSH commands to connect via bastion

func PrintPortFwSshCommands

func PrintPortFwSshCommands(bastionClient bastion.BastionClient, sessionId *string, targetIp string, sshPort int, sshPrivateKey string, localFwPort int, hostFwPort int, flagOkeId string)

Print port forward SSH commands to connect via bastion

func SetCompartmentName

func SetCompartmentName(compartmentName string)

Sets compartment name in Viper config

Types

type Cluster

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

func FindClusters

func FindClusters(containerEngineClient containerengine.ContainerEngineClient, compartmentId string, searchString string) []Cluster

Find clusters matching search pattern

type Database added in v1.3.0

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

func FindDatabases added in v1.3.0

func FindDatabases(databaseClient database.DatabaseClient, compartmentId string, searchString string) []Database

Find databases matching search pattern

type Image

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

type Instance

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

TODO: Add operating system from image

type Policy

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

type Session

type Session struct {
	State bastion.SessionLifecycleStateEnum
	// contains filtered or unexported fields
}

func FetchSession

func FetchSession(bastionClient bastion.BastionClient, sessionId *string, flagType string) Session

Check status of bastion session

type Subnet

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

Jump to

Keyboard shortcuts

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