Migrate to go-acme/lego.
This commit is contained in:
parent
4a68d29ce2
commit
87da7520de
286 changed files with 14021 additions and 2501 deletions
106
vendor/github.com/exoscale/egoscale/networks.go
generated
vendored
106
vendor/github.com/exoscale/egoscale/networks.go
generated
vendored
|
@ -1,7 +1,6 @@
|
|||
package egoscale
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/url"
|
||||
)
|
||||
|
@ -16,12 +15,10 @@ type Network struct {
|
|||
BroadcastURI string `json:"broadcasturi,omitempty" doc:"broadcast uri of the network."`
|
||||
CanUseForDeploy bool `json:"canusefordeploy,omitempty" doc:"list networks available for vm deployment"`
|
||||
CIDR *CIDR `json:"cidr,omitempty" doc:"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR"`
|
||||
DisplayNetwork bool `json:"displaynetwork,omitempty" doc:"an optional field, whether to the display the network to the end user or not."`
|
||||
DisplayText string `json:"displaytext,omitempty" doc:"the displaytext of the network"`
|
||||
DNS1 net.IP `json:"dns1,omitempty" doc:"the first DNS for the network"`
|
||||
DNS2 net.IP `json:"dns2,omitempty" doc:"the second DNS for the network"`
|
||||
Domain string `json:"domain,omitempty" doc:"the domain name of the network owner"`
|
||||
DomainID *UUID `json:"domainid,omitempty" doc:"the domain id of the network owner"`
|
||||
EndIP net.IP `json:"endip,omitempty" doc:"the ending IP address in the network IP range. Required for managed networks."`
|
||||
Gateway net.IP `json:"gateway,omitempty" doc:"the network's gateway"`
|
||||
ID *UUID `json:"id,omitempty" doc:"the id of the network"`
|
||||
IP6CIDR *CIDR `json:"ip6cidr,omitempty" doc:"the cidr of IPv6 network"`
|
||||
|
@ -44,6 +41,7 @@ type Network struct {
|
|||
RestartRequired bool `json:"restartrequired,omitempty" doc:"true network requires restart"`
|
||||
Service []Service `json:"service,omitempty" doc:"the list of services"`
|
||||
SpecifyIPRanges bool `json:"specifyipranges,omitempty" doc:"true if network supports specifying ip ranges, false otherwise"`
|
||||
StartIP net.IP `json:"startip,omitempty" doc:"the beginning IP address in the network IP range. Required for managed networks."`
|
||||
State string `json:"state,omitempty" doc:"state of the network"`
|
||||
StrechedL2Subnet bool `json:"strechedl2subnet,omitempty" doc:"true if network can span multiple zones"`
|
||||
SubdomainAccess bool `json:"subdomainaccess,omitempty" doc:"true if users from subdomains can access the domain level network"`
|
||||
|
@ -60,9 +58,8 @@ type Network struct {
|
|||
func (network Network) ListRequest() (ListCommand, error) {
|
||||
//TODO add tags support
|
||||
req := &ListNetworks{
|
||||
Account: network.Account,
|
||||
DomainID: network.DomainID,
|
||||
ID: network.ID,
|
||||
Keyword: network.Name, // this is a hack as listNetworks doesn't support to search by name.
|
||||
PhysicalNetworkID: network.PhysicalNetworkID,
|
||||
TrafficType: network.TrafficType,
|
||||
Type: network.Type,
|
||||
|
@ -110,30 +107,27 @@ type ServiceProvider struct {
|
|||
|
||||
// CreateNetwork creates a network
|
||||
type CreateNetwork struct {
|
||||
Account string `json:"account,omitempty" doc:"account who will own the network"`
|
||||
DisplayNetwork *bool `json:"displaynetwork,omitempty" doc:"an optional field, whether to the display the network to the end user or not."`
|
||||
DisplayText string `json:"displaytext,omitempty" doc:"the display text of the network"` // This field is required but might be empty
|
||||
DomainID *UUID `json:"domainid,omitempty" doc:"domain ID of the account owning a network"`
|
||||
EndIP net.IP `json:"endip,omitempty" doc:"the ending IP address in the network IP range. If not specified, will be defaulted to startIP"`
|
||||
EndIP net.IP `json:"endip,omitempty" doc:"the ending IP address in the network IP range. Required for managed networks."`
|
||||
EndIpv6 net.IP `json:"endipv6,omitempty" doc:"the ending IPv6 address in the IPv6 network range"`
|
||||
Gateway net.IP `json:"gateway,omitempty" doc:"the gateway of the network. Required for Shared networks and Isolated networks when it belongs to VPC"`
|
||||
IP6CIDR *CIDR `json:"ip6cidr,omitempty" doc:"the CIDR of IPv6 network, must be at least /64"`
|
||||
IP6Gateway net.IP `json:"ip6gateway,omitempty" doc:"the gateway of the IPv6 network. Required for Shared networks and Isolated networks when it belongs to VPC"`
|
||||
IsolatedPVlan string `json:"isolatedpvlan,omitempty" doc:"the isolated private vlan for this network"`
|
||||
Name string `json:"name,omitempty" doc:"the name of the network"` // This field is required but might be empty
|
||||
Netmask net.IP `json:"netmask,omitempty" doc:"the netmask of the network. Required for Shared networks and Isolated networks when it belongs to VPC"`
|
||||
Netmask net.IP `json:"netmask,omitempty" doc:"the netmask of the network. Required for managed networks."`
|
||||
NetworkDomain string `json:"networkdomain,omitempty" doc:"network domain"`
|
||||
NetworkOfferingID *UUID `json:"networkofferingid" doc:"the network offering id"`
|
||||
PhysicalNetworkID *UUID `json:"physicalnetworkid,omitempty" doc:"the Physical Network ID the network belongs to"`
|
||||
StartIP net.IP `json:"startip,omitempty" doc:"the beginning IP address in the network IP range"`
|
||||
StartIP net.IP `json:"startip,omitempty" doc:"the beginning IP address in the network IP range. Required for managed networks."`
|
||||
StartIpv6 net.IP `json:"startipv6,omitempty" doc:"the beginning IPv6 address in the IPv6 network range"`
|
||||
SubdomainAccess *bool `json:"subdomainaccess,omitempty" doc:"Defines whether to allow subdomains to use networks dedicated to their parent domain(s). Should be used with aclType=Domain, defaulted to allow.subdomain.network.access global config if not specified"`
|
||||
Vlan string `json:"vlan,omitempty" doc:"the ID or VID of the network"`
|
||||
ZoneID *UUID `json:"zoneid" doc:"the Zone ID for the network"`
|
||||
_ bool `name:"createNetwork" description:"Creates a network"`
|
||||
}
|
||||
|
||||
func (CreateNetwork) response() interface{} {
|
||||
// Response returns the struct to unmarshal
|
||||
func (CreateNetwork) Response() interface{} {
|
||||
return new(Network)
|
||||
}
|
||||
|
||||
|
@ -150,23 +144,26 @@ func (req CreateNetwork) onBeforeSend(params url.Values) error {
|
|||
|
||||
// UpdateNetwork (Async) updates a network
|
||||
type UpdateNetwork struct {
|
||||
ID *UUID `json:"id" doc:"the ID of the network"`
|
||||
_ bool `name:"updateNetwork" description:"Updates a network"`
|
||||
ChangeCIDR *bool `json:"changecidr,omitempty" doc:"Force update even if cidr type is different"`
|
||||
CustomID *UUID `json:"customid,omitempty" doc:"an optional field, in case you want to set a custom id to the resource. Allowed to Root Admins only"`
|
||||
DisplayNetwork *bool `json:"displaynetwork,omitempty" doc:"an optional field, whether to the display the network to the end user or not."`
|
||||
DisplayText string `json:"displaytext,omitempty" doc:"the new display text for the network"`
|
||||
EndIP net.IP `json:"endip,omitempty" doc:"the ending IP address in the network IP range. Required for managed networks."`
|
||||
GuestVMCIDR *CIDR `json:"guestvmcidr,omitempty" doc:"CIDR for Guest VMs,Cloudstack allocates IPs to Guest VMs only from this CIDR"`
|
||||
ID *UUID `json:"id" doc:"the ID of the network"`
|
||||
Name string `json:"name,omitempty" doc:"the new name for the network"`
|
||||
Netmask net.IP `json:"netmask,omitempty" doc:"the netmask of the network. Required for managed networks."`
|
||||
NetworkDomain string `json:"networkdomain,omitempty" doc:"network domain"`
|
||||
NetworkOfferingID *UUID `json:"networkofferingid,omitempty" doc:"network offering ID"`
|
||||
_ bool `name:"updateNetwork" description:"Updates a network"`
|
||||
StartIP net.IP `json:"startip,omitempty" doc:"the beginning IP address in the network IP range. Required for managed networks."`
|
||||
}
|
||||
|
||||
func (UpdateNetwork) response() interface{} {
|
||||
// Response returns the struct to unmarshal
|
||||
func (UpdateNetwork) Response() interface{} {
|
||||
return new(AsyncJobResult)
|
||||
}
|
||||
|
||||
func (UpdateNetwork) asyncResponse() interface{} {
|
||||
// AsyncResponse returns the struct to unmarshal the async job
|
||||
func (UpdateNetwork) AsyncResponse() interface{} {
|
||||
return new(Network)
|
||||
}
|
||||
|
||||
|
@ -177,11 +174,13 @@ type RestartNetwork struct {
|
|||
_ bool `name:"restartNetwork" description:"Restarts the network; includes 1) restarting network elements - virtual routers, dhcp servers 2) reapplying all public ips 3) reapplying loadBalancing/portForwarding rules"`
|
||||
}
|
||||
|
||||
func (RestartNetwork) response() interface{} {
|
||||
// Response returns the struct to unmarshal
|
||||
func (RestartNetwork) Response() interface{} {
|
||||
return new(AsyncJobResult)
|
||||
}
|
||||
|
||||
func (RestartNetwork) asyncResponse() interface{} {
|
||||
// AsyncResponse returns the struct to unmarshal the async job
|
||||
func (RestartNetwork) AsyncResponse() interface{} {
|
||||
return new(Network)
|
||||
}
|
||||
|
||||
|
@ -192,35 +191,34 @@ type DeleteNetwork struct {
|
|||
_ bool `name:"deleteNetwork" description:"Deletes a network"`
|
||||
}
|
||||
|
||||
func (DeleteNetwork) response() interface{} {
|
||||
// Response returns the struct to unmarshal
|
||||
func (DeleteNetwork) Response() interface{} {
|
||||
return new(AsyncJobResult)
|
||||
}
|
||||
|
||||
func (DeleteNetwork) asyncResponse() interface{} {
|
||||
return new(booleanResponse)
|
||||
// AsyncResponse returns the struct to unmarshal the async job
|
||||
func (DeleteNetwork) AsyncResponse() interface{} {
|
||||
return new(BooleanResponse)
|
||||
}
|
||||
|
||||
//go:generate go run generate/main.go -interface=Listable ListNetworks
|
||||
|
||||
// ListNetworks represents a query to a network
|
||||
type ListNetworks struct {
|
||||
Account string `json:"account,omitempty" doc:"list resources by account. Must be used with the domainId parameter."`
|
||||
CanUseForDeploy *bool `json:"canusefordeploy,omitempty" doc:"list networks available for vm deployment"`
|
||||
DisplayNetwork *bool `json:"displaynetwork,omitempty" doc:"list resources by display flag; only ROOT admin is eligible to pass this parameter"`
|
||||
DomainID *UUID `json:"domainid,omitempty" doc:"list only resources belonging to the domain specified"`
|
||||
ID *UUID `json:"id,omitempty" doc:"list networks by id"`
|
||||
IsRecursive *bool `json:"isrecursive,omitempty" doc:"defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves."`
|
||||
IsSystem *bool `json:"issystem,omitempty" doc:"true if network is system, false otherwise"`
|
||||
CanUseForDeploy *bool `json:"canusefordeploy,omitempty" doc:"List networks available for vm deployment"`
|
||||
ID *UUID `json:"id,omitempty" doc:"List networks by id"`
|
||||
IsSystem *bool `json:"issystem,omitempty" doc:"true If network is system, false otherwise"`
|
||||
Keyword string `json:"keyword,omitempty" doc:"List by keyword"`
|
||||
ListAll *bool `json:"listall,omitempty" doc:"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"`
|
||||
Page int `json:"page,omitempty"`
|
||||
PageSize int `json:"pagesize,omitempty"`
|
||||
PhysicalNetworkID *UUID `json:"physicalnetworkid,omitempty" doc:"list networks by physical network id"`
|
||||
RestartRequired *bool `json:"restartrequired,omitempty" doc:"list networks by restartRequired"`
|
||||
SpecifyIPRanges *bool `json:"specifyipranges,omitempty" doc:"true if need to list only networks which support specifying ip ranges"`
|
||||
SupportedServices []Service `json:"supportedservices,omitempty" doc:"list networks supporting certain services"`
|
||||
PhysicalNetworkID *UUID `json:"physicalnetworkid,omitempty" doc:"List networks by physical network id"`
|
||||
RestartRequired *bool `json:"restartrequired,omitempty" doc:"List networks by restartRequired"`
|
||||
SpecifyIPRanges *bool `json:"specifyipranges,omitempty" doc:"True if need to list only networks which support specifying ip ranges"`
|
||||
SupportedServices []Service `json:"supportedservices,omitempty" doc:"List networks supporting certain services"`
|
||||
Tags []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"`
|
||||
TrafficType string `json:"traffictype,omitempty" doc:"type of the traffic"`
|
||||
Type string `json:"type,omitempty" doc:"the type of the network. Supported values are: Isolated and Shared"`
|
||||
ZoneID *UUID `json:"zoneid,omitempty" doc:"the Zone ID of the network"`
|
||||
TrafficType string `json:"traffictype,omitempty" doc:"Type of the traffic"`
|
||||
Type string `json:"type,omitempty" doc:"The type of the network. Supported values are: Isolated and Shared"`
|
||||
ZoneID *UUID `json:"zoneid,omitempty" doc:"The Zone ID of the network"`
|
||||
_ bool `name:"listNetworks" description:"Lists all available networks."`
|
||||
}
|
||||
|
||||
|
@ -229,31 +227,3 @@ type ListNetworksResponse struct {
|
|||
Count int `json:"count"`
|
||||
Network []Network `json:"network"`
|
||||
}
|
||||
|
||||
func (ListNetworks) response() interface{} {
|
||||
return new(ListNetworksResponse)
|
||||
}
|
||||
|
||||
// SetPage sets the current page
|
||||
func (listNetwork *ListNetworks) SetPage(page int) {
|
||||
listNetwork.Page = page
|
||||
}
|
||||
|
||||
// SetPageSize sets the page size
|
||||
func (listNetwork *ListNetworks) SetPageSize(pageSize int) {
|
||||
listNetwork.PageSize = pageSize
|
||||
}
|
||||
|
||||
func (ListNetworks) each(resp interface{}, callback IterateItemFunc) {
|
||||
networks, ok := resp.(*ListNetworksResponse)
|
||||
if !ok {
|
||||
callback(nil, fmt.Errorf("type error: ListNetworksResponse expected, got %T", resp))
|
||||
return
|
||||
}
|
||||
|
||||
for i := range networks.Network {
|
||||
if !callback(&networks.Network[i], nil) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue