Skip to content
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

Account get and udpate apis #14

Merged
merged 12 commits into from
Oct 4, 2024
41 changes: 41 additions & 0 deletions temporal/api/cloud/account/v1/message.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
syntax = "proto3";

package temporal.api.cloud.account.v1;

option go_package = "go.temporal.io/api/cloud/account/v1;account";

import "temporal/api/cloud/resource/v1/message.proto";

message MetricsSpec {
// The ca cert(s) in PEM format that clients connecting to the metrics endpoint can use for authentication.
// This must only be one value, but the CA can have a chain.
bytes accepted_client_ca = 2;
}

message AccountSpec {
// The metrics specification for this account.
// If not specified, metrics will not be enabled.
MetricsSpec metrics = 1;
}

message Metrics {
// The prometheus metrics endpoint uri.
// This is only populated when the metrics is enabled in the metrics specification.
string uri = 1;
}

message Account {
// The id of the account.
string id = 1;
// The account specification.
AccountSpec spec = 2;
// The current version of the account specification.
// The next update operation will have to include this version.
string resource_version = 3;
// The current state of the account.
anekkanti marked this conversation as resolved.
Show resolved Hide resolved
temporal.api.cloud.resource.v1.ResourceState state = 4;
// The id of the async operation that is updating the account, if any.
string async_operation_id = 5;
// Information related to metrics.
Metrics metrics = 6;
}
26 changes: 26 additions & 0 deletions temporal/api/cloud/cloudservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import "temporal/api/cloud/identity/v1/message.proto";
import "temporal/api/cloud/namespace/v1/message.proto";
import "temporal/api/cloud/nexus/v1/message.proto";
import "temporal/api/cloud/region/v1/message.proto";
import "temporal/api/cloud/account/v1/message.proto";
import "temporal/api/cloud/usage/v1/message.proto";

message GetUsersRequest {
Expand Down Expand Up @@ -652,3 +653,28 @@ message GetUsageResponse {
// The next page's token.
string next_page_token = 2;
}

message GetAccountRequest {
anekkanti marked this conversation as resolved.
Show resolved Hide resolved
}

message GetAccountResponse {
// The account.
temporal.api.cloud.account.v1.Account account = 1;
}

message UpdateAccountRequest {
// The updated account specification to apply.
temporal.api.cloud.account.v1.AccountSpec spec = 1;
// The version of the account for which this update is intended for.
// The latest version can be found in the GetAccount operation response.
string resource_version = 2;
anekkanti marked this conversation as resolved.
Show resolved Hide resolved
// The id to use for this async operation.
// Optional, if not provided a random id will be generated.
string async_operation_id = 3;
}

message UpdateAccountResponse {
// The async operation.
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

17 changes: 16 additions & 1 deletion temporal/api/cloud/cloudservice/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ service CloudService {
body: "*"
};
}

// Get all namespaces
rpc GetNamespaces (GetNamespacesRequest) returns (GetNamespacesResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -305,4 +305,19 @@ service CloudService {
get: "/cloud/usage",
};
}

// Get account information.
rpc GetAccount (GetAccountRequest) returns (GetAccountResponse) {
option (google.api.http) = {
get: "/cloud/account",
};
}

// Update account information.
rpc UpdateAccount (UpdateAccountRequest) returns (UpdateAccountResponse) {
option (google.api.http) = {
post: "/cloud/account",
body: "*"
};
}
}
Loading