Skip to content

Commit

Permalink
Merge pull request #454 from lhhyung/master
Browse files Browse the repository at this point in the history
Add Region api to Identity-v2
  • Loading branch information
lhhyung authored Nov 25, 2024
2 parents 78b9545 + e8b0f73 commit ca375ce
Showing 1 changed file with 120 additions and 0 deletions.
120 changes: 120 additions & 0 deletions proto/spaceone/api/inventory/v2/region.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// A Region is a resource storing regional information from each cloud service provider. Regional data stored by the resource includes the latitude and longitude of the region.
syntax = "proto3";

package spaceone.api.inventory.v2;

option go_package = "github.com/cloudforet-io/api/dist/go/spaceone/api/inventory/v2";

import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "google/api/annotations.proto";
import "spaceone/api/core/v2/query.proto";

service Region {

// Creates a new Region. As the parameter `region_key`, which is automatically created when a Region is created, is in a form of `{provider}.{region_code}`, it is unique regardless of providers. You can also specify the latitude, longitude, and continent information in `tags`.
rpc create (CreateRegionRequest) returns (RegionInfo) {
option (google.api.http) = {
post: "/inventory/v2/region/create"
body: "*"
};
}

// Updates a specific Region. You can make changes in Region settings, including `name` and `tags`. The `tags` contain the continent, latitude, and longitude.
rpc update (UpdateRegionRequest) returns (RegionInfo) {
option (google.api.http) = {
post: "/inventory/v2/region/update"
body: "*"
};
}

// Deletes a specific Region. You must specify the `region_id` of the Region to delete.
rpc delete (RegionRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/inventory/v2/region/delete"
body: "*"
};
}

// Gets a specific Region. Prints detailed information about the Region, including `name`, `region_code`, and a location coordinate.
rpc get (RegionRequest) returns (RegionInfo) {
option (google.api.http) = {
post: "/inventory/v2/region/get"
body: "*"
};
}

// Gets a list of all Regions. You can use a query to get a filtered list of Regions.
rpc list (RegionQuery) returns (RegionsInfo) {
option (google.api.http) = {
post: "/inventory/v2/region/list"
body: "*"
};
}

rpc stat (RegionStatQuery) returns (google.protobuf.Struct) {
option (google.api.http) = {
post: "/inventory/v2/region/stat"
body: "*"
};
}
}

message CreateRegionRequest {
string name = 1;
string region_code = 2;
// +optional
string provider = 3;
// +optional
google.protobuf.Struct tags = 4;
}

message UpdateRegionRequest {
string region_id = 1;
// +optional
string name = 2;
// +optional
google.protobuf.Struct tags = 3;
}

message RegionRequest {
string region_id = 1;
}

message RegionQuery {
// +optional
spaceone.api.core.v2.Query query = 1;
// +optional
string region_id = 2;
// +optional
string name = 3;
// +optional
string region_key = 4;
// +optional
string region_code = 5;
// +optional
string provider = 6;
}

message RegionInfo {
string region_id = 1;
string name = 2;
string region_key = 3;
string region_code = 4;
string provider = 5;
google.protobuf.Struct tags = 6;

string domain_id = 21;

string created_at = 31;
string updated_at = 32;
}

message RegionsInfo {
repeated RegionInfo results = 1;
int32 total_count = 2;
}

message RegionStatQuery {
spaceone.api.core.v2.StatisticsQuery query = 1;
}

0 comments on commit ca375ce

Please sign in to comment.