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

Add missing hostname/fqdn fields to VPN GW model #162

Merged
merged 1 commit into from
Nov 11, 2024
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
27 changes: 27 additions & 0 deletions pkg/service/ecloud/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
return fmt.Sprintf("Image not found with ID [%s]", e.ID)
}

// HostSpecFoundError indicates an host spec was not found

Check notice on line 275 in pkg/service/ecloud/error.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'HostSpecNotFoundError ...' (with an optional leading article)
type HostSpecNotFoundError struct {
ID string
}
Expand All @@ -281,7 +281,7 @@
return fmt.Sprintf("Host spec not found with ID [%s]", e.ID)
}

// HostGroupFoundError indicates an host group was not found

Check notice on line 284 in pkg/service/ecloud/error.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'HostGroupNotFoundError ...' (with an optional leading article)
type HostGroupNotFoundError struct {
ID string
}
Expand All @@ -290,7 +290,7 @@
return fmt.Sprintf("Host group not found with ID [%s]", e.ID)
}

// SSHKeyPairFoundError indicates a SSH key pair was not found

Check notice on line 293 in pkg/service/ecloud/error.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'SSHKeyPairNotFoundError ...' (with an optional leading article)
type SSHKeyPairNotFoundError struct {
ID string
}
Expand All @@ -299,7 +299,7 @@
return fmt.Sprintf("SSH key pair not found with ID [%s]", e.ID)
}

// HostFoundError indicates an host was not found

Check notice on line 302 in pkg/service/ecloud/error.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'HostNotFoundError ...' (with an optional leading article)
type HostNotFoundError struct {
ID string
}
Expand All @@ -308,7 +308,7 @@
return fmt.Sprintf("Host not found with ID [%s]", e.ID)
}

// TaskFoundError indicates an task was not found

Check notice on line 311 in pkg/service/ecloud/error.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'TaskNotFoundError ...' (with an optional leading article)
type TaskNotFoundError struct {
ID string
}
Expand All @@ -317,7 +317,7 @@
return fmt.Sprintf("Task not found with ID [%s]", e.ID)
}

// NetworkPolicyFoundError indicates a network policy was not found

Check notice on line 320 in pkg/service/ecloud/error.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'NetworkPolicyNotFoundError ...' (with an optional leading article)
type NetworkPolicyNotFoundError struct {
ID string
}
Expand Down Expand Up @@ -398,7 +398,7 @@
return fmt.Sprintf("Load balancer not found with ID [%s]", e.ID)
}

// LoadBalancerNetworkNotFoundError indicates a load balancer spec was not found

Check notice on line 401 in pkg/service/ecloud/error.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'LoadBalancerSpecNotFoundError ...' (with an optional leading article)
type LoadBalancerSpecNotFoundError struct {
ID string
}
Expand Down Expand Up @@ -469,3 +469,30 @@
func (e *IOPSNotFoundError) Error() string {
return fmt.Sprintf("IOPS tier not found with ID [%s]", e.ID)
}

// VPNGatewayNotFoundError represents a VPN gateway not found error
type VPNGatewayNotFoundError struct {
ID string
}

func (e *VPNGatewayNotFoundError) Error() string {
return fmt.Sprintf("VPN gateway not found with ID [%s]", e.ID)
}

// VPNGatewaySpecificationNotFoundError represents a VPN gateway specification not found error
type VPNGatewaySpecificationNotFoundError struct {
ID string
}

func (e *VPNGatewaySpecificationNotFoundError) Error() string {
return fmt.Sprintf("VPN gateway specification not found with ID [%s]", e.ID)
}

// VPNGatewayUserNotFoundError represents a VPN gateway user not found error
type VPNGatewayUserNotFoundError struct {
ID string
}

func (e *VPNGatewayUserNotFoundError) Error() string {
return fmt.Sprintf("VPN gateway user not found with ID [%s]", e.ID)
}
62 changes: 2 additions & 60 deletions pkg/service/ecloud/model.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package ecloud

import (
"fmt"

"github.com/ans-group/sdk-go/pkg/connection"
)

Expand Down Expand Up @@ -933,7 +931,7 @@
UpdatedAt connection.DateTime `json:"updated_at"`
}

// IP Address represents an eCloud VPC Network IP Address

Check notice on line 934 in pkg/service/ecloud/model.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'IPAddress ...' (with an optional leading article)
type IPAddress struct {
ID string `json:"id"`
Name string `json:"name"`
Expand Down Expand Up @@ -1037,24 +1035,14 @@
Name string `json:"name"`
RouterID string `json:"router_id"`
SpecificationID string `json:"specification_id"`
Hostname string `json:"hostname"`
FQDN string `json:"fqdn"`
Sync ResourceSync `json:"sync"`
Task ResourceTask `json:"task"`
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}

// CreateVPNGatewayRequest represents a request to create a VPN gateway
type CreateVPNGatewayRequest struct {
Name string `json:"name,omitempty"`
RouterID string `json:"router_id"`
SpecificationID string `json:"specification_id"`
}

// PatchVPNGatewayRequest represents a request to patch a VPN gateway
type PatchVPNGatewayRequest struct {
Name string `json:"name,omitempty"`
}

// VPNGatewaySpecification represents a VPN gateway specification
type VPNGatewaySpecification struct {
ID string `json:"id"`
Expand All @@ -1075,49 +1063,3 @@
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}

// CreateVPNGatewayUserRequest represents a request to create a VPN gateway user
type CreateVPNGatewayUserRequest struct {
Name string `json:"name,omitempty"`
VPNGatewayID string `json:"vpn_gateway_id"`
Username string `json:"username"`
Password string `json:"password"`
}

// PatchVPNGatewayUserRequest represents a request to patch a VPN gateway user
type PatchVPNGatewayUserRequest struct {
Name string `json:"name,omitempty"`
Password string `json:"password,omitempty"`
}

// PatchVPNGatewayUserCredentialRequest represents a request to update VPN gateway user credentials
type PatchVPNGatewayUserCredentialRequest struct {
Password string `json:"password"`
}

// VPNGatewayNotFoundError represents a VPN gateway not found error
type VPNGatewayNotFoundError struct {
ID string
}

func (e *VPNGatewayNotFoundError) Error() string {
return fmt.Sprintf("VPN gateway not found with ID [%s]", e.ID)
}

// VPNGatewaySpecificationNotFoundError represents a VPN gateway specification not found error
type VPNGatewaySpecificationNotFoundError struct {
ID string
}

func (e *VPNGatewaySpecificationNotFoundError) Error() string {
return fmt.Sprintf("VPN gateway specification not found with ID [%s]", e.ID)
}

// VPNGatewayUserNotFoundError represents a VPN gateway user not found error
type VPNGatewayUserNotFoundError struct {
ID string
}

func (e *VPNGatewayUserNotFoundError) Error() string {
return fmt.Sprintf("VPN gateway user not found with ID [%s]", e.ID)
}
26 changes: 26 additions & 0 deletions pkg/service/ecloud/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@
NetworkID string `json:"network_id"`
}

// CreateLoadBalancerRequest represents a request to patch a load balancer

Check notice on line 547 in pkg/service/ecloud/request.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'PatchLoadBalancerRequest ...' (with an optional leading article)
type PatchLoadBalancerRequest struct {
Name string `json:"name,omitempty"`
}
Expand Down Expand Up @@ -615,7 +615,7 @@
Description string `json:"description,omitempty"`
}

// NATOverloadRule represents an eCloud NAT overload rule

Check notice on line 618 in pkg/service/ecloud/request.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'CreateNATOverloadRuleRequest ...' (with an optional leading article)
type CreateNATOverloadRuleRequest struct {
Name string `json:"name,omitempty"`
NetworkID string `json:"network_id"`
Expand All @@ -624,7 +624,7 @@
Action NATOverloadRuleAction `json:"action"`
}

// NATOverloadRule represents an eCloud NAT overload rule

Check notice on line 627 in pkg/service/ecloud/request.go

View workflow job for this annotation

GitHub Actions / Qodana for Go

Comment of exported element starts with the incorrect name

Comment should have the following format 'PatchNATOverloadRuleRequest ...' (with an optional leading article)
type PatchNATOverloadRuleRequest struct {
Name string `json:"name,omitempty"`
Subnet string `json:"subnet,omitempty"`
Expand All @@ -636,3 +636,29 @@
Username string `json:"username"`
Password string `json:"password"`
}

// CreateVPNGatewayRequest represents a request to create a VPN gateway
type CreateVPNGatewayRequest struct {
Name string `json:"name,omitempty"`
RouterID string `json:"router_id"`
SpecificationID string `json:"specification_id"`
}

// PatchVPNGatewayRequest represents a request to patch a VPN gateway
type PatchVPNGatewayRequest struct {
Name string `json:"name,omitempty"`
}

// CreateVPNGatewayUserRequest represents a request to create a VPN gateway user
type CreateVPNGatewayUserRequest struct {
Name string `json:"name,omitempty"`
VPNGatewayID string `json:"vpn_gateway_id"`
Username string `json:"username"`
Password string `json:"password"`
}

// PatchVPNGatewayUserRequest represents a request to patch a VPN gateway user
type PatchVPNGatewayUserRequest struct {
Name string `json:"name,omitempty"`
Password string `json:"password,omitempty"`
}
Loading