feat(resource-link): Add Service Resource commands#800
feat(resource-link): Add Service Resource commands#800awilliams-fastly merged 13 commits intomainfrom
Conversation
77e4aa9 to
ac4b804
Compare
https://developer.fastly.com/reference/api/services/resource/ This adds a `service-resource` sub-command which has associated create, delete, list, and update commands. Some of the names in the API may be confusing. I've done my best to add clarification whenever possible. Specifically: - A resource, as named by the API, is truly a _link_ between a service and a resource (e.g. an Object Store), not the resource itself. I've tried to use "resource **link**" wherever appropriate, as also used by the API docs: > A resource represents a link between a resource type and a service version. - In some places, the API mixes `id` and `resource_id` which both refer to the ID of the resource _link_, and not the resource itself. I've changed this so that `id` always refers the resource link, and `resource_id` to the linked to object. See this code comment: https://github.com/fastly/go-fastly/blob/ef4694a59779f202d8ea630b41333eb2b76969e8/fastly/resource.go#L125-L129 - It's possible to provide a resource link name. If set, this is an alias for the resource. Otherwise, whatever name was used when creating the resource itself will be the name to reference from the service for the resource. I've added to the description that this is an _alias_. See this code comment: https://github.com/fastly/go-fastly/blob/ef4694a59779f202d8ea630b41333eb2b76969e8/fastly/resource.go#L86-L88 I'd like to look into modifying `go-fastly` to remove the need for the `jsonResource` type, and also into updating the API to be more consistent with `id` vs `resource_id`.
ac4b804 to
58f932b
Compare
This comes with changes specific to the Resource API: - Renamed `resource_id` to `id` when referencing resource (link) ID - Added `json` tags to the Resource type
|
Bikeshedding on the command name, I wonder if |
globals -> g data -> m
|
@joeshaw to be honest for me either the current
I'm not sure which 'description' I'm more likely to say in my head when looking at the command. At a push my gut says |
|
The UI will eventually be updated with a top-level For this reason, I think that |
This better matches the language used in Fastly's web UI.

https://developer.fastly.com/reference/api/services/resource/
This adds a
resource-linksub-command which has associated create, delete, list, and update commands.Upgraded github.com/fastly/go-fastly/v7 v7.1.0 => v7.2.0
Some of the names in the API may be confusing. I've done my best to add clarification whenever possible. Specifically:
A resource, as named by the API, is truly a link between a service and a resource (e.g. an Object Store), not the resource itself. I've tried to use "resource link" wherever appropriate, as also used by the API docs:
Update 1d2eb20: uses a different base command name
resource-link.In some places, the API mixesFixed by resource: Improve parameter naming; support JSON encode go-fastly#394idandresource_idwhich both refer to the ID of the resource link, and not the resource itself. I've changed this so thatidalways refers the resource link, andresource_idto the linked to object.It's possible to provide a resource link name. If set, this is an alias for the resource. Otherwise, whatever name was used when creating the resource itself will be the name to reference from the service for the resource. I've added to the description that this is an alias. See this code comment: https://github.com/fastly/go-fastly/blob/ef4694a59779f202d8ea630b41333eb2b76969e8/fastly/resource.go#L86-L88
Keeping this as a draft until a new
go-fastlyrelease is created that incorporates fastly/go-fastly#394.