-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added sub resource operators, separated types
- Loading branch information
Showing
16 changed files
with
376 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package port | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/ureuzy/acos-client-go/pkg/rest" | ||
"github.com/ureuzy/acos-client-go/utils" | ||
) | ||
|
||
// Docs: https://acos.docs.a10networks.com/axapi/521p2/axapiv3/gslb_service_ip_port.html | ||
// URI: /axapi/v3/gslb/service-ip/{node-name}/port/{port-num}+{port-proto} | ||
|
||
func New(c utils.HTTPClient, basePath string) rest.Operator[Body, ListBody] { | ||
const path = "service-ip/%s/port" | ||
return rest.Rest[Body, ListBody](c, fmt.Sprintf("%s/%s", basePath, path)) | ||
} | ||
|
||
type ListBody struct { | ||
ListObjects `json:"port-list"` | ||
} | ||
|
||
type Body struct { | ||
Port `json:"port"` | ||
} | ||
|
||
type ListObjects []Port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package port | ||
|
||
import "github.com/ureuzy/acos-client-go/pkg/axapi/shared" | ||
|
||
// Object Docs: https://acos.docs.a10networks.com/axapi/521p2/axapiv3/gslb_service_ip.html#service-ip-attributes | ||
|
||
type Port struct { | ||
shared.AxaBase `json:",inline"` | ||
PortNum int `json:"port-num,omitempty"` | ||
PortProto string `json:"port-proto,omitempty"` | ||
Action string `json:"action,omitempty"` //"enum":["enable", "disable"] | ||
HealthCheck string `json:"health-check,omitempty"` | ||
HealthCheckFollowPort int `json:"health-check-follow-port,omitempty"` | ||
FollowPortProtocol string `json:"follow-port-protocol,omitempty"` | ||
HealthCheckProtocolDisable shared.Boolean `json:"health-check-protocol-disable,omitempty"` | ||
HealthCheckDisable shared.Boolean `json:"health-check-disable,omitempty"` | ||
SamplingEnable []shared.SamplingEnable `json:"sampling-enable,omitempty"` //"enum":["all","active","current"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package serviceip | ||
|
||
import ( | ||
"github.com/ureuzy/acos-client-go/pkg/axapi/gslb/serviceip/port" | ||
"github.com/ureuzy/acos-client-go/pkg/axapi/shared" | ||
) | ||
|
||
// Object Docs: https://acos.docs.a10networks.com/axapi/521p2/axapiv3/gslb_service_ip.html#service-ip-attributes | ||
|
||
type Object struct { | ||
shared.AxaBase `json:",inline"` | ||
NodeName string `json:"node-name,omitempty"` | ||
IPv6Address string `json:"ipv6-address,omitempty"` | ||
IPAddress string `json:"ip-address,omitempty"` | ||
Action string `json:"action,omitempty"` //"enum":["enable", "disable"] | ||
ExternalIP string `json:"external-ip,omitempty"` | ||
IPv6 string `json:"ipv6,omitempty"` | ||
HealthCheck string `json:"health-check,omitempty"` | ||
HealthCheckProtocolDisable shared.Boolean `json:"health-check-protocol-disable,omitempty"` | ||
HealthCheckDisable shared.Boolean `json:"health-check-disable,omitempty"` | ||
SamplingEnable []shared.SamplingEnable `json:"sampling-enable,omitempty"` //"enum":["all","hits","recent"] | ||
PortList []port.Port `json:"port-list,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package ipserver | ||
|
||
import "github.com/ureuzy/acos-client-go/pkg/axapi/shared" | ||
|
||
type IPServer struct { | ||
shared.AxaBase `json:",inline"` | ||
IPServerName string `json:"ip-server-name,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
package service | ||
|
||
import ( | ||
"github.com/ureuzy/acos-client-go/pkg/axapi/shared" | ||
) | ||
|
||
type Service struct { | ||
shared.AxaBase `json:",inline"` | ||
ServicePort int `json:"service-port,omitempty"` | ||
ServiceName string `json:"service-name,omitempty"` | ||
Action string `json:"action,omitempty"` // "enum":[ "drop", "forward", "ignore", "reject"] | ||
ForwardType string `json:"forward-type,omitempty"` // "enum":[ "both", "query", "response"] | ||
Disable shared.Boolean `json:"disable,omitempty"` | ||
HealthCheckGateway string `json:"health-check-gateway,omitempty"` //"enum":[ "enable", "disable"] | ||
HealthCheckPort []HealthCheckPort `json:"health-check-port,omitempty"` | ||
Policy string `json:"policy,omitempty"` | ||
SamplingEnable []shared.SamplingEnable `json:"sampling-enable,omitempty"` // "enum":[ "all", "received-query", "sent-response", "proxy-mode-response", "cache-mode-response", "server-mode-response", "sticky-mode-response", "backup-mode-response"] | ||
DNSARecord DNSARecord `json:"dns-a-record,omitempty"` | ||
DNSCNAMERecordList []DNSCnameRecord `json:"dns-cname-record-list,omitempty"` | ||
DNSMXRecordList []DNSMXRecord `json:"dns-mx-record-list,omitempty"` | ||
DNSNSRecordList []DNSMXRecord `json:"dns-ns-record-list,omitempty"` | ||
DNSPtrRecordList []TodoRecord `json:"dns-ptr-record-list,omitempty"` | ||
DNSSrvRecordList []TodoRecord `json:"dns-srv-record-list,omitempty"` | ||
DNSNaptrRecordList []TodoRecord `json:"dns-naptr-record-list,omitempty"` | ||
DNSTxtRecordList []TodoRecord `json:"dns-txt-record-list,omitempty"` | ||
DNSRecordList []TodoRecord `json:"dns-record-list,omitempty"` | ||
GeoLocationList []TodoRecord `json:"geo-location-list,omitempty"` | ||
} | ||
|
||
type DNSSOARecord struct { | ||
SOAName string `json:"soa-name,omitempty"` | ||
Mail string `json:"mail,omitempty"` | ||
Expire int `json:"expire,omitempty"` | ||
Refresh int `json:"refresh,omitempty"` | ||
Retry int `json:"retry,omitempty"` | ||
Serial int `json:"serial,omitempty"` | ||
SOATTL int `json:"soa-ttl,omitempty"` | ||
External string `json:"external,omitempty"` | ||
ExMail string `json:"ex-mail,omitempty"` | ||
ExEpire int `json:"ex-expire,omitempty"` | ||
ExRefresh int `json:"ex-refresh,omitempty"` | ||
ExRetry int `json:"ex-retry,omitempty"` | ||
ExSerial int `json:"ex-serial,omitempty"` | ||
ExSoaTTL int `json:"ex-soa-ttl,omitempty"` | ||
} | ||
|
||
type DNSMXRecord struct { | ||
shared.AxaBase `json:",inline"` | ||
} | ||
|
||
type DNSNSRecord struct { | ||
shared.AxaBase `json:",inline"` | ||
} | ||
|
||
type TodoRecord struct { | ||
// TODO | ||
} | ||
|
||
type HealthCheckPort struct { | ||
HealthCheckPort int `json:"health-check-port,omitempty"` | ||
} | ||
|
||
type DNSARecord struct { | ||
DNSARecordSrvList []DNSARecordSrv `json:"dns-a-record-srv-list,omitempty"` | ||
DNSARecordIPv4List []DNSARecordIPv4 `json:"dns-a-record-ipv4-list,omitempty"` | ||
DNSARecordIPv6List []DNSARecordIPv6 `json:"dns-a-record-ipv6-list,omitempty"` | ||
} | ||
|
||
type DNSCnameRecord struct { | ||
AliasName string `json:"alias-name,omitempty"` | ||
AdminPreference shared.Boolean `json:"admin-preference,omitempty"` | ||
Weight int `json:"weight,omitempty"` | ||
AsBackup shared.Boolean `json:"as-backup,omitempty"` | ||
SamplingEnable []shared.SamplingEnable `json:"sampling-enable,omitempty"` // "enum":[ "all", "cname-hits"] | ||
} | ||
|
||
type DNSARecordSrv struct { | ||
shared.AxaBase | ||
SvrName string `json:"svrname,omitempty"` | ||
NoResp shared.Boolean `json:"no-resp,omitempty"` | ||
AsBackup shared.Boolean `json:"as-backup,omitempty"` | ||
Weight int `json:"weight,omitempty"` | ||
TTL int `json:"ttl,omitempty"` | ||
AsReplace shared.Boolean `json:"as-replace,omitempty"` | ||
Disable shared.Boolean `json:"disable,omitempty"` | ||
Static shared.Boolean `json:"static,omitempty"` | ||
AdminIP int `json:"admin-ip,omitempty"` | ||
} | ||
|
||
type DNSARecordIPv4 struct { | ||
shared.AxaBase | ||
DNSARecordIP string `json:"dns-a-record-ip,omitempty"` | ||
NoResp shared.Boolean `json:"no-resp,omitempty"` | ||
AsBackup shared.Boolean `json:"as-backup,omitempty"` | ||
Weight int `json:"weight,omitempty"` | ||
TTL int `json:"ttl,omitempty"` | ||
AsReplace shared.Boolean `json:"as-replace,omitempty"` | ||
Disable shared.Boolean `json:"disable,omitempty"` | ||
Static shared.Boolean `json:"static,omitempty"` | ||
AdminIP int `json:"admin-ip,omitempty"` | ||
} | ||
|
||
type DNSARecordIPv6 struct { | ||
shared.AxaBase | ||
DNSARecordIP string `json:"dns-a-record-ipv6,omitempty"` | ||
NoResp shared.Boolean `json:"no-resp,omitempty"` | ||
AsBackup shared.Boolean `json:"as-backup,omitempty"` | ||
Weight int `json:"weight,omitempty"` | ||
TTL int `json:"ttl,omitempty"` | ||
AsReplace shared.Boolean `json:"as-replace,omitempty"` | ||
Disable shared.Boolean `json:"disable,omitempty"` | ||
Static shared.Boolean `json:"static,omitempty"` | ||
AdminIP int `json:"admin-ip,omitempty"` | ||
} |
Oops, something went wrong.