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

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