Documentation
¶
Index ¶
- type Client
- func (c *Client) CreateSecurityList(securityList *SecurityList) (bool, *bmc.Error)
- func (c *Client) DeleteSecurityList(securityListID string) (bool, *bmc.Error)
- func (c *Client) GetInstance(instanceID string) (Instance, *bmc.Error)
- func (c *Client) GetSecurityList(securityListID string) (SecurityList, *bmc.Error)
- func (c *Client) GetSubnet(subnetID string) (Subnet, *bmc.Error)
- func (c *Client) GetVNic(vnicID string) (VNic, *bmc.Error)
- func (c *Client) GetVNicAttachment(vNicAttachmentID string) (VNicAttachment, *bmc.Error)
- func (c *Client) GetVcn(vcnID string) (VCN, *bmc.Error)
- func (c *Client) ListInstances(options *InstancesParameters) ([]Instance, error)
- func (c *Client) ListSecurityLists(vcnID string) ([]SecurityList, *bmc.Error)
- func (c *Client) ListSubnets() ([]Subnet, *bmc.Error)
- func (c *Client) ListVNic(instanceID string) []VNic
- func (c *Client) ListVNicAttachments(instanceID string) ([]VNicAttachment, *bmc.Error)
- func (c *Client) ListVcns() ([]VCN, *bmc.Error)
- func (c *Client) Request(method string, reqURL string, body interface{}) (*http.Response, error)
- func (c *Client) UpdateSecurityList(securityListID string, securityListUpdate *SecurityListUpdate) (bool, *bmc.Error)
- type EgressSecurityRule
- type IcmpOption
- type IngressSecurityRule
- type Instance
- type InstanceFilter
- type InstancesParameters
- type PortConfig
- type PortRange
- type SecurityList
- type SecurityListUpdate
- type Subnet
- type VCN
- type VNic
- type VNicAttachment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a client for the core services API.
func (*Client) CreateSecurityList ¶
func (c *Client) CreateSecurityList(securityList *SecurityList) (bool, *bmc.Error)
CreateSecurityList creates a new security list for the specified VCN
func (*Client) DeleteSecurityList ¶
DeleteSecurityList deletes the specified security list, but only if it's not associated with a subnet
func (*Client) GetInstance ¶
GetInstance returns a struct of an instance request given an instance ID
func (*Client) GetSecurityList ¶
func (c *Client) GetSecurityList(securityListID string) (SecurityList, *bmc.Error)
GetSecurityList returns a struct of a SecurityList request given an SecurityList ID
func (*Client) GetVNicAttachment ¶
func (c *Client) GetVNicAttachment(vNicAttachmentID string) (VNicAttachment, *bmc.Error)
GetVNicAttachment returns a struct of a VNicAttachment request given an VNicAttachment ID
func (*Client) ListInstances ¶
func (c *Client) ListInstances(options *InstancesParameters) ([]Instance, error)
ListInstances returns a slice struct of all instance
func (*Client) ListSecurityLists ¶
func (c *Client) ListSecurityLists(vcnID string) ([]SecurityList, *bmc.Error)
ListSecurityLists returns a slice struct of all securityList
func (*Client) ListSubnets ¶
ListSubnets returns a slice struct of all subnet
func (*Client) ListVNicAttachments ¶
func (c *Client) ListVNicAttachments(instanceID string) ([]VNicAttachment, *bmc.Error)
ListVNicAttachments returns a slice struct of all instance
func (*Client) Request ¶
Request builds the API endpoint given a URL and sends it to the API request
func (*Client) UpdateSecurityList ¶
func (c *Client) UpdateSecurityList(securityListID string, securityListUpdate *SecurityListUpdate) (bool, *bmc.Error)
UpdateSecurityList creates a new security list for the specified VCN
type EgressSecurityRule ¶
type EgressSecurityRule struct {
Destination string `json:"destination"`
IcmpOptions *IcmpOption `json:"icmpOptions,omitempty"`
IsStateless bool `json:"isStateless,omitempty"`
// Protocol values: all, ICMP ("1"), TCP ("6"), UDP ("17").
Protocol string `json:"protocol"`
TCPOptions *PortConfig `json:"tcpOptions,omitempty"`
UDPOptions *PortConfig `json:"udpOptions,omitempty"`
}
EgressSecurityRule rule for allowing outbound IP packets
type IcmpOption ¶
type IcmpOption struct {
// The ICMP code
Code int `json:"code,omitempty"`
// The ICMP type
Type int `json:"type,omitempty"`
}
IcmpOption settings for ICMP
type IngressSecurityRule ¶
type IngressSecurityRule struct {
Source string `json:"source"`
IcmpOptions *IcmpOption `json:"icmpOptions,omitempty"`
IsStateless bool `json:"isStateless,omitempty"`
// Protocol values: all, ICMP ("1"), TCP ("6"), UDP ("17").
Protocol string `json:"protocol"`
TCPOptions *PortConfig `json:"tcpOptions,omitempty"`
UDPOptions *PortConfig `json:"udpOptions,omitempty"`
}
IngressSecurityRule rule for allowing inbound IP packets
type Instance ¶
type Instance struct {
// The Availability Domain the instance is running in
AvailabilityDomain string `json:"availabilityDomain"`
// The OCID of the compartment that contains the instance
CompartmentID string `json:"compartmentId"`
// A user-friendly name
DisplayName string `json:"displayName"`
// Additional metadata key/value pairs that you provide
ExtendedMetadata *json.RawMessage
// The OCID of the instance
ID string `json:"id"`
// The image used to boot the instance
ImageID string `json:"imageId"`
// iPXE script to continue the boot process.
IpxeScript string `json:"ipxeScript"`
// The current state of the instance.
// PROVISIONING | RUNNING | STARTING |
// STOPPING | STOPPED | CREATING_IMAGE | TERMINATING | TERMINATED
LifeCycleState string `json:"lifecycleState"`
// Custom metadata that you provide
Metadata struct {
PublicKey string `json:"ssh_authorized_keys"`
UserData string `json:"user_data"`
} `json:"metadata"`
// The region that contains the Availability Domain the instance is running in
Region string `json:"region"`
// The shape of the instance
Shape string `json:"shape"`
// The date and time the instance was created (RFC3339)
TimeCreated string `json:"timeCreated"`
}
Instance contains the instance reference from: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Instance/
type InstanceFilter ¶
InstanceFilter creates a filter for the data (conditional AND) If filter is empty, everything is returned
type InstancesParameters ¶
type InstancesParameters struct {
AvailabilityDomain string `url:"availabilityDomain,omitempty"` //The name of the Availability Domain.
DisplayName string `url:"displayName,omitempty"` //A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
Limit int `url:"limit,omitempty"` //The maximum number of items to return in a paginated "List" call.
Page string `url:"page,omitempty"` //The value of the opc-next-page response header from the previous "List" call
Filter *InstanceFilter
}
InstancesParameters are optional parameters when listing instances
type PortConfig ¶
type PortConfig struct {
DestinationPortRange *PortRange `json:"destinationPortRange,omitempty"`
SourcePortRange *PortRange `json:"sourcePortRange,omitempty"`
}
PortConfig contains port ranges for source and destinations
type SecurityList ¶
type SecurityList struct {
// The OCID of the compartment that contains the security list
CompartmentID string `json:"compartmentId,omitempty"`
// A user-friendly name
DisplayName string `json:"displayName,omitempty"`
// The OCID of the SecurityList
ID string `json:"id,omitempty"`
// Rules for allowing egress IP packets
EgressSecurityRules *[]EgressSecurityRule `json:"egressSecurityRules"`
// Rules for allowing ingress IP packets
IngressSecurityRules *[]IngressSecurityRule `json:"ingressSecurityRules"`
// The SecurityList's current state
LifeCycleState string `json:"lifecycleState,omitempty"`
// The date and time the instance was created (RFC3339)
TimeCreated string `json:"timeCreated,omitempty"`
// The OCID of the VCN
VcnID string `json:"vcnId,omitempty"`
}
SecurityList contains the SecurityList reference from: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/SecurityList/
type SecurityListUpdate ¶
type SecurityListUpdate struct {
// A user-friendly name
DisplayName string `json:"displayName,omitempty"`
// Rules for allowing egress IP packets
EgressSecurityRules *[]EgressSecurityRule `json:"egressSecurityRules"`
// Rules for allowing ingress IP packets
IngressSecurityRules *[]IngressSecurityRule `json:"ingressSecurityRules"`
}
SecurityListUpdate message body for updating security list
type Subnet ¶
type Subnet struct {
// The subnet's Availability Domain
AvailabilityDomain string `json:"availabilityDomain"`
// The subnet's CIDR block
CidrBlock string `json:"cidrBlock"`
// The OCID of the compartment that contains the instance
CompartmentID string `json:"compartmentId"`
// A user-friendly name
DisplayName string `json:"displayName"`
// The OCID of the VNIC
ID string `json:"id"`
// The OCID of the set of DHCP options associated with the subnet
DhcpOptionsID string `json:"dhcpOptionsId"`
// ProhibitPublicIPOnVnic sets whether VNICs within this subnet can have public IP addresses
ProhibitPublicIPOnVnic bool `json:"prohibitPublicIpOnVnic"`
// RouteTableID is the OCID of the route table the subnet is using
RouteTableID string `json:"routeTableId"`
// The Subnet's current state
LifeCycleState string `json:"lifecycleState"`
// A DNS label for the Subnet
DNSlabel string `json:"dnsLabel"`
// The date and time the instance was created (RFC3339)
TimeCreated string `json:"timeCreated"`
// OCIDs for the security lists to use for VNICs in this subnet
SecurityListIDs []string `json:"securityListIds"`
// The OCID of the VNIC
VNicID string `json:"vnicId"`
// The subnet's domain name
SubnetDomainName string `json:"subnetDomainName"`
// The IP address of the virtual router
VirtualRouterIP string `json:"virtualRouterIp"`
// The MAC address of the virtual router
VirtualRouterMac string `json:"virtualRouterMac"`
}
Subnet contains the Subnet reference from: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Subnet/
type VCN ¶
type VCN struct {
// The Availability Domain the instance is running in
CidrBlock string `json:"cidrBlock"`
// The OCID of the compartment that contains the instance
CompartmentID string `json:"compartmentId"`
// A user-friendly name
DisplayName string `json:"displayName"`
// The OCID of the VNIC
ID string `json:"id"`
// The OCID for the VCN's default set of DHCP options
DefaultDhcpOptionsID string `json:"defaultDhcpOptionsId"`
// The OCID for the VCN's default route table
DefaultRouteTableID string `json:"defaultRouteTableId"`
// The OCID for the VCN's default security list
DefaultSecurityListID string `json:"defaultSecurityListId"`
// The VCN's current state
LifeCycleState string `json:"lifecycleState"`
// A DNS label for the VCN
DNSlabel string `json:"dnsLabel"`
// The date and time the instance was created (RFC3339)
TimeCreated string `json:"timeCreated"`
// The VCN's domain name
VcnDomainName int `json:"vcnDomainName"`
// The OCID of the VNIC
VNicID string `json:"vnicId"`
}
VCN contains the VCN reference from: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Vcn/
type VNic ¶
type VNic struct {
// The Availability Domain the instance is running in
AvailabilityDomain string `json:"availabilityDomain"`
// The OCID of the compartment that contains the instance
CompartmentID string `json:"compartmentId"`
// A user-friendly name
DisplayName string `json:"displayName"`
// The hostname for the VNIC's primary private IP
HostnameLabel string `json:"hostnameLabel"`
// The OCID of the VNIC
ID string `json:"id"`
// Whether the VNIC is the primary VNIC
Primary bool `json:"isPrimary"`
// The current state of the instance.
// PROVISIONING | AVAILABLE
// TERMINATING | TERMINATED
LifeCycleState string `json:"lifecycleState"`
// The MAC address of the VNIC
MacAddress string `json:"macAddress"`
// The private IP address of the primary privateIp object on the VNIC
PrivateIP string `json:"privateIp"`
// The public IP address of the VNIC, if one is assigned.
PublicIP string `json:"publicIp"`
// Whether the source/destination check is disabled on the VNIC
SrcDestCheck bool `json:"skipSourceDestCheck"`
// The OCID of the subnet the VNIC is in
SubnetID string `json:"subnetId"`
// The date and time the instance was created (RFC3339)
TimeCreated string `json:"timeCreated"`
}
VNic contains the VNIC reference from: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Vnic/
type VNicAttachment ¶
type VNicAttachment struct {
// The Availability Domain the instance is running in
AvailabilityDomain string `json:"availabilityDomain"`
// The OCID of the compartment that contains the instance
CompartmentID string `json:"compartmentId"`
// A user-friendly name
DisplayName string `json:"displayName"`
// The OCID of the VNIC
ID string `json:"id"`
// The OCID of the instance
InstanceID string `json:"instanceId"`
// The current state of the instance.
// ATTACHING | ATTACHED
// DETACHING | DETACHED
LifeCycleState string `json:"lifecycleState"`
// The OCID of the subnet the VNIC is in
SubnetID string `json:"subnetId"`
// The date and time the instance was created (RFC3339)
TimeCreated string `json:"timeCreated"`
// The Oracle-assigned VLAN tag of the attached VNIC
VlanTag int `json:"vlanTag"`
// The OCID of the VNIC
VNicID string `json:"vnicId"`
}
VNicAttachment contains the VNICAttachement reference from: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/VnicAttachment/