Repository navigation
Use consistent "update" verbs in our API based on the underlying RPC (PUT/PATCH). #321
Description
Activity
- addedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
on Nov 4, 2015 Option 3 sounds good to me too.
For services that only provide one of the two (i.e. resource manager only has "replace"), should we create an "update" method and mimic the PATCH support if it makes sense?
I'm for option (3) as well!
@ajkannan do you mean by getting a resource and then doing an update? I would avoid this as it might be inconsistent if the resource gets updated in the middle of the two calls.
We actually can't mimic the apiary PATCH in cases when read-modify-write is not supported (so in resource manager you can do that for
Policybut not forProject) and though One Platform seems
to be more lenient about it I suggest we do not do it.I think we should expose what the service provides and pick our canonical name for it.
I made the appropriate changes in resource manager. In
gcloud-java-datastore, we still useupdateinstead ofreplacefor entities. However, anEntityis slightly different than a metadata object likeBlobInfo, Policy, and ProjectInfo; perhaps that distinction should be made clear in the docs somewhere?Closing this issue since all necessary changes have been made.
- added 5 commits that reference this issue
on Jun 29, 2022 1 remaining item
- added 2 commits that reference this issue
on Oct 4, 2022 - added 2 commits that reference this issue
on Dec 22, 2025 - added a commit that references this issue
on Jan 22, 2026 - added a commit that references this issue
on Feb 24, 2026 - added a commit that references this issue
on Mar 12, 2026 - added a commit that references this issue
on Mar 23, 2026 - added a commit that references this issue
on Mar 30, 2026 - added a commit that references this issue
on Apr 1, 2026 - added a commit that references this issue
on Jul 13, 2026
When it comes to metadata, some apiary libraries provide "patch" operations, some provide "update" and others provide both.
In GCS API we picked the verb "update" for PATCH operation and we don't provide a "replace"/PUT
(which exists now in the apiary world but is probably going to be removed for gRPC).
I would like to avoid confusion when using different services, and suggests we always use the same
verb for metadata "patch" operations and a different one for metadata "replace" operations.
Some options for API names:
Other options are welcomed.
gRPC does not provide the apiary level PATCH support (it is up to the service), and One Platform
suggests to use HTTP PATCH for update operations that are partial or non-idempotent.
My preference is option (3)
/cc @mziccard @ajkannan @jgeewax