-
Notifications
You must be signed in to change notification settings - Fork 6
Redo search attribute management apis #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b532c08
7af36c3
c506e3a
9f5e290
8cc0dcc
e3db24b
a301f0a
7ff3fb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2024-05-13-00 | ||
| 2024-08-01-00 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ deps: | |
| - buf.build/googleapis/googleapis | ||
| breaking: | ||
| use: | ||
| - FILE | ||
| - WIRE | ||
| lint: | ||
| use: | ||
| - DEFAULT | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -98,12 +98,43 @@ service CloudService { | |||||
| } | ||||||
|
|
||||||
| // Rename an existing customer search attribute | ||||||
| // Deprecated: Use RenameSearchAttribute instead | ||||||
| rpc RenameCustomSearchAttribute (RenameCustomSearchAttributeRequest) returns (RenameCustomSearchAttributeResponse) { | ||||||
| option (google.api.http) = { | ||||||
| post: "/cloud/namespaces/{namespace}/rename-custom-search-attribute", | ||||||
| body: "*" | ||||||
| }; | ||||||
| } | ||||||
|
|
||||||
| // Get all search attributes registered for a namespace. | ||||||
| rpc GetSearchAttributes (GetSearchAttributesRequest) returns (GetSearchAttributesResponse) { | ||||||
| option (google.api.http) = { | ||||||
| get: "/cloud/namespaces/{namespace}/search-attributes", | ||||||
| }; | ||||||
| } | ||||||
|
|
||||||
| // Get a search attribute registered for a namespace. | ||||||
| rpc GetSearchAttribute (GetSearchAttributeRequest) returns (GetSearchAttributeResponse) { | ||||||
| option (google.api.http) = { | ||||||
| get: "/cloud/namespaces/{namespace}/search-attribute/{name}", | ||||||
| }; | ||||||
| } | ||||||
|
|
||||||
| // Add a new search attribute to a namespace. | ||||||
| rpc AddSearchAttribute(AddSearchAttributeRequest) returns (AddSearchAttributeResponse) { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This spacing is inconsistent (throughout this file, I just haven't really mentioned it before) |
||||||
| option (google.api.http) = { | ||||||
| post: "/cloud/namespaces/{namespace}/search-attributes", | ||||||
| body: "*" | ||||||
| }; | ||||||
| } | ||||||
|
|
||||||
| // Rename an existing search attribute. | ||||||
| rpc RenameSearchAttribute (RenameSearchAttributeRequest) returns (RenameSearchAttributeResponse) { | ||||||
| option (google.api.http) = { | ||||||
| post: "/cloud/namespaces/{namespace}/search-attribute/{name}/rename", | ||||||
| body: "*" | ||||||
| }; | ||||||
| } | ||||||
|
|
||||||
| // Delete a namespace | ||||||
| rpc DeleteNamespace (DeleteNamespaceRequest) returns (DeleteNamespaceResponse) { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package temporal.api.cloud.common.v1; | ||
|
|
||
| option go_package = "go.temporal.io/api/cloud/common/v1;common"; | ||
| option java_package = "io.temporal.api.cloud.common.v1"; | ||
| option java_multiple_files = true; | ||
| option java_outer_classname = "MessageProto"; | ||
| option ruby_package = "Temporalio::Api::Cloud::Common::V1"; | ||
| option csharp_namespace = "Temporalio.Api.Cloud.Common.V1"; | ||
|
|
||
|
|
||
| enum ResourceState { | ||
| RESOURCE_STATE_UNSPECIFIED = 0; | ||
| RESOURCE_STATE_ACTIVATING = 1; // The resource is being activated. | ||
| RESOURCE_STATE_ACTIVATION_FAILED = 2; // The resource failed to activate. This is an error state. Reach out to support for remediation. | ||
| RESOURCE_STATE_ACTIVE = 3; // The resource is active and ready to use. | ||
| RESOURCE_STATE_UPDATING = 4; // The resource is being updated. | ||
| RESOURCE_STATE_UPDATE_FAILED = 5; // The resource failed to update. This is an error state. Reach out to support for remediation. | ||
| RESOURCE_STATE_DELETING = 6; // The resource is being deleted. | ||
| RESOURCE_STATE_DELETE_FAILED = 7; // The resource failed to delete. This is an error state. Reach out to support for remediation. | ||
| RESOURCE_STATE_DELETED = 8; // The resource has been deleted. | ||
| RESOURCE_STATE_SUSPENDED = 9; // The resource is suspended and not available for use. Reach out to support for remediation. | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,7 @@ option java_outer_classname = "MessageProto"; | |||||||||
| option ruby_package = "Temporalio::Api::Cloud::Namespace::V1"; | ||||||||||
| option csharp_namespace = "Temporalio.Api.Cloud.Namespace.V1"; | ||||||||||
|
|
||||||||||
| import "temporal/api/cloud/common/v1/message.proto"; | ||||||||||
| import "google/protobuf/timestamp.proto"; | ||||||||||
|
|
||||||||||
| message CertificateFilterSpec { | ||||||||||
|
|
@@ -87,7 +88,9 @@ message NamespaceSpec { | |||||||||
| // Supported attribute types: text, keyword, int, double, bool, datetime, keyword_list. | ||||||||||
| // NOTE: currently deleting a search attribute is not supported. | ||||||||||
| // Optional, default is empty. | ||||||||||
| map<string, string> custom_search_attributes = 5; | ||||||||||
| // Deprecated: Use the AddSearchAttribute, RenameSearchAttribute operations instead to manage search attributes. | ||||||||||
| // temporal:versioning:max_version=2024-05-13-00 | ||||||||||
| map<string, string> custom_search_attributes = 5 [deprecated = true]; | ||||||||||
| // Codec server spec used by UI to decode payloads for all users interacting with this namespace. | ||||||||||
| // Optional, default is unset. | ||||||||||
| CodecServerSpec codec_server = 6; | ||||||||||
|
|
@@ -133,7 +136,12 @@ message Namespace { | |||||||||
| // The namespace specification. | ||||||||||
| NamespaceSpec spec = 3; | ||||||||||
| // The current state of the namespace. | ||||||||||
| string state = 4; | ||||||||||
| // Deprecated: Use state instead. | ||||||||||
| string state_deprecated = 4 [deprecated = true]; | ||||||||||
| // The current state of the namespace. | ||||||||||
| // For any failed state, reach out to Temporal Cloud support for remediation. | ||||||||||
| // temporal:enums:replaces=state_deprecated | ||||||||||
| temporal.api.cloud.common.v1.ResourceState state = 13; | ||||||||||
| // The id of the async operation that is creating/updating/deleting the namespace, if any. | ||||||||||
| string async_operation_id = 5; | ||||||||||
| // The endpoints for the namespace. | ||||||||||
|
|
@@ -158,7 +166,61 @@ message NamespaceRegionStatus { | |||||||||
| // The current state of the namespace region. | ||||||||||
| // Possible values: adding, active, passive, removing, failed. | ||||||||||
| // For any failed state, reach out to Temporal Cloud support for remediation. | ||||||||||
| string state = 1; | ||||||||||
| // Deprecated: Use state instead. | ||||||||||
| string state_deprecated = 1 [deprecated = true]; | ||||||||||
| // The current state of the namespace region. | ||||||||||
| // temporal:enums:replaces=state_deprecated | ||||||||||
| State state = 3; | ||||||||||
| // The id of the async operation that is making changes to where the namespace is available, if any. | ||||||||||
| string async_operation_id = 2; | ||||||||||
|
|
||||||||||
| enum State { | ||||||||||
| STATE_UNSPECIFIED = 0; | ||||||||||
| STATE_ADDING= 1; // The region is being added to the namespace. | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The changes to this enum seem unrelated to the current PR, is it intentional? |
||||||||||
| STATE_ACTIVE= 2; // The namespace is active in this region. | ||||||||||
|
Comment on lines
+179
to
+180
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| STATE_PASSIVE = 3; // The namespace is passive in this region. | ||||||||||
| STATE_REMOVING = 4; // The region is being removed from the namespace. | ||||||||||
| STATE_FAILED = 5; // The region failed to be added/removed, check failure_reason in the last async_operation status for more details. | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| message SearchAttributeSpec { | ||||||||||
| // The name of the search attribute. | ||||||||||
| // Once created, the name can be changed using the RenameSearchAttribute operation. | ||||||||||
| string name = 1; | ||||||||||
| // The type of the search attribute. | ||||||||||
| // The type of the search attribute cannot be changed once set. | ||||||||||
| SearchAttributeType type = 2; | ||||||||||
|
|
||||||||||
| enum SearchAttributeType { | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are inconsistent with how you prefix your inner enums/types. You have |
||||||||||
| SEARCH_ATTRIBUTE_TYPE_UNSPECIFIED = 0; | ||||||||||
| SEARCH_ATTRIBUTE_TYPE_TEXT = 1; | ||||||||||
| SEARCH_ATTRIBUTE_TYPE_KEYWORD = 2; | ||||||||||
| SEARCH_ATTRIBUTE_TYPE_INT = 3; | ||||||||||
| SEARCH_ATTRIBUTE_TYPE_DOUBLE = 4; | ||||||||||
| SEARCH_ATTRIBUTE_TYPE_BOOL = 5; | ||||||||||
| SEARCH_ATTRIBUTE_TYPE_DATETIME = 6; | ||||||||||
| SEARCH_ATTRIBUTE_TYPE_KEYWORD_LIST = 7; | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| message SearchAttribute { | ||||||||||
| // The search attribute specification. | ||||||||||
| SearchAttributeSpec spec = 1; | ||||||||||
| // Whether the search attribute is system defined. | ||||||||||
| // System defined search attributes cannot be modified or deleted. | ||||||||||
| bool system = 2; | ||||||||||
| // The current state of the search attribute. | ||||||||||
| State state = 3; | ||||||||||
| // The id of the async operation that is making changes to the search attribute, if any. | ||||||||||
| string async_operation_id = 4; | ||||||||||
|
|
||||||||||
| enum State { | ||||||||||
| STATE_UNSPECIFIED = 0; | ||||||||||
| STATE_ADDING = 1; // The search attribute is being added. | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed in descriptor that trailing comments on the same line are treated as comments for the item same as if they are above, but I think it's more consistent to always put comments for a construct above the construct. |
||||||||||
| STATE_ADD_FAILED = 2; // The search attribute failed to be added, check failure_reason for more details. | ||||||||||
| STATE_READY = 3; // The search attribute is ready for use. | ||||||||||
| STATE_RENAMING = 4; // The search attribute is being renamed. | ||||||||||
| STATE_RENAME_FAILED = 5; // The search attribute failed to be renamed, check failure_reason for more details. | ||||||||||
| } | ||||||||||
| } | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the desire to match other pagination here, but I can't see a world where so many search attributes would come back where pagination would be needed. And then if we accept that you'll always get the full set of search attributes on every call, it is much easier on users if search attributes are a map.
Having said that, I am ok with this too, just wanted to bring it up.