-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resell V2 API - add subnets Create method (#47)
Add Create method for the Subnets package. Add tests and doc example.
- Loading branch information
1 parent
f542c46
commit dc4fe6b
Showing
6 changed files
with
213 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package subnets | ||
|
||
import "github.com/selectel/go-selvpcclient/selvpcclient" | ||
|
||
// SubnetOpts represents options for the subnets Create request. | ||
type SubnetOpts struct { | ||
// Subnets represents options for all subnets. | ||
Subnets []SubnetOpt `json:"subnets"` | ||
} | ||
|
||
// SubnetOpt represents options for the single subnet. | ||
type SubnetOpt struct { | ||
// Region represents a region of where the subnet should reside. | ||
Region string `json:"region"` | ||
|
||
// Quantity represents how many subnets do we need to create. | ||
Quantity int `json:"quantity"` | ||
|
||
// Type represents ip version type. | ||
Type selvpcclient.IPVersion `json:"type"` | ||
|
||
// PrefixLength represents length of the subnet prefix. | ||
PrefixLength int `json:"prefix_length"` | ||
} |
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