github.com/cloudwan/edgelq-sdk@v1.15.4/alerting/proto/v1/ts_condition_service.proto (about)

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