-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Implement most Zone and all Zone Plan endpoints
* Move Zone types to zone.go * flarectl: zone info: show vanity name servers. The `zone info` command was always listing the default name servers even if custom name servers are configured. * Response is an array of code/message, not strings. Add a new ResponseInfo struct containing the Code and Message fields, have the Response struct return a slice of ResponseInfo instead of a slice of strings. * It seems the response info can also have a field "type" but I've yet to see it return anything other than null, so omitting that for now. * zone: Implement ZoneActivationCheck. This is used for initiating a manual zone activation check for new zones. * zone: Implement ZoneDetails. This is functionally similar to ListZones, but takes a zoneID instead of a list of zone names and only returns information about a single zone. The information returned by the API is still an array. * zone: Add ZoneID and ZoneIDRepsonse types. Some of the Zone endpoints return only the zone ID. This adds a new type to return just the ID rather than using an entire Zone object. * zone: Implement DeleteZone * zone: Implement AvailableZonePlans and ZonePlanDetails * zone: Tidy up godoc comments. We don't need the HTTP call in the comment as it's not useful to the library user. Add a blank line before "API reference" and put the URL on the same line to make it look tidier. * zone: Implement CreateZone * Add missing godoc comment for ResponseInfo * flarectl: correct usage for `zone create` * zone: Split ZoneResponse. Some endpoints return a single Zone, some an array of Zones. Split this response struct into ZoneResponse and ZonesResponse to handle that and update all return values as appropriate. * zone: Implement zone edit methods. Add four new methods: EditZone, ZoneSetPaused, ZoneSetVanityNS and ZoneSetPlan. This also sets most of the ZonePlan fields to `omitempty` so that we can pass a plan ID when changing a zone's plan. EditZone wouldn't normally be called directly but is made public in case the consumer chooses to do so. ZoneSetPaused currently can only pause and not un-pause. This needs to be fixed. * zone: Add missing error checks
- Loading branch information
Showing
4 changed files
with
366 additions
and
143 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
Oops, something went wrong.