Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to attach PaaS service to a private network #216

Merged
merged 4 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ type NetworkRelations struct {

// Array of object (NetworkPaaSSecurityZone).
PaaSSecurityZones []NetworkPaaSSecurityZone `json:"paas_security_zones"`

// Array of PaaS services that are connected to this network.
PaaSServices []NetworkPaaSService `json:"paas_services"`
}

// NetworkVlan represents a relation between a network and a VLAN.
Expand Down Expand Up @@ -187,6 +190,25 @@ type NetworkPaaSSecurityZone struct {
ObjectUUID string `json:"object_uuid"`
}

// NetworkPaaSService represents a relation between a network and a Network.
type NetworkPaaSService struct {
// The human-readable name of the object. It supports the full UTF-8 character set, with a maximum of 64 characters.
ObjectName string `json:"object_name"`

// The UUID of an object is always unique, and refers to a specific object.
ObjectUUID string `json:"object_uuid"`

// Category of the PaaS service.
ServiceTemplateCategory string `json:"service_template_category"`

// The template used to create the service, you can find an available list at the /service_templates endpoint.
ServiceTemplateUUID string `json:"service_template_uuid"`

// Contains the IPv6/IPv4 address and port that the Service will listen to,
// you can use these details to connect internally to a service.
ListenPorts map[string]map[string]int `json:"listen_ports"`
}

// NetworkCreateRequest represents a request for creating a network.
type NetworkCreateRequest struct {
// The human-readable name of the object. It supports the full UTF-8 character set, with a maximum of 64 characters.
Expand Down
18 changes: 15 additions & 3 deletions paas.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,22 @@ type PaaSServiceProperties struct {
// Defines the date and time the object was initially created.
CreateTime GSTime `json:"create_time"`

// Contains the IPv6 address and port that the Service will listen to,
// Contains the IPv6/IPv4 address and port that the Service will listen to,
// you can use these details to connect internally to a service.
ListenPorts map[string]map[string]int `json:"listen_ports"`

// The UUID of the security zone that the service is running in.
// The UUID of the security zone that the service is attached to.
SecurityZoneUUID string `json:"security_zone_uuid"`

// The UUID of the network that the service is attached to.
NetworkUUID string `json:"network_uuid"`

// The template used to create the service, you can find an available list at the /service_templates endpoint.
ServiceTemplateUUID string `json:"service_template_uuid"`

// The template category used to create the service.
ServiceTemplateCategory string `json:"service_template_category"`

// Total minutes the object has been running.
UsageInMinutes int `json:"usage_in_minutes"`

Expand Down Expand Up @@ -118,9 +124,12 @@ type PaaSServiceCreateRequest struct {
// The list of labels.
Labels []string `json:"labels,omitempty"`

// The UUID of the security zone that the service is running in.
// The UUID of the security zone that the service is attached to.
PaaSSecurityZoneUUID string `json:"paas_security_zone_uuid,omitempty"`

// The UUID of the network that the service is attached to.
NetworkUUID string `json:"network_uuid,omitempty"`

// A list of service resource limits.
ResourceLimits []ResourceLimit `json:"resource_limits,omitempty"`

Expand Down Expand Up @@ -314,6 +323,9 @@ type PaaSServiceUpdateRequest struct {

// The template that you want to use in the service, you can find an available list at the /service_templates endpoint.
PaaSServiceTemplateUUID string `json:"service_template_uuid,omitempty"`

// The UUID of the network that the service is attached to.
NetworkUUID string `json:"network_uuid,omitempty"`
}

// PaaSServiceMetrics represents a list of metrics of a PaaS service.
Expand Down