Documentation
¶
Index ¶
- Constants
- type Error
- type FirewallRule
- type FirewallRuleList
- type FirewallRuleNewParams
- type FirewallRuleNewParamsProtocol
- type FirewallRuleProtocol
- type FirewallRuleService
- func (r *FirewallRuleService) Delete(ctx context.Context, vpcID string, firewallRuleID string, ...) (res *operations.Operation, err error)
- func (r *FirewallRuleService) Get(ctx context.Context, vpcID string, firewallRuleID string, ...) (res *FirewallRule, err error)
- func (r *FirewallRuleService) List(ctx context.Context, vpcID string, opts ...option.RequestOption) (res *FirewallRuleList, err error)
- func (r *FirewallRuleService) New(ctx context.Context, vpcID string, body FirewallRuleNewParams, ...) (res *operations.Operation, err error)
- func (r *FirewallRuleService) Update(ctx context.Context, vpcID string, firewallRuleID string, ...) (res *operations.Operation, err error)
- type FirewallRuleUpdateParams
- type FirewallRuleUpdateParamsProtocol
- type NetworkingService
- type RegionName
- type ResourceStatus
- type Subnet
- type VPC
- type VPCAvailabilityNewParams
- type VPCAvailabilityService
- type VPCAvailabilityUpdateParams
- type VPCList
- type VPCNewParams
- type VPCService
- func (r *VPCService) Delete(ctx context.Context, vpcID string, opts ...option.RequestOption) (res *operations.Operation, err error)
- func (r *VPCService) Get(ctx context.Context, vpcID string, opts ...option.RequestOption) (res *VPC, err error)
- func (r *VPCService) List(ctx context.Context, opts ...option.RequestOption) (res *VPCList, err error)
- func (r *VPCService) New(ctx context.Context, body VPCNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)
- func (r *VPCService) Update(ctx context.Context, vpcID string, body VPCUpdateParams, ...) (res *operations.Operation, err error)
- type VPCUpdateParams
Constants ¶
const RegionNameApSeo1 = shared.RegionNameApSeo1
Equals "ap-seo-1"
const RegionNameApSin1 = shared.RegionNameApSin1
Equals "ap-sin-1"
const RegionNameApTyo1 = shared.RegionNameApTyo1
Equals "ap-tyo-1"
const RegionNameEuFrk1 = shared.RegionNameEuFrk1
Equals "eu-frk-1"
const RegionNameUsChi1 = shared.RegionNameUsChi1
Equals "us-chi-1"
const RegionNameUsSea1 = shared.RegionNameUsSea1
Equals "us-sea-1"
const RegionNameUsSva1 = shared.RegionNameUsSva1
Equals "us-sva-1"
const RegionNameUsWdc1 = shared.RegionNameUsWdc1
Equals "us-wdc-1"
const ResourceStatusCreating = shared.ResourceStatusCreating
Equals "creating"
const ResourceStatusDeleted = shared.ResourceStatusDeleted
Equals "deleted"
const ResourceStatusDeleting = shared.ResourceStatusDeleting
Equals "deleting"
const ResourceStatusError = shared.ResourceStatusError
Equals "error"
const ResourceStatusPending = shared.ResourceStatusPending
Equals "pending"
const ResourceStatusReady = shared.ResourceStatusReady
Equals "ready"
const ResourceStatusUpdating = shared.ResourceStatusUpdating
Equals "updating"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FirewallRule ¶
type FirewallRule struct {
// Unique identifier for the Firewall Rule.
ID string `json:"id,required"`
// When the Firewall Rule was created.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC.
DestinationAddress string `json:"destination_address,required"`
// Destination ports of the Firewall Rule.
DestinationPorts []string `json:"destination_ports,required"`
// Name of the Firewall Rule.
Name string `json:"name,required"`
// Protocol of the Firewall Rule.
//
// Any of "tcp", "udp".
Protocol FirewallRuleProtocol `json:"protocol,required"`
// Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask
// of 0.
SourceAddress string `json:"source_address,required"`
// Status of the resource.
//
// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
// "error".
Status shared.ResourceStatus `json:"status,required"`
// Tags to attach to the Firewall Rule.
Tags []string `json:"tags,required"`
// When the Firewall Rule was updated.
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
// ID of the VPC the Firewall Rule belongs to.
VPCID string `json:"vpc_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
DestinationAddress respjson.Field
DestinationPorts respjson.Field
Name respjson.Field
Protocol respjson.Field
SourceAddress respjson.Field
Status respjson.Field
Tags respjson.Field
UpdatedAt respjson.Field
VPCID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Firewall rule details.
func (FirewallRule) RawJSON ¶ added in v1.1.0
func (r FirewallRule) RawJSON() string
Returns the unmodified JSON received from the API
func (*FirewallRule) UnmarshalJSON ¶
func (r *FirewallRule) UnmarshalJSON(data []byte) error
type FirewallRuleList ¶
type FirewallRuleList struct {
Items []FirewallRule `json:"items,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FirewallRuleList) RawJSON ¶ added in v1.1.0
func (r FirewallRuleList) RawJSON() string
Returns the unmodified JSON received from the API
func (*FirewallRuleList) UnmarshalJSON ¶
func (r *FirewallRuleList) UnmarshalJSON(data []byte) error
type FirewallRuleNewParams ¶
type FirewallRuleNewParams struct {
// Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC.
DestinationAddress string `json:"destination_address,required"`
// Destination ports of the Firewall Rule.
DestinationPorts []string `json:"destination_ports,omitzero,required"`
// Name of the Firewall Rule.
Name string `json:"name,required"`
// Protocol of the Firewall Rule.
//
// Any of "tcp", "udp".
Protocol FirewallRuleNewParamsProtocol `json:"protocol,omitzero,required"`
// Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask
// of 0.
SourceAddress string `json:"source_address,required"`
// Tags to attach to the Firewall Rule.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (FirewallRuleNewParams) MarshalJSON ¶
func (r FirewallRuleNewParams) MarshalJSON() (data []byte, err error)
func (*FirewallRuleNewParams) UnmarshalJSON ¶ added in v1.1.0
func (r *FirewallRuleNewParams) UnmarshalJSON(data []byte) error
type FirewallRuleNewParamsProtocol ¶ added in v1.7.0
type FirewallRuleNewParamsProtocol string
Protocol of the Firewall Rule.
const ( FirewallRuleNewParamsProtocolTcp FirewallRuleNewParamsProtocol = "tcp" FirewallRuleNewParamsProtocolUdp FirewallRuleNewParamsProtocol = "udp" )
type FirewallRuleProtocol ¶
type FirewallRuleProtocol string
Protocol of the Firewall Rule.
const ( FirewallRuleProtocolTcp FirewallRuleProtocol = "tcp" FirewallRuleProtocolUdp FirewallRuleProtocol = "udp" )
type FirewallRuleService ¶
type FirewallRuleService struct {
Options []option.RequestOption
}
FirewallRuleService contains methods and other services that help with interacting with the Nirvana Labs API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFirewallRuleService method instead.
func NewFirewallRuleService ¶
func NewFirewallRuleService(opts ...option.RequestOption) (r FirewallRuleService)
NewFirewallRuleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FirewallRuleService) Delete ¶
func (r *FirewallRuleService) Delete(ctx context.Context, vpcID string, firewallRuleID string, opts ...option.RequestOption) (res *operations.Operation, err error)
Delete a firewall rule
func (*FirewallRuleService) Get ¶
func (r *FirewallRuleService) Get(ctx context.Context, vpcID string, firewallRuleID string, opts ...option.RequestOption) (res *FirewallRule, err error)
Get details about a firewall rule
func (*FirewallRuleService) List ¶
func (r *FirewallRuleService) List(ctx context.Context, vpcID string, opts ...option.RequestOption) (res *FirewallRuleList, err error)
List all firewall rules
func (*FirewallRuleService) New ¶
func (r *FirewallRuleService) New(ctx context.Context, vpcID string, body FirewallRuleNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)
Create a firewall rule
func (*FirewallRuleService) Update ¶
func (r *FirewallRuleService) Update(ctx context.Context, vpcID string, firewallRuleID string, body FirewallRuleUpdateParams, opts ...option.RequestOption) (res *operations.Operation, err error)
Update a firewall rule
type FirewallRuleUpdateParams ¶
type FirewallRuleUpdateParams struct {
// Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC.
DestinationAddress param.Opt[string] `json:"destination_address,omitzero"`
// Name of the Firewall Rule.
Name param.Opt[string] `json:"name,omitzero"`
// Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask
// of 0.
SourceAddress param.Opt[string] `json:"source_address,omitzero"`
// Destination ports of the Firewall Rule.
DestinationPorts []string `json:"destination_ports,omitzero"`
// Protocol of the Firewall Rule.
//
// Any of "tcp", "udp".
Protocol FirewallRuleUpdateParamsProtocol `json:"protocol,omitzero"`
// Tags to attach to the Firewall Rule.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (FirewallRuleUpdateParams) MarshalJSON ¶
func (r FirewallRuleUpdateParams) MarshalJSON() (data []byte, err error)
func (*FirewallRuleUpdateParams) UnmarshalJSON ¶ added in v1.1.0
func (r *FirewallRuleUpdateParams) UnmarshalJSON(data []byte) error
type FirewallRuleUpdateParamsProtocol ¶
type FirewallRuleUpdateParamsProtocol string
Protocol of the Firewall Rule.
const ( FirewallRuleUpdateParamsProtocolTcp FirewallRuleUpdateParamsProtocol = "tcp" FirewallRuleUpdateParamsProtocolUdp FirewallRuleUpdateParamsProtocol = "udp" )
type NetworkingService ¶
type NetworkingService struct {
Options []option.RequestOption
VPCs VPCService
FirewallRules FirewallRuleService
}
NetworkingService contains methods and other services that help with interacting with the Nirvana Labs API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNetworkingService method instead.
func NewNetworkingService ¶
func NewNetworkingService(opts ...option.RequestOption) (r NetworkingService)
NewNetworkingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type RegionName ¶
type RegionName = shared.RegionName
Region the resource is in.
This is an alias to an internal type.
type ResourceStatus ¶
type ResourceStatus = shared.ResourceStatus
Status of the resource.
This is an alias to an internal type.
type Subnet ¶
type Subnet struct {
// Unique identifier for the Subnet.
ID string `json:"id,required"`
// CIDR block for the Subnet.
CIDR string `json:"cidr,required"`
// When the Subnet was created.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Name of the Subnet.
Name string `json:"name,required"`
// When the Subnet was updated.
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CIDR respjson.Field
CreatedAt respjson.Field
Name respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Subnet of the VPC.
func (*Subnet) UnmarshalJSON ¶
type VPC ¶
type VPC struct {
// Unique identifier for the VPC.
ID string `json:"id,required"`
// When the VPC was created.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// IDs of the Firewall Rules associated with the VPC.
FirewallRuleIDs []string `json:"firewall_rule_ids,required"`
// Name of the VPC.
Name string `json:"name,required"`
// Region the resource is in.
//
// Any of "us-sea-1", "us-sva-1", "us-chi-1", "us-wdc-1", "eu-frk-1", "ap-sin-1",
// "ap-seo-1", "ap-tyo-1".
Region shared.RegionName `json:"region,required"`
// Status of the resource.
//
// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
// "error".
Status shared.ResourceStatus `json:"status,required"`
// Subnet of the VPC.
Subnet Subnet `json:"subnet,required"`
// Tags to attach to the VPC.
Tags []string `json:"tags,required"`
// When the VPC was updated.
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
FirewallRuleIDs respjson.Field
Name respjson.Field
Region respjson.Field
Status respjson.Field
Subnet respjson.Field
Tags respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
VPC details.
func (*VPC) UnmarshalJSON ¶
type VPCAvailabilityNewParams ¶ added in v1.3.0
type VPCAvailabilityNewParams struct {
// Name of the VPC.
Name string `json:"name,required"`
// Region the resource is in.
//
// Any of "us-sea-1", "us-sva-1", "us-chi-1", "us-wdc-1", "eu-frk-1", "ap-sin-1",
// "ap-seo-1", "ap-tyo-1".
Region shared.RegionName `json:"region,omitzero,required"`
// Name of the subnet to create.
SubnetName string `json:"subnet_name,required"`
// Tags to attach to the VPC.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (VPCAvailabilityNewParams) MarshalJSON ¶ added in v1.3.0
func (r VPCAvailabilityNewParams) MarshalJSON() (data []byte, err error)
func (*VPCAvailabilityNewParams) UnmarshalJSON ¶ added in v1.3.0
func (r *VPCAvailabilityNewParams) UnmarshalJSON(data []byte) error
type VPCAvailabilityService ¶ added in v1.3.0
type VPCAvailabilityService struct {
Options []option.RequestOption
}
VPCAvailabilityService contains methods and other services that help with interacting with the Nirvana Labs API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVPCAvailabilityService method instead.
func NewVPCAvailabilityService ¶ added in v1.3.0
func NewVPCAvailabilityService(opts ...option.RequestOption) (r VPCAvailabilityService)
NewVPCAvailabilityService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VPCAvailabilityService) New ¶ added in v1.3.0
func (r *VPCAvailabilityService) New(ctx context.Context, body VPCAvailabilityNewParams, opts ...option.RequestOption) (res *string, err error)
Check if a VPC can be created
func (*VPCAvailabilityService) Update ¶ added in v1.3.0
func (r *VPCAvailabilityService) Update(ctx context.Context, vpcID string, body VPCAvailabilityUpdateParams, opts ...option.RequestOption) (res *string, err error)
Check if a VPC can be updated
type VPCAvailabilityUpdateParams ¶ added in v1.3.0
type VPCAvailabilityUpdateParams struct {
// Name of the VPC.
Name param.Opt[string] `json:"name,omitzero"`
// Name of the subnet to create.
SubnetName param.Opt[string] `json:"subnet_name,omitzero"`
// Tags to attach to the VPC.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (VPCAvailabilityUpdateParams) MarshalJSON ¶ added in v1.3.0
func (r VPCAvailabilityUpdateParams) MarshalJSON() (data []byte, err error)
func (*VPCAvailabilityUpdateParams) UnmarshalJSON ¶ added in v1.3.0
func (r *VPCAvailabilityUpdateParams) UnmarshalJSON(data []byte) error
type VPCList ¶
type VPCList struct {
Items []VPC `json:"items,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*VPCList) UnmarshalJSON ¶
type VPCNewParams ¶
type VPCNewParams struct {
// Name of the VPC.
Name string `json:"name,required"`
// Region the resource is in.
//
// Any of "us-sea-1", "us-sva-1", "us-chi-1", "us-wdc-1", "eu-frk-1", "ap-sin-1",
// "ap-seo-1", "ap-tyo-1".
Region shared.RegionName `json:"region,omitzero,required"`
// Name of the subnet to create.
SubnetName string `json:"subnet_name,required"`
// Tags to attach to the VPC.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (VPCNewParams) MarshalJSON ¶
func (r VPCNewParams) MarshalJSON() (data []byte, err error)
func (*VPCNewParams) UnmarshalJSON ¶ added in v1.1.0
func (r *VPCNewParams) UnmarshalJSON(data []byte) error
type VPCService ¶
type VPCService struct {
Options []option.RequestOption
Availability VPCAvailabilityService
}
VPCService contains methods and other services that help with interacting with the Nirvana Labs API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVPCService method instead.
func NewVPCService ¶
func NewVPCService(opts ...option.RequestOption) (r VPCService)
NewVPCService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VPCService) Delete ¶
func (r *VPCService) Delete(ctx context.Context, vpcID string, opts ...option.RequestOption) (res *operations.Operation, err error)
Delete a VPC
func (*VPCService) Get ¶
func (r *VPCService) Get(ctx context.Context, vpcID string, opts ...option.RequestOption) (res *VPC, err error)
Get details about a VPC
func (*VPCService) List ¶
func (r *VPCService) List(ctx context.Context, opts ...option.RequestOption) (res *VPCList, err error)
List all VPCs
func (*VPCService) New ¶
func (r *VPCService) New(ctx context.Context, body VPCNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)
Create a VPC
func (*VPCService) Update ¶
func (r *VPCService) Update(ctx context.Context, vpcID string, body VPCUpdateParams, opts ...option.RequestOption) (res *operations.Operation, err error)
Update a VPC
type VPCUpdateParams ¶
type VPCUpdateParams struct {
// Name of the VPC.
Name param.Opt[string] `json:"name,omitzero"`
// Name of the subnet to create.
SubnetName param.Opt[string] `json:"subnet_name,omitzero"`
// Tags to attach to the VPC.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (VPCUpdateParams) MarshalJSON ¶
func (r VPCUpdateParams) MarshalJSON() (data []byte, err error)
func (*VPCUpdateParams) UnmarshalJSON ¶ added in v1.1.0
func (r *VPCUpdateParams) UnmarshalJSON(data []byte) error