vpcgw

package
v1.0.0-beta.32 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package vpcgw provides methods and message types of the vpcgw v2 API.

Index

Constants

View Source
const (
	GatewayNetworkStatusUnknownStatus = GatewayNetworkStatus("unknown_status")
	GatewayNetworkStatusCreated       = GatewayNetworkStatus("created")
	GatewayNetworkStatusAttaching     = GatewayNetworkStatus("attaching")
	GatewayNetworkStatusConfiguring   = GatewayNetworkStatus("configuring")
	GatewayNetworkStatusReady         = GatewayNetworkStatus("ready")
	GatewayNetworkStatusDetaching     = GatewayNetworkStatus("detaching")
)
View Source
const (
	GatewayStatusUnknownStatus = GatewayStatus("unknown_status")
	GatewayStatusStopped       = GatewayStatus("stopped")
	GatewayStatusAllocating    = GatewayStatus("allocating")
	GatewayStatusConfiguring   = GatewayStatus("configuring")
	GatewayStatusRunning       = GatewayStatus("running")
	GatewayStatusStopping      = GatewayStatus("stopping")
	GatewayStatusFailed        = GatewayStatus("failed")
	GatewayStatusDeleting      = GatewayStatus("deleting")
	GatewayStatusLocked        = GatewayStatus("locked")
)
View Source
const (
	ListGatewayNetworksRequestOrderByCreatedAtAsc  = ListGatewayNetworksRequestOrderBy("created_at_asc")
	ListGatewayNetworksRequestOrderByCreatedAtDesc = ListGatewayNetworksRequestOrderBy("created_at_desc")
	ListGatewayNetworksRequestOrderByStatusAsc     = ListGatewayNetworksRequestOrderBy("status_asc")
	ListGatewayNetworksRequestOrderByStatusDesc    = ListGatewayNetworksRequestOrderBy("status_desc")
)
View Source
const (
	ListGatewaysRequestOrderByCreatedAtAsc  = ListGatewaysRequestOrderBy("created_at_asc")
	ListGatewaysRequestOrderByCreatedAtDesc = ListGatewaysRequestOrderBy("created_at_desc")
	ListGatewaysRequestOrderByNameAsc       = ListGatewaysRequestOrderBy("name_asc")
	ListGatewaysRequestOrderByNameDesc      = ListGatewaysRequestOrderBy("name_desc")
	ListGatewaysRequestOrderByTypeAsc       = ListGatewaysRequestOrderBy("type_asc")
	ListGatewaysRequestOrderByTypeDesc      = ListGatewaysRequestOrderBy("type_desc")
	ListGatewaysRequestOrderByStatusAsc     = ListGatewaysRequestOrderBy("status_asc")
	ListGatewaysRequestOrderByStatusDesc    = ListGatewaysRequestOrderBy("status_desc")
)
View Source
const (
	ListIPsRequestOrderByCreatedAtAsc  = ListIPsRequestOrderBy("created_at_asc")
	ListIPsRequestOrderByCreatedAtDesc = ListIPsRequestOrderBy("created_at_desc")
	ListIPsRequestOrderByAddressAsc    = ListIPsRequestOrderBy("address_asc")
	ListIPsRequestOrderByAddressDesc   = ListIPsRequestOrderBy("address_desc")
	ListIPsRequestOrderByReverseAsc    = ListIPsRequestOrderBy("reverse_asc")
	ListIPsRequestOrderByReverseDesc   = ListIPsRequestOrderBy("reverse_desc")
)
View Source
const (
	ListPatRulesRequestOrderByCreatedAtAsc   = ListPatRulesRequestOrderBy("created_at_asc")
	ListPatRulesRequestOrderByCreatedAtDesc  = ListPatRulesRequestOrderBy("created_at_desc")
	ListPatRulesRequestOrderByPublicPortAsc  = ListPatRulesRequestOrderBy("public_port_asc")
	ListPatRulesRequestOrderByPublicPortDesc = ListPatRulesRequestOrderBy("public_port_desc")
)
View Source
const (
	PatRuleProtocolUnknownProtocol = PatRuleProtocol("unknown_protocol")
	PatRuleProtocolBoth            = PatRuleProtocol("both")
	PatRuleProtocolTCP             = PatRuleProtocol("tcp")
	PatRuleProtocolUDP             = PatRuleProtocol("udp")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

This API allows you to manage your Public Gateways.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) AddBastionAllowedIPs

func (s *API) AddBastionAllowedIPs(req *AddBastionAllowedIPsRequest, opts ...scw.RequestOption) (*AddBastionAllowedIPsResponse, error)

AddBastionAllowedIPs: Add an IP range (in CIDR notation) to be allowed to connect to the SSH bastion.

func (*API) CreateGateway

func (s *API) CreateGateway(req *CreateGatewayRequest, opts ...scw.RequestOption) (*Gateway, error)

CreateGateway: Create a new Public Gateway in the specified Scaleway Project, defining its **name**, **type** and other configuration details such as whether to enable SSH bastion.

func (*API) CreateGatewayNetwork

func (s *API) CreateGatewayNetwork(req *CreateGatewayNetworkRequest, opts ...scw.RequestOption) (*GatewayNetwork, error)

CreateGatewayNetwork: Attach a specific Public Gateway to a specific Private Network (create a GatewayNetwork). You can configure parameters for the connection including whether to enable masquerade (dynamic NAT), and more.

func (*API) CreateIP

func (s *API) CreateIP(req *CreateIPRequest, opts ...scw.RequestOption) (*IP, error)

CreateIP: Create (reserve) a new flexible IP address that can be used for a Public Gateway in a specified Scaleway Project.

func (*API) CreatePatRule

func (s *API) CreatePatRule(req *CreatePatRuleRequest, opts ...scw.RequestOption) (*PatRule, error)

CreatePatRule: Create a new PAT rule on a specified Public Gateway, defining the protocol to use, public port to listen on, and private port / IP address to map to.

func (*API) DeleteBastionAllowedIPs

func (s *API) DeleteBastionAllowedIPs(req *DeleteBastionAllowedIPsRequest, opts ...scw.RequestOption) error

DeleteBastionAllowedIPs: Delete an IP range (defined in CIDR notation) from SSH bastion, so that it is no longer allowed to connect.

func (*API) DeleteGateway

func (s *API) DeleteGateway(req *DeleteGatewayRequest, opts ...scw.RequestOption) (*Gateway, error)

DeleteGateway: Delete an existing Public Gateway, specified by its gateway ID. This action is irreversible.

func (*API) DeleteGatewayNetwork

func (s *API) DeleteGatewayNetwork(req *DeleteGatewayNetworkRequest, opts ...scw.RequestOption) (*GatewayNetwork, error)

DeleteGatewayNetwork: Detach a given Public Gateway from a given Private Network, i.e. delete a GatewayNetwork specified by a gateway_network_id.

func (*API) DeleteIP

func (s *API) DeleteIP(req *DeleteIPRequest, opts ...scw.RequestOption) error

DeleteIP: Delete a flexible IP address from your account. This action is irreversible.

func (*API) DeletePatRule

func (s *API) DeletePatRule(req *DeletePatRuleRequest, opts ...scw.RequestOption) error

DeletePatRule: Delete a PAT rule, identified by its PAT rule ID. This action is irreversible.

func (*API) GetGateway

func (s *API) GetGateway(req *GetGatewayRequest, opts ...scw.RequestOption) (*Gateway, error)

GetGateway: Get details of a Public Gateway, specified by its gateway ID. The response object contains full details of the gateway, including its **name**, **type**, **status** and more.

func (*API) GetGatewayNetwork

func (s *API) GetGatewayNetwork(req *GetGatewayNetworkRequest, opts ...scw.RequestOption) (*GatewayNetwork, error)

GetGatewayNetwork: Get details of a given connection between a Public Gateway and a Private Network (this connection = a GatewayNetwork), specified by its `gateway_network_id`. The response object contains details of the connection including the IDs of the Public Gateway and Private Network, the dates the connection was created/updated and its configuration settings.

func (*API) GetIP

func (s *API) GetIP(req *GetIPRequest, opts ...scw.RequestOption) (*IP, error)

GetIP: Get details of a Public Gateway flexible IP address, identified by its IP ID. The response object contains information including which (if any) Public Gateway using this IP address, the reverse and various other metadata.

func (*API) GetPatRule

func (s *API) GetPatRule(req *GetPatRuleRequest, opts ...scw.RequestOption) (*PatRule, error)

GetPatRule: Get a PAT rule, specified by its PAT rule ID. The response object gives full details of the PAT rule, including the Public Gateway it belongs to and the configuration settings in terms of public / private ports, private IP and protocol.

func (*API) ListGatewayNetworks

func (s *API) ListGatewayNetworks(req *ListGatewayNetworksRequest, opts ...scw.RequestOption) (*ListGatewayNetworksResponse, error)

ListGatewayNetworks: List the connections between Public Gateways and Private Networks (a connection = a GatewayNetwork). You can choose to filter by `gateway-id` to list all Private Networks attached to the specified Public Gateway, or by `private_network_id` to list all Public Gateways attached to the specified Private Network. Other query parameters are also available. The result is an array of GatewayNetwork objects, each giving details of the connection between a given Public Gateway and a given Private Network.

func (*API) ListGatewayTypes

func (s *API) ListGatewayTypes(req *ListGatewayTypesRequest, opts ...scw.RequestOption) (*ListGatewayTypesResponse, error)

ListGatewayTypes: List the different Public Gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available gateway type.

func (*API) ListGateways

func (s *API) ListGateways(req *ListGatewaysRequest, opts ...scw.RequestOption) (*ListGatewaysResponse, error)

ListGateways: List Public Gateways in a given Scaleway Organization or Project. By default, results are displayed in ascending order of creation date.

func (*API) ListIPs

func (s *API) ListIPs(req *ListIPsRequest, opts ...scw.RequestOption) (*ListIPsResponse, error)

ListIPs: List Public Gateway flexible IP addresses. A number of filter options are available for limiting results in the response.

func (*API) ListPatRules

func (s *API) ListPatRules(req *ListPatRulesRequest, opts ...scw.RequestOption) (*ListPatRulesResponse, error)

ListPatRules: List PAT rules. You can filter by gateway ID to list all PAT rules for a particular gateway, or filter for PAT rules targeting a specific IP address or using a specific protocol.

func (*API) RefreshSSHKeys

func (s *API) RefreshSSHKeys(req *RefreshSSHKeysRequest, opts ...scw.RequestOption) (*Gateway, error)

RefreshSSHKeys: Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself.

func (*API) SetBastionAllowedIPs

func (s *API) SetBastionAllowedIPs(req *SetBastionAllowedIPsRequest, opts ...scw.RequestOption) (*SetBastionAllowedIPsResponse, error)

SetBastionAllowedIPs: Set a definitive list of IP ranges (in CIDR notation) allowed to connect to the SSH bastion.

func (*API) SetPatRules

func (s *API) SetPatRules(req *SetPatRulesRequest, opts ...scw.RequestOption) (*SetPatRulesResponse, error)

SetPatRules: Set a definitive list of PAT rules attached to a Public Gateway. Each rule is identified by its public port and protocol. This will sync the current PAT rule list on the gateway with the new list, creating, updating or deleting PAT rules accordingly.

func (*API) UpdateGateway

func (s *API) UpdateGateway(req *UpdateGatewayRequest, opts ...scw.RequestOption) (*Gateway, error)

UpdateGateway: Update the parameters of an existing Public Gateway, for example, its **name**, **tags**, **SSH bastion configuration**, and **DNS servers**.

func (*API) UpdateGatewayNetwork

func (s *API) UpdateGatewayNetwork(req *UpdateGatewayNetworkRequest, opts ...scw.RequestOption) (*GatewayNetwork, error)

UpdateGatewayNetwork: Update the configuration parameters of a connection between a given Public Gateway and Private Network (the connection = a GatewayNetwork). Updatable parameters include whether to enable traffic masquerade (dynamic NAT).

func (*API) UpdateIP

func (s *API) UpdateIP(req *UpdateIPRequest, opts ...scw.RequestOption) (*IP, error)

UpdateIP: Update details of an existing flexible IP address, including its tags, reverse and the Public Gateway it is assigned to.

func (*API) UpdatePatRule

func (s *API) UpdatePatRule(req *UpdatePatRuleRequest, opts ...scw.RequestOption) (*PatRule, error)

UpdatePatRule: Update a PAT rule, specified by its PAT rule ID. Configuration settings including private/public port, private IP address and protocol can all be updated.

func (*API) UpgradeGateway

func (s *API) UpgradeGateway(req *UpgradeGatewayRequest, opts ...scw.RequestOption) (*Gateway, error)

UpgradeGateway: Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update.

func (*API) Zones

func (s *API) Zones() []scw.Zone

type AddBastionAllowedIPsRequest

type AddBastionAllowedIPsRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: ID of the gateway to add the allowed IP range to.
	GatewayID string `json:"-"`

	// IPRange: IP range allowed to connect to the SSH bastion.
	IPRange scw.IPNet `json:"ip_range"`
}

AddBastionAllowedIPsRequest: add bastion allowed i ps request.

type AddBastionAllowedIPsResponse

type AddBastionAllowedIPsResponse struct {
	// IPRanges: ranges of IP addresses allowed to connect to the gateway's SSH bastion.
	IPRanges []scw.IPNet `json:"ip_ranges"`
}

AddBastionAllowedIPsResponse: add bastion allowed i ps response.

type CreateGatewayNetworkRequest

type CreateGatewayNetworkRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: public Gateway to connect.
	GatewayID string `json:"gateway_id"`

	// PrivateNetworkID: private Network to connect.
	PrivateNetworkID string `json:"private_network_id"`

	// EnableMasquerade: defines whether to enable masquerade (dynamic NAT) on the GatewayNetwork.
	EnableMasquerade bool `json:"enable_masquerade"`

	// PushDefaultRoute: enabling the default route also enables masquerading.
	PushDefaultRoute bool `json:"push_default_route"`

	// IpamIPID: use this IPAM-booked IP ID as the Gateway's IP in this Private Network.
	IpamIPID *string `json:"ipam_ip_id,omitempty"`
}

CreateGatewayNetworkRequest: create gateway network request.

type CreateGatewayRequest

type CreateGatewayRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// ProjectID: scaleway Project to create the gateway in.
	ProjectID string `json:"project_id"`

	// Name: name for the gateway.
	Name string `json:"name"`

	// Tags: tags for the gateway.
	Tags []string `json:"tags"`

	// Type: gateway type (commercial offer type).
	Type string `json:"type"`

	// IPID: existing IP address to attach to the gateway.
	IPID *string `json:"ip_id,omitempty"`

	// EnableSMTP: defines whether SMTP traffic should be allowed pass through the gateway.
	EnableSMTP bool `json:"enable_smtp"`

	// EnableBastion: defines whether SSH bastion should be enabled the gateway.
	EnableBastion bool `json:"enable_bastion"`

	// BastionPort: port of the SSH bastion.
	BastionPort *uint32 `json:"bastion_port,omitempty"`
}

CreateGatewayRequest: create gateway request.

type CreateIPRequest

type CreateIPRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// ProjectID: project to create the IP address in.
	ProjectID string `json:"project_id"`

	// Tags: tags to give to the IP address.
	Tags []string `json:"tags"`
}

CreateIPRequest: create ip request.

type CreatePatRuleRequest

type CreatePatRuleRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: ID of the Gateway on which to create the rule.
	GatewayID string `json:"gateway_id"`

	// PublicPort: public port to listen on.
	PublicPort uint32 `json:"public_port"`

	// PrivateIP: private IP to forward data to.
	PrivateIP net.IP `json:"private_ip"`

	// PrivatePort: private port to translate to.
	PrivatePort uint32 `json:"private_port"`

	// Protocol: protocol the rule should apply to.
	// Default value: unknown_protocol
	Protocol PatRuleProtocol `json:"protocol"`
}

CreatePatRuleRequest: create pat rule request.

type DeleteBastionAllowedIPsRequest

type DeleteBastionAllowedIPsRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: ID of the gateway on which to delete the allowed IP range.
	GatewayID string `json:"-"`

	// IPRange: IP range to delete from SSH bastion's list of allowed IPs.
	IPRange scw.IPNet `json:"-"`
}

DeleteBastionAllowedIPsRequest: delete bastion allowed i ps request.

type DeleteGatewayNetworkRequest

type DeleteGatewayNetworkRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayNetworkID: ID of the GatewayNetwork to delete.
	GatewayNetworkID string `json:"-"`
}

DeleteGatewayNetworkRequest: delete gateway network request.

type DeleteGatewayRequest

type DeleteGatewayRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: ID of the gateway to delete.
	GatewayID string `json:"-"`

	// DeleteIP: defines whether the PGW's IP should be deleted.
	DeleteIP bool `json:"delete_ip"`
}

DeleteGatewayRequest: delete gateway request.

type DeleteIPRequest

type DeleteIPRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// IPID: ID of the IP address to delete.
	IPID string `json:"-"`
}

DeleteIPRequest: delete ip request.

type DeletePatRuleRequest

type DeletePatRuleRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// PatRuleID: ID of the PAT rule to delete.
	PatRuleID string `json:"-"`
}

DeletePatRuleRequest: delete pat rule request.

type Gateway

type Gateway struct {
	// ID: ID of the gateway.
	ID string `json:"id"`

	// OrganizationID: owning Organization.
	OrganizationID string `json:"organization_id"`

	// ProjectID: owning Project.
	ProjectID string `json:"project_id"`

	// CreatedAt: gateway creation date.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: gateway last modification date.
	UpdatedAt *time.Time `json:"updated_at"`

	// Type: gateway type name (commercial offer).
	Type string `json:"type"`

	// Bandwidth: bandwidth available of the gateway.
	Bandwidth uint64 `json:"bandwidth"`

	// Status: current status of the gateway.
	// Default value: unknown_status
	Status GatewayStatus `json:"status"`

	// Name: name of the gateway.
	Name string `json:"name"`

	// Tags: tags associated with the gateway.
	Tags []string `json:"tags"`

	// IPv4: public IPv4 address of the gateway.
	IPv4 *IP `json:"ipv4"`

	// GatewayNetworks: gatewayNetwork objects attached to the gateway (each one represents a connection to a Private Network).
	GatewayNetworks []*GatewayNetwork `json:"gateway_networks"`

	// Version: version of the running gateway software.
	Version *string `json:"version"`

	// CanUpgradeTo: newly available gateway software version that can be updated to.
	CanUpgradeTo *string `json:"can_upgrade_to"`

	// BastionEnabled: defines whether SSH bastion is enabled on the gateway.
	BastionEnabled bool `json:"bastion_enabled"`

	// BastionPort: port of the SSH bastion.
	BastionPort uint32 `json:"bastion_port"`

	// SMTPEnabled: defines whether SMTP traffic is allowed to pass through the gateway.
	SMTPEnabled bool `json:"smtp_enabled"`

	// IsLegacy: defines whether the gateway uses non-IPAM IP configurations.
	IsLegacy bool `json:"is_legacy"`

	// BastionAllowedIPs: ranges of IP addresses allowed to connect to the gateway's SSH bastion.
	BastionAllowedIPs []scw.IPNet `json:"bastion_allowed_ips"`

	// Zone: zone of the gateway.
	Zone scw.Zone `json:"zone"`
}

Gateway: gateway.

type GatewayNetwork

type GatewayNetwork struct {
	// ID: ID of the Public Gateway-Private Network connection.
	ID string `json:"id"`

	// CreatedAt: connection creation date.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: connection last modification date.
	UpdatedAt *time.Time `json:"updated_at"`

	// GatewayID: ID of the connected Public Gateway.
	GatewayID string `json:"gateway_id"`

	// PrivateNetworkID: ID of the connected Private Network.
	PrivateNetworkID string `json:"private_network_id"`

	// MacAddress: mAC address of the gateway in the Private Network (if the gateway is up and running).
	MacAddress *string `json:"mac_address"`

	// MasqueradeEnabled: defines whether the gateway masquerades traffic for this Private Network (Dynamic NAT).
	MasqueradeEnabled bool `json:"masquerade_enabled"`

	// Status: current status of the Public Gateway's connection to the Private Network.
	// Default value: unknown_status
	Status GatewayNetworkStatus `json:"status"`

	// PushDefaultRoute: enabling the default route also enables masquerading.
	PushDefaultRoute bool `json:"push_default_route"`

	// IpamIPID: use this IPAM-booked IP ID as the Gateway's IP in this Private Network.
	IpamIPID string `json:"ipam_ip_id"`

	// Zone: zone of the GatewayNetwork connection.
	Zone scw.Zone `json:"zone"`
}

GatewayNetwork: gateway network.

type GatewayNetworkStatus

type GatewayNetworkStatus string

func (GatewayNetworkStatus) MarshalJSON

func (enum GatewayNetworkStatus) MarshalJSON() ([]byte, error)

func (GatewayNetworkStatus) String

func (enum GatewayNetworkStatus) String() string

func (*GatewayNetworkStatus) UnmarshalJSON

func (enum *GatewayNetworkStatus) UnmarshalJSON(data []byte) error

func (GatewayNetworkStatus) Values

type GatewayStatus

type GatewayStatus string

func (GatewayStatus) MarshalJSON

func (enum GatewayStatus) MarshalJSON() ([]byte, error)

func (GatewayStatus) String

func (enum GatewayStatus) String() string

func (*GatewayStatus) UnmarshalJSON

func (enum *GatewayStatus) UnmarshalJSON(data []byte) error

func (GatewayStatus) Values

func (enum GatewayStatus) Values() []GatewayStatus

type GatewayType

type GatewayType struct {
	// Name: public Gateway type name.
	Name string `json:"name"`

	// Bandwidth: bandwidth, in bps, of the Public Gateway. This is the public bandwidth to the outer Internet, and the internal bandwidth to each connected Private Networks.
	Bandwidth uint64 `json:"bandwidth"`

	// Zone: zone the Public Gateway type is available in.
	Zone scw.Zone `json:"zone"`
}

GatewayType: gateway type.

type GetGatewayNetworkRequest

type GetGatewayNetworkRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayNetworkID: ID of the GatewayNetwork to fetch.
	GatewayNetworkID string `json:"-"`
}

GetGatewayNetworkRequest: get gateway network request.

type GetGatewayRequest

type GetGatewayRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: ID of the gateway to fetch.
	GatewayID string `json:"-"`
}

GetGatewayRequest: get gateway request.

type GetIPRequest

type GetIPRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// IPID: ID of the IP address to get.
	IPID string `json:"-"`
}

GetIPRequest: get ip request.

type GetPatRuleRequest

type GetPatRuleRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// PatRuleID: ID of the PAT rule to get.
	PatRuleID string `json:"-"`
}

GetPatRuleRequest: get pat rule request.

type IP

type IP struct {
	// ID: IP address ID.
	ID string `json:"id"`

	// OrganizationID: owning Organization.
	OrganizationID string `json:"organization_id"`

	// ProjectID: owning Project.
	ProjectID string `json:"project_id"`

	// CreatedAt: IP address creation date.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: IP address last modification date.
	UpdatedAt *time.Time `json:"updated_at"`

	// Tags: tags associated with the IP address.
	Tags []string `json:"tags"`

	// Address: the IP address itself.
	Address net.IP `json:"address"`

	// Reverse: reverse domain name for the IP address.
	Reverse *string `json:"reverse"`

	// GatewayID: public Gateway associated with the IP address.
	GatewayID *string `json:"gateway_id"`

	// Zone: zone of the IP address.
	Zone scw.Zone `json:"zone"`
}

IP: ip.

type ListGatewayNetworksRequest

type ListGatewayNetworksRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// OrderBy: order in which to return results.
	// Default value: created_at_asc
	OrderBy ListGatewayNetworksRequestOrderBy `json:"-"`

	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: gatewayNetworks per page.
	PageSize *uint32 `json:"-"`

	// Status: filter for GatewayNetworks with these status. Use `unknown` to include all statuses.
	Status []GatewayNetworkStatus `json:"-"`

	// GatewayIDs: filter for GatewayNetworks connected to these gateways.
	GatewayIDs []string `json:"-"`

	// PrivateNetworkIDs: filter for GatewayNetworks connected to these Private Networks.
	PrivateNetworkIDs []string `json:"-"`

	// MasqueradeEnabled: filter for GatewayNetworks with this `enable_masquerade` setting.
	MasqueradeEnabled *bool `json:"-"`
}

ListGatewayNetworksRequest: list gateway networks request.

type ListGatewayNetworksRequestOrderBy

type ListGatewayNetworksRequestOrderBy string

func (ListGatewayNetworksRequestOrderBy) MarshalJSON

func (enum ListGatewayNetworksRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListGatewayNetworksRequestOrderBy) String

func (*ListGatewayNetworksRequestOrderBy) UnmarshalJSON

func (enum *ListGatewayNetworksRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListGatewayNetworksRequestOrderBy) Values

type ListGatewayNetworksResponse

type ListGatewayNetworksResponse struct {
	// GatewayNetworks: gatewayNetworks on this page.
	GatewayNetworks []*GatewayNetwork `json:"gateway_networks"`

	// TotalCount: total GatewayNetworks count matching the filter.
	TotalCount uint64 `json:"total_count"`
}

ListGatewayNetworksResponse: list gateway networks response.

func (*ListGatewayNetworksResponse) UnsafeAppend

func (r *ListGatewayNetworksResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListGatewayNetworksResponse) UnsafeGetTotalCount

func (r *ListGatewayNetworksResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListGatewayTypesRequest

type ListGatewayTypesRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
}

ListGatewayTypesRequest: list gateway types request.

type ListGatewayTypesResponse

type ListGatewayTypesResponse struct {
	// Types: available types of Public Gateway.
	Types []*GatewayType `json:"types"`
}

ListGatewayTypesResponse: list gateway types response.

type ListGatewaysRequest

type ListGatewaysRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// OrderBy: order in which to return results.
	// Default value: created_at_asc
	OrderBy ListGatewaysRequestOrderBy `json:"-"`

	// Page: page number to return.
	Page *int32 `json:"-"`

	// PageSize: gateways per page.
	PageSize *uint32 `json:"-"`

	// OrganizationID: include only gateways in this Organization.
	OrganizationID *string `json:"-"`

	// ProjectID: include only gateways in this Project.
	ProjectID *string `json:"-"`

	// Name: filter for gateways which have this search term in their name.
	Name *string `json:"-"`

	// Tags: filter for gateways with these tags.
	Tags []string `json:"-"`

	// Types: filter for gateways of these types.
	Types []string `json:"-"`

	// Status: filter for gateways with these status. Use `unknown` to include all statuses.
	Status []GatewayStatus `json:"-"`

	// PrivateNetworkIDs: filter for gateways attached to these Private Networks.
	PrivateNetworkIDs []string `json:"-"`

	// IncludeLegacy: include also legacy gateways.
	IncludeLegacy *bool `json:"-"`
}

ListGatewaysRequest: list gateways request.

type ListGatewaysRequestOrderBy

type ListGatewaysRequestOrderBy string

func (ListGatewaysRequestOrderBy) MarshalJSON

func (enum ListGatewaysRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListGatewaysRequestOrderBy) String

func (enum ListGatewaysRequestOrderBy) String() string

func (*ListGatewaysRequestOrderBy) UnmarshalJSON

func (enum *ListGatewaysRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListGatewaysRequestOrderBy) Values

type ListGatewaysResponse

type ListGatewaysResponse struct {
	// Gateways: gateways on this page.
	Gateways []*Gateway `json:"gateways"`

	// TotalCount: total count of gateways matching the filter.
	TotalCount uint64 `json:"total_count"`
}

ListGatewaysResponse: list gateways response.

func (*ListGatewaysResponse) UnsafeAppend

func (r *ListGatewaysResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListGatewaysResponse) UnsafeGetTotalCount

func (r *ListGatewaysResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListIPsRequest

type ListIPsRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// OrderBy: order in which to return results.
	// Default value: created_at_asc
	OrderBy ListIPsRequestOrderBy `json:"-"`

	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: IP addresses per page.
	PageSize *uint32 `json:"-"`

	// OrganizationID: include only gateways in this Organization.
	OrganizationID *string `json:"-"`

	// ProjectID: filter for IP addresses in this Project.
	ProjectID *string `json:"-"`

	// Tags: filter for IP addresses with these tags.
	Tags []string `json:"-"`

	// Reverse: filter for IP addresses that have a reverse containing this string.
	Reverse *string `json:"-"`

	// IsFree: filter based on whether the IP is attached to a gateway or not.
	IsFree *bool `json:"-"`
}

ListIPsRequest: list i ps request.

type ListIPsRequestOrderBy

type ListIPsRequestOrderBy string

func (ListIPsRequestOrderBy) MarshalJSON

func (enum ListIPsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListIPsRequestOrderBy) String

func (enum ListIPsRequestOrderBy) String() string

func (*ListIPsRequestOrderBy) UnmarshalJSON

func (enum *ListIPsRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListIPsRequestOrderBy) Values

type ListIPsResponse

type ListIPsResponse struct {
	// IPs: IP addresses on this page.
	IPs []*IP `json:"ips"`

	// TotalCount: total count of IP addresses matching the filter.
	TotalCount uint64 `json:"total_count"`
}

ListIPsResponse: list i ps response.

func (*ListIPsResponse) UnsafeAppend

func (r *ListIPsResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListIPsResponse) UnsafeGetTotalCount

func (r *ListIPsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListPatRulesRequest

type ListPatRulesRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// OrderBy: order in which to return results.
	// Default value: created_at_asc
	OrderBy ListPatRulesRequestOrderBy `json:"-"`

	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: pAT rules per page.
	PageSize *uint32 `json:"-"`

	// GatewayIDs: filter for PAT rules on these gateways.
	GatewayIDs []string `json:"-"`

	// PrivateIPs: filter for PAT rules targeting these private ips.
	PrivateIPs []string `json:"-"`

	// Protocol: filter for PAT rules with this protocol.
	// Default value: unknown_protocol
	Protocol PatRuleProtocol `json:"-"`
}

ListPatRulesRequest: list pat rules request.

type ListPatRulesRequestOrderBy

type ListPatRulesRequestOrderBy string

func (ListPatRulesRequestOrderBy) MarshalJSON

func (enum ListPatRulesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListPatRulesRequestOrderBy) String

func (enum ListPatRulesRequestOrderBy) String() string

func (*ListPatRulesRequestOrderBy) UnmarshalJSON

func (enum *ListPatRulesRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListPatRulesRequestOrderBy) Values

type ListPatRulesResponse

type ListPatRulesResponse struct {
	// PatRules: array of PAT rules matching the filter.
	PatRules []*PatRule `json:"pat_rules"`

	// TotalCount: total count of PAT rules matching the filter.
	TotalCount uint64 `json:"total_count"`
}

ListPatRulesResponse: list pat rules response.

func (*ListPatRulesResponse) UnsafeAppend

func (r *ListPatRulesResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListPatRulesResponse) UnsafeGetTotalCount

func (r *ListPatRulesResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type PatRule

type PatRule struct {
	// ID: pAT rule ID.
	ID string `json:"id"`

	// GatewayID: gateway the PAT rule applies to.
	GatewayID string `json:"gateway_id"`

	// CreatedAt: pAT rule creation date.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: pAT rule last modification date.
	UpdatedAt *time.Time `json:"updated_at"`

	// PublicPort: public port to listen on.
	PublicPort uint32 `json:"public_port"`

	// PrivateIP: private IP address to forward data to.
	PrivateIP net.IP `json:"private_ip"`

	// PrivatePort: private port to translate to.
	PrivatePort uint32 `json:"private_port"`

	// Protocol: protocol the rule applies to.
	// Default value: unknown_protocol
	Protocol PatRuleProtocol `json:"protocol"`

	// Zone: zone of the PAT rule.
	Zone scw.Zone `json:"zone"`
}

PatRule: pat rule.

type PatRuleProtocol

type PatRuleProtocol string

func (PatRuleProtocol) MarshalJSON

func (enum PatRuleProtocol) MarshalJSON() ([]byte, error)

func (PatRuleProtocol) String

func (enum PatRuleProtocol) String() string

func (*PatRuleProtocol) UnmarshalJSON

func (enum *PatRuleProtocol) UnmarshalJSON(data []byte) error

func (PatRuleProtocol) Values

func (enum PatRuleProtocol) Values() []PatRuleProtocol

type RefreshSSHKeysRequest

type RefreshSSHKeysRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: ID of the gateway to refresh SSH keys on.
	GatewayID string `json:"-"`
}

RefreshSSHKeysRequest: refresh ssh keys request.

type SetBastionAllowedIPsRequest

type SetBastionAllowedIPsRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: ID of the gateway on which to set the allowed IP range.
	GatewayID string `json:"-"`

	// IPRanges: new list of IP ranges (each range in CIDR notation) allowed to connect to the SSH bastion.
	IPRanges []string `json:"ip_ranges"`
}

SetBastionAllowedIPsRequest: set bastion allowed i ps request.

type SetBastionAllowedIPsResponse

type SetBastionAllowedIPsResponse struct {
	// IPRanges: ranges of IP addresses allowed to connect to the gateway's SSH bastion.
	IPRanges []scw.IPNet `json:"ip_ranges"`
}

SetBastionAllowedIPsResponse: set bastion allowed i ps response.

type SetPatRulesRequest

type SetPatRulesRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: ID of the gateway on which to set the PAT rules.
	GatewayID string `json:"gateway_id"`

	// PatRules: new list of PAT rules.
	PatRules []*SetPatRulesRequestRule `json:"pat_rules"`
}

SetPatRulesRequest: set pat rules request.

type SetPatRulesRequestRule

type SetPatRulesRequestRule struct {
	// PublicPort: public port to listen on. Uniquely identifies the rule, and a matching rule will be updated with the new parameters.
	PublicPort uint32 `json:"public_port"`

	// PrivateIP: private IP to forward data to.
	PrivateIP net.IP `json:"private_ip"`

	// PrivatePort: private port to translate to.
	PrivatePort uint32 `json:"private_port"`

	// Protocol: protocol the rule should apply to.
	// Default value: unknown_protocol
	Protocol PatRuleProtocol `json:"protocol"`
}

SetPatRulesRequestRule: set pat rules request rule.

type SetPatRulesResponse

type SetPatRulesResponse struct {
	// PatRules: list of PAT rules.
	PatRules []*PatRule `json:"pat_rules"`
}

SetPatRulesResponse: set pat rules response.

type UpdateGatewayNetworkRequest

type UpdateGatewayNetworkRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayNetworkID: ID of the GatewayNetwork to update.
	GatewayNetworkID string `json:"-"`

	// EnableMasquerade: defines whether to enable masquerade (dynamic NAT) on the GatewayNetwork.
	EnableMasquerade *bool `json:"enable_masquerade,omitempty"`

	// PushDefaultRoute: enabling the default route also enables masquerading.
	PushDefaultRoute *bool `json:"push_default_route,omitempty"`

	// IpamIPID: use this IPAM-booked IP ID as the Gateway's IP in this Private Network.
	IpamIPID *string `json:"ipam_ip_id,omitempty"`
}

UpdateGatewayNetworkRequest: update gateway network request.

type UpdateGatewayRequest

type UpdateGatewayRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: ID of the gateway to update.
	GatewayID string `json:"-"`

	// Name: name for the gateway.
	Name *string `json:"name,omitempty"`

	// Tags: tags for the gateway.
	Tags *[]string `json:"tags,omitempty"`

	// EnableBastion: defines whether SSH bastion should be enabled the gateway.
	EnableBastion *bool `json:"enable_bastion,omitempty"`

	// BastionPort: port of the SSH bastion.
	BastionPort *uint32 `json:"bastion_port,omitempty"`

	// EnableSMTP: defines whether SMTP traffic should be allowed to pass through the gateway.
	EnableSMTP *bool `json:"enable_smtp,omitempty"`
}

UpdateGatewayRequest: update gateway request.

type UpdateIPRequest

type UpdateIPRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// IPID: ID of the IP address to update.
	IPID string `json:"-"`

	// Tags: tags to give to the IP address.
	Tags *[]string `json:"tags,omitempty"`

	// Reverse: reverse to set on the address. Empty string to unset.
	Reverse *string `json:"reverse,omitempty"`

	// GatewayID: gateway to attach the IP address to. Empty string to detach.
	GatewayID *string `json:"gateway_id,omitempty"`
}

UpdateIPRequest: update ip request.

type UpdatePatRuleRequest

type UpdatePatRuleRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// PatRuleID: ID of the PAT rule to update.
	PatRuleID string `json:"-"`

	// PublicPort: public port to listen on.
	PublicPort *uint32 `json:"public_port,omitempty"`

	// PrivateIP: private IP to forward data to.
	PrivateIP *net.IP `json:"private_ip,omitempty"`

	// PrivatePort: private port to translate to.
	PrivatePort *uint32 `json:"private_port,omitempty"`

	// Protocol: protocol the rule should apply to.
	// Default value: unknown_protocol
	Protocol PatRuleProtocol `json:"protocol"`
}

UpdatePatRuleRequest: update pat rule request.

type UpgradeGatewayRequest

type UpgradeGatewayRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// GatewayID: ID of the gateway to upgrade.
	GatewayID string `json:"-"`

	// Type: gateway type (commercial offer).
	Type *string `json:"type,omitempty"`
}

UpgradeGatewayRequest: upgrade gateway request.

Jump to

Keyboard shortcuts

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