Add domain-zone record create and delete, commands#108
Conversation
Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
8eb469e to
f6620db
Compare
amstuta
left a comment
There was a problem hiding this comment.
Thanks for your contribution @TheoBrigitte !
Just added a few comments but almost good to merge :)
Co-authored-by: Arthur Amstutz <18141571+amstuta@users.noreply.github.com> Signed-off-by: Théo Brigitte <theo.brigitte@gmail.com>
Co-authored-by: Arthur Amstutz <18141571+amstuta@users.noreply.github.com> Signed-off-by: Théo Brigitte <theo.brigitte@gmail.com>
Co-authored-by: Arthur Amstutz <18141571+amstuta@users.noreply.github.com> Signed-off-by: Théo Brigitte <theo.brigitte@gmail.com>
Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
608f47c to
7caa15f
Compare
internal/cmd/domainzone_test.go
Outdated
| }`), | ||
| ) | ||
|
|
||
| out, err := cmd.Execute("domain-zone", "record", "create", "example.com", "--fieldType", "A", "--subdomain", "example-created", "--target", "127.0.0.1", "--ttl", "0") |
There was a problem hiding this comment.
| out, err := cmd.Execute("domain-zone", "record", "create", "example.com", "--fieldType", "A", "--subdomain", "example-created", "--target", "127.0.0.1", "--ttl", "0") | |
| out, err := cmd.Execute("domain-zone", "record", "create", "example.com", "--field-type", "A", "--sub-domain", "example-created", "--target", "127.0.0.1", "--ttl", "0") |
There was a problem hiding this comment.
The subdomain flag will then become inconsistent with the one used in the update record command.
There was a problem hiding this comment.
oups my bad I missed this, in this case you're right we should keep subdomain everywhere
Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
|
My bad I had not pushed my changes. It should be alright now. |
amstuta
left a comment
There was a problem hiding this comment.
Just a small change of URLs to use (prefix /v1 to add) and we're good to merge ;)
Co-authored-by: Arthur Amstutz <18141571+amstuta@users.noreply.github.com> Signed-off-by: Théo Brigitte <theo.brigitte@gmail.com>
Co-authored-by: Arthur Amstutz <18141571+amstuta@users.noreply.github.com> Signed-off-by: Théo Brigitte <theo.brigitte@gmail.com>
|
Alright, should be good now :) |
|
@TheoBrigitte you have some tests failing due to the URL change (I think). Could you fix them, and then we'll be able to merge ? :) |
|
That's fixed :) |
c5a1e57 to
275b014
Compare
|
These commands do not appear in the CLI!!!??? My version is 0.9.0 @TheoBrigitte @amstuta ovhcloud domain-zone record --help
Retrieve information and manage your DNS records within a zone
Usage:
ovhcloud domain-zone record [command]
Available Commands:
get Get a single DNS record from your zone
update Update a single DNS record from your zone
Flags:
-h, --help help for record
Global Flags:
-d, --debug Activate debug mode (will log all HTTP requests details)
-f, --format string Output value according to given format (expression using https://github.com/PaesslerAG/gval syntax)
Examples:
--format 'id' (to extract a single field)
--format 'nested.field.subfield' (to extract a nested field)
--format '[id, 'name']' (to extract multiple fields as an array)
--format '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
--format 'name+","+type' (to extract and concatenate fields in a string)
--format '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
-i, --interactive Interactive output
-j, --json Output in JSON
-y, --yaml Output in YAML
Use "ovhcloud domain-zone record [command] --help" for more information about a command.
|
Fixes #104
Description
This PR introduces 2 new
domain-zone recordsub-commands to create and delete DNS records.The create command is similar to the update one which allow to use a file or the editor with a pre-filled schema. I've listed the records type in the
--fieldTypehelp text. Also I was unsure if I should use camel case or not for this flag. Most help texts have been taken straight out of the API documentation.The delete command is fairly straightforward and just issue an HTTP Delete with to the right endpoint.
Tests have been added, along with docs.
Type of changea
Checklist:
make docgo mod tidy