github.com/cloudwan/edgelq-sdk@v1.15.4/iam/proto/v1alpha2/role_service.proto (about)

     1  syntax = "proto3";
     2  
     3  package ntt.iam.v1alpha2;
     4  
     5  import "edgelq-sdk/iam/proto/v1alpha2/role.proto";
     6  import "edgelq-sdk/iam/proto/v1alpha2/role_change.proto";
     7  import "google/api/annotations.proto";
     8  import "google/api/client.proto";
     9  import "google/protobuf/empty.proto";
    10  import "google/protobuf/field_mask.proto";
    11  import "google/protobuf/timestamp.proto";
    12  import "goten-sdk/types/view.proto";
    13  import "goten-sdk/types/watch_type.proto";
    14  
    15  option go_package = "github.com/cloudwan/edgelq-sdk/iam/client/v1alpha2/role;role_client";
    16  option java_multiple_files = false;
    17  option java_outer_classname = "RoleServiceProto";
    18  option java_package = "com.ntt.iam.pb.v1alpha2";
    19  
    20  // A request message of the GetRole method.
    21  message GetRoleRequest {
    22    // Name of ntt.iam.v1alpha2.Role
    23    string name = 1;
    24  
    25    // A list of extra fields to be obtained for each response item on top of
    26    // fields defined by request field view
    27    google.protobuf.FieldMask field_mask = 3;
    28  
    29    // View defines list of standard response fields present in response items.
    30    // Additional fields can be amended by request field field_mask
    31    goten.types.View view = 4;
    32  }
    33  
    34  // A request message of the BatchGetRoles method.
    35  message BatchGetRolesRequest {
    36    // Names of Roles
    37    repeated string names = 2;
    38  
    39    // A list of extra fields to be obtained for each response item on top of
    40    // fields defined by request field view
    41    google.protobuf.FieldMask field_mask = 3;
    42  
    43    // View defines list of standard response fields present in response items.
    44    // Additional fields can be amended by request field field_mask
    45    goten.types.View view = 4;
    46  
    47    reserved 1;
    48  }
    49  
    50  // A response message of the BatchGetRoles method.
    51  message BatchGetRolesResponse {
    52    // found Roles
    53    repeated Role roles = 1;
    54  
    55    // list of not found Roles
    56    repeated string missing = 2;
    57  }
    58  
    59  // A request message of the ListRoles method.
    60  message ListRolesRequest {
    61    // Requested page size. Server may return fewer Roles than requested.
    62    // If unspecified, server will pick an appropriate default.
    63    int32 page_size = 2;
    64  
    65    // A token identifying a page of results the server should return.
    66    // Typically, this is the value of
    67    // ListRolesResponse.next_page_token.
    68    string page_token = 3;
    69  
    70    // Order By -
    71    // https://cloud.google.com/apis/design/design_patterns#list_pagination list
    72    // of field path with order directive, either 'asc' or 'desc'. If direction is
    73    // not provided, 'asc' is assumed. e.g. "state.nested_field asc,
    74    // state.something.else desc, theme"
    75    string order_by = 4;
    76  
    77    // Filter - filter results by field criteria. Simplified SQL-like syntax with
    78    // following operators:
    79    // <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS
    80    // [NOT] NULL | NaN . Combine conditions with OR | AND example: 'meta.labels
    81    // CONTAINS "severity:important" OR (state.last_error_time >
    82    // "2018-11-15T10:00:00Z" AND state.status = "ERROR")'
    83    string filter = 5;
    84  
    85    // A list of extra fields to be obtained for each response item on top of
    86    // fields defined by request field view
    87    google.protobuf.FieldMask field_mask = 6;
    88  
    89    // View defines list of standard response fields present in response items.
    90    // Additional fields can be amended by request field field_mask
    91    goten.types.View view = 7;
    92  
    93    // Indicates if list response should contain total count and offset (fields
    94    // current_offset and total_results_count).
    95    bool include_paging_info = 8;
    96  }
    97  
    98  // A response message of the ListRoles method.
    99  message ListRolesResponse {
   100    // The list of Roles
   101    repeated Role roles = 1;
   102  
   103    // A token to retrieve previous page of results.
   104    //
   105    // Pass this value in the ListRolesRequest.page_token.
   106    string prev_page_token = 3;
   107  
   108    // A token to retrieve next page of results.
   109    //
   110    // Pass this value in the ListRolesRequest.page_token.
   111    string next_page_token = 4;
   112  
   113    // Current offset from the first page or 0 if no page tokens were given,
   114    // paging info was not requested or there was an error while trying to get
   115    // it). Page index can be computed from offset and limit provided in a
   116    // request.
   117    int32 current_offset = 5;
   118  
   119    // Number of total Roles across all pages or 0, if there are no items, paging
   120    // info was not requested or there was an error while trying to get it.
   121    int32 total_results_count = 6;
   122  }
   123  
   124  // A request message of the WatchRole method.
   125  message WatchRoleRequest {
   126    // Name of ntt.iam.v1alpha2.Role
   127    string name = 1;
   128  
   129    // A list of extra fields to be obtained for each response item on top of
   130    // fields defined by request field view
   131    google.protobuf.FieldMask field_mask = 2;
   132  
   133    // View defines list of standard response fields present in response items.
   134    // Additional fields can be amended by request field field_mask
   135    goten.types.View view = 4;
   136  }
   137  
   138  // A response message of the WatchRole method.
   139  message WatchRoleResponse { RoleChange change = 1; }
   140  
   141  // A request message of the WatchRoles method.
   142  message WatchRolesRequest {
   143    // Type of a watch. Identifies how server stream data to a client, which
   144    // fields in a request are allowed and which fields in response are relevant.
   145    goten.types.WatchType type = 9;
   146  
   147    // Requested page size. Server may return fewer Roles than requested.
   148    // If unspecified, server will pick an appropriate default.
   149    // Can be populated only for stateful watch type.
   150    int32 page_size = 2;
   151  
   152    // A token identifying a page of results the server should return.
   153    // Can be populated only for stateful watch type.
   154    string page_token = 3;
   155  
   156    // Order By -
   157    // https://cloud.google.com/apis/design/design_patterns#list_pagination Can be
   158    // populated only for stateful watch type.
   159    string order_by = 4;
   160  
   161    // A token identifying watch resume point from previous session.
   162    // Can be populated only for stateless watch type.
   163    string resume_token = 10;
   164  
   165    // Point in the time from which we want to start getting updates. This field
   166    // can be populated only for stateless watch type and if resume token is not
   167    // known yet. If specified, initial snapshot will NOT be provided. It is
   168    // assumed client can obtain it using separate means. Watch responses will
   169    // contain resume tokens which should be used to resume broken connection.
   170    google.protobuf.Timestamp starting_time = 12;
   171  
   172    // Filter - filter results by field criteria. Simplified SQL-like syntax with
   173    // following operators:
   174    // <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS
   175    // [NOT] NULL | NaN . Combine conditions with OR | AND example: 'meta.labels
   176    // CONTAINS "severity:important" OR (state.last_error_time >
   177    // "2018-11-15T10:00:00Z" AND state.status = "ERROR")'
   178    string filter = 5;
   179  
   180    // A list of extra fields to be obtained for each response item on top of
   181    // fields defined by request field view Changes to Role that don't affect any
   182    // of masked fields won't be sent back.
   183    google.protobuf.FieldMask field_mask = 6;
   184  
   185    // View defines list of standard response fields present in response items.
   186    // Additional fields can be amended by request field field_mask Changes to
   187    // Role that don't affect any of masked fields won't be sent back.
   188    goten.types.View view = 8;
   189  
   190    // Maximum amount of changes in each response message. Query result response
   191    // is divided on the server side into chunks with size of a specified amount
   192    // to limit memory footprint of each message. Responses will hold information
   193    // whether more elements will continue for the actual change. If unspecified,
   194    // server will pick an appropriate default.
   195    int32 max_chunk_size = 11;
   196  }
   197  
   198  // A response message of the WatchRoles method.
   199  message WatchRolesResponse {
   200    // Changes of Roles
   201    repeated RoleChange role_changes = 2;
   202  
   203    // If request specified max_chunk_size (or this limit was enforced if
   204    // stateless watch has been chosen), then responses with "full changeset" will
   205    // be divided into chunks. Client should keep receiving messages and, once
   206    // is_current has value true, combine this recent message with all previous
   207    // ones where is_current is false. If this is the first is_current in a whole
   208    // watch stream, then it means that client should have, at this moment,
   209    // contain snapshot of the current situation (or more accurately, snapshot of
   210    // situation at the moment of request). All Roles will be of type
   211    // Added/Current (depending on watch_type specified in the request). Further
   212    // responses will be incremental - however messages may still be chunked and
   213    // is_current logic still applies. is_current is always true for stateful
   214    // watch if max_chunk_size was left to 0.
   215    bool is_current = 4;
   216  
   217    // When present, PageTokens used for page navigation should be updated.
   218    // Present only if is_current is true (last chunk).
   219    PageTokenChange page_token_change = 3;
   220  
   221    // Token that can be used if current connection drops and client needs to
   222    // reconnect. Populated only for stateless watch type. Present only if
   223    // is_current is true (last chunk).
   224    string resume_token = 5;
   225  
   226    // Server may occasionally send information how many resources should client
   227    // have in its state so far (response message without any changes, but with
   228    // snapshot_size field specified). If client has different value than the one
   229    // sent by the server, then it should be treated by a client as an error and
   230    // should reconnect. If value is smaller then 0, then client should ignore
   231    // this field as unpopulated. This field should be checked only for stateless
   232    // watch. In stateful those kind of errors are handled by the server side.
   233    // Will be never sent together with is_current, is_soft_reset and
   234    // is_hard_reset flags.
   235    int64 snapshot_size = 6;
   236  
   237    // In case of internal issue server may send response message with this flag.
   238    // It indicates that client should drop all changes from recent responses
   239    // where is_current is false only! If last message had is_current set to true,
   240    // client should do nothing and process normally. Resume token received before
   241    // is still valid. This field should be checked only for stateless watch. In
   242    // stateful those kind of errors are handled by the server side. Will never be
   243    // sent along with is_current, is_hard_reset or snapshot_size.
   244    bool is_soft_reset = 7;
   245  
   246    // In case of internal issue server may send response message with this flag.
   247    // After receiving, client should clear whole state (drop all changes received
   248    // so far) as server will send new snapshot (Roles will contains changes of
   249    // type Current only). Any resume tokens should be discarded as well. This
   250    // field should be checked only for stateless watch. In stateful those kind of
   251    // errors are handled by the server side. Will never be sent along with
   252    // is_current, is_soft_reset or snapshot_size.
   253    bool is_hard_reset = 8;
   254  
   255    message PageTokenChange {
   256      // New token to retrieve previous page of results.
   257      string prev_page_token = 1;
   258  
   259      // New token to retrieve next page of results.
   260      string next_page_token = 2;
   261    }
   262  }
   263  
   264  // A request message of the CreateRole method.
   265  message CreateRoleRequest {
   266    // Role resource body
   267    Role role = 2;
   268  
   269    // Optional masking applied to response object to reduce message response
   270    // size.
   271    ResponseMask response_mask = 3;
   272  
   273    // ResponseMask allows client to reduce response message size.
   274    message ResponseMask {
   275      oneof masking {
   276        // If this flag has value true, then response will contain just empty
   277        // resource without any fields populated.
   278        bool skip_entire_response_body = 1;
   279  
   280        // If this field is populated, then resource in response will contain only
   281        // specific fields.
   282        google.protobuf.FieldMask body_mask = 2;
   283      }
   284    }
   285  }
   286  
   287  // A request message of the UpdateRole method.
   288  message UpdateRoleRequest {
   289    // Role resource body
   290    Role role = 2;
   291  
   292    // FieldMask applied to request - change will be applied only for fields in
   293    // the mask
   294    google.protobuf.FieldMask update_mask = 3;
   295  
   296    // Conditional update applied to request if update should be executed only for
   297    // specific resource state. If this field is populated, then server will fetch
   298    // existing resource, compare with the one stored in the cas field (after
   299    // applying field mask) and proceed with update only and only if they match.
   300    // Otherwise RPC error Aborted will be returned.
   301    CAS cas = 4;
   302  
   303    // If set to true, and the resource is not found,
   304    // a new resource will be created.  In this situation,
   305    // 'field_mask' is ignored.
   306    //
   307    // https://google.aip.dev/134#create-or-update
   308    bool allow_missing = 5; // Optional masking applied to response object to
   309  
   310    // reduce message response size.
   311    ResponseMask response_mask = 6;
   312  
   313    // CAS - Compare and Swap. This object is used if user wants to make update
   314    // conditional based upon previous resource version.
   315    message CAS {
   316      // Conditional desired state of a resource before update.
   317      Role conditional_state = 1;
   318  
   319      // Field paths from conditional state of resource server should check and
   320      // compare.
   321      google.protobuf.FieldMask field_mask = 2;
   322    }
   323  
   324    // ResponseMask allows client to reduce response message size.
   325    message ResponseMask {
   326      oneof masking {
   327        // If this flag has value true, then response will contain just empty
   328        // resource without any fields populated. Field body_mask is ignored if
   329        // set.
   330        bool skip_entire_response_body = 1;
   331  
   332        // Include all fields that were actually updated during processing. Note
   333        // this may be larger than update mask if some fields were computed
   334        // additionally. Name is added as well.
   335        bool updated_fields_only = 2;
   336  
   337        // If this field is populated, then resource in response will contain only
   338        // specific fields. If skip_entire_response_body is true, this field is
   339        // ignored.
   340        google.protobuf.FieldMask body_mask = 3;
   341      }
   342    }
   343  }
   344  
   345  // A request message of the DeleteRole method.
   346  message DeleteRoleRequest {
   347    // Name of ntt.iam.v1alpha2.Role
   348    string name = 1;
   349  
   350    // If set to true, and the resource is not found, method will be successful
   351    // and will not return NotFound error.
   352    bool allow_missing = 2;
   353  }
   354  
   355  // Role service API for IAM
   356  service RoleService {
   357    option (google.api.default_host) = "iam.edgelq.com";
   358    option (google.api.oauth_scopes) = "https://apis.edgelq.com";
   359  
   360    // GetRole
   361    rpc GetRole(GetRoleRequest) returns (Role) {
   362      option (google.api.http) = {
   363        get : "/v1alpha2/{name=roles/*}"
   364      };
   365    }
   366  
   367    // BatchGetRoles
   368    rpc BatchGetRoles(BatchGetRolesRequest) returns (BatchGetRolesResponse) {
   369      option (google.api.http) = {
   370        get : "/v1alpha2/roles:batchGet"
   371      };
   372    }
   373  
   374    // ListRoles
   375    rpc ListRoles(ListRolesRequest) returns (ListRolesResponse) {
   376      option (google.api.http) = {
   377        get : "/v1alpha2/roles"
   378      };
   379    }
   380  
   381    // WatchRole
   382    rpc WatchRole(WatchRoleRequest) returns (stream WatchRoleResponse) {
   383      option (google.api.http) = {
   384        post : "/v1alpha2/{name=roles/*}:watch"
   385      };
   386    }
   387  
   388    // WatchRoles
   389    rpc WatchRoles(WatchRolesRequest) returns (stream WatchRolesResponse) {
   390      option (google.api.http) = {
   391        post : "/v1alpha2/roles:watch"
   392      };
   393    }
   394  
   395    // CreateRole
   396    rpc CreateRole(CreateRoleRequest) returns (Role) {
   397      option (google.api.http) = {
   398        post : "/v1alpha2/roles"
   399        body : "role"
   400      };
   401    }
   402  
   403    // UpdateRole
   404    rpc UpdateRole(UpdateRoleRequest) returns (Role) {
   405      option (google.api.http) = {
   406        put : "/v1alpha2/{role.name=roles/*}"
   407        body : "role"
   408      };
   409    }
   410  
   411    // DeleteRole
   412    rpc DeleteRole(DeleteRoleRequest) returns (google.protobuf.Empty) {
   413      option (google.api.http) = {
   414        delete : "/v1alpha2/{name=roles/*}"
   415      };
   416    }
   417  }