Skip to content

Commit

Permalink
Add support for allow_missing in updates of projects, APIs, and versi…
Browse files Browse the repository at this point in the history
…ons (#379)

* Add allow_missing fields to project, API, and version update request messages.
* Update generated proto code.
* Add allow_missing support to projects, APIs, and versions
* Add tests for allow_missing in project, API, and version updates.
* Add locks to address race conditions in allow_missing updates.
  • Loading branch information
timburks authored Nov 3, 2021
1 parent 9921f08 commit bfaf5c2
Show file tree
Hide file tree
Showing 12 changed files with 1,144 additions and 908 deletions.
4 changes: 4 additions & 0 deletions google/cloud/apigeeregistry/v1/admin_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ message UpdateProjectRequest {
// If a "*" is specified, all fields are updated, including fields that are
// unspecified/default in the request.
google.protobuf.FieldMask update_mask = 2;

// If set to true, and the project is not found, a new project will be created.
// In this situation, `update_mask` is ignored.
bool allow_missing = 3;
}

// Request message for DeleteProject.
Expand Down
8 changes: 8 additions & 0 deletions google/cloud/apigeeregistry/v1/registry_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ message UpdateApiRequest {
// If a "*" is specified, all fields are updated, including fields that are
// unspecified/default in the request.
google.protobuf.FieldMask update_mask = 2;

// If set to true, and the api is not found, a new api_versions will be created.
// In this situation, `update_mask` is ignored.
bool allow_missing = 3;
}

// Request message for DeleteApi.
Expand Down Expand Up @@ -608,6 +612,10 @@ message UpdateApiVersionRequest {
// If a "*" is specified, all fields are updated, including fields that are
// unspecified/default in the request.
google.protobuf.FieldMask update_mask = 2;

// If set to true, and the version is not found, a new version will be created.
// In this situation, `update_mask` is ignored.
bool allow_missing = 3;
}

// Request message for DeleteApiVersion.
Expand Down
138 changes: 75 additions & 63 deletions rpc/admin_service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bfaf5c2

Please sign in to comment.