open-nomad/vendor/github.com/denverdino/aliyungo/ecs/snat_entry.go
Seth Hoenig 435c0d9fc8 deps: Switch to Go modules for dependency management
This PR switches the Nomad repository from using govendor to Go modules
for managing dependencies. Aspects of the Nomad workflow remain pretty
much the same. The usual Makefile targets should continue to work as
they always did. The API submodule simply defers to the parent Nomad
version on the repository, keeping the semantics of API versioning that
currently exists.
2020-06-02 14:30:36 -05:00

104 lines
2.4 KiB
Go

package ecs
import "github.com/denverdino/aliyungo/common"
type CreateSnatEntryArgs struct {
RegionId common.Region
SnatTableId string
SourceVSwitchId string
SnatIp string
}
type CreateSnatEntryResponse struct {
common.Response
SnatEntryId string
}
type SnatEntrySetType struct {
RegionId common.Region
SnatEntryId string
SnatIp string
SnatTableId string
SourceCIDR string
SourceVSwitchId string
Status string
}
type DescribeSnatTableEntriesArgs struct {
RegionId common.Region
SnatTableId string
common.Pagination
}
type DescribeSnatTableEntriesResponse struct {
common.Response
common.PaginationResult
SnatTableEntries struct {
SnatTableEntry []SnatEntrySetType
}
}
type ModifySnatEntryArgs struct {
RegionId common.Region
SnatTableId string
SnatEntryId string
SnatIp string
}
type ModifySnatEntryResponse struct {
common.Response
}
type DeleteSnatEntryArgs struct {
RegionId common.Region
SnatTableId string
SnatEntryId string
}
type DeleteSnatEntryResponse struct {
common.Response
}
func (client *Client) CreateSnatEntry(args *CreateSnatEntryArgs) (resp *CreateSnatEntryResponse, err error) {
response := CreateSnatEntryResponse{}
err = client.Invoke("CreateSnatEntry", args, &response)
if err != nil {
return nil, err
}
return &response, err
}
func (client *Client) DescribeSnatTableEntries(args *DescribeSnatTableEntriesArgs) (snatTableEntries []SnatEntrySetType,
pagination *common.PaginationResult, err error) {
response, err := client.DescribeSnatTableEntriesWithRaw(args)
if err != nil {
return nil, nil, err
}
return response.SnatTableEntries.SnatTableEntry, &response.PaginationResult, nil
}
func (client *Client) DescribeSnatTableEntriesWithRaw(args *DescribeSnatTableEntriesArgs) (response *DescribeSnatTableEntriesResponse, err error) {
args.Validate()
response = &DescribeSnatTableEntriesResponse{}
err = client.Invoke("DescribeSnatTableEntries", args, response)
if err != nil {
return nil, err
}
return response, nil
}
func (client *Client) ModifySnatEntry(args *ModifySnatEntryArgs) error {
response := ModifySnatEntryResponse{}
return client.Invoke("ModifySnatEntry", args, &response)
}
func (client *Client) DeleteSnatEntry(args *DeleteSnatEntryArgs) error {
response := DeleteSnatEntryResponse{}
err := client.Invoke("DeleteSnatEntry", args, &response)
return err
}