github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/proto/v3/metric_descriptor_service.proto (about)

     1  syntax = "proto3";
     2  
     3  package ntt.monitoring.v3;
     4  
     5  import "edgelq-sdk/monitoring/proto/v3/metric_descriptor.proto";
     6  import "edgelq-sdk/monitoring/proto/v3/metric_descriptor_change.proto";
     7  import "edgelq-sdk/monitoring/proto/v3/metric_descriptor_custom.proto";
     8  import "google/api/annotations.proto";
     9  import "google/api/client.proto";
    10  import "google/protobuf/empty.proto";
    11  import "google/protobuf/field_mask.proto";
    12  import "google/protobuf/timestamp.proto";
    13  import "goten-sdk/types/view.proto";
    14  import "goten-sdk/types/watch_type.proto";
    15  
    16  option go_package = "github.com/cloudwan/edgelq-sdk/monitoring/client/v3/metric_descriptor;metric_descriptor_client";
    17  option java_multiple_files = false;
    18  option java_outer_classname = "MetricDescriptorServiceProto";
    19  option java_package = "com.ntt.monitoring.pb.v3";
    20  
    21  // A request message of the BatchGetMetricDescriptors method.
    22  message BatchGetMetricDescriptorsRequest {
    23    // Names of MetricDescriptors
    24    repeated string names = 2;
    25  
    26    // A list of extra fields to be obtained for each response item on top of
    27    // fields defined by request field view
    28    google.protobuf.FieldMask field_mask = 3;
    29  
    30    // View defines list of standard response fields present in response items.
    31    // Additional fields can be amended by request field field_mask
    32    goten.types.View view = 4;
    33  
    34    reserved 1;
    35  }
    36  
    37  // A response message of the BatchGetMetricDescriptors method.
    38  message BatchGetMetricDescriptorsResponse {
    39    // found MetricDescriptors
    40    repeated MetricDescriptor metric_descriptors = 1;
    41  
    42    // list of not found MetricDescriptors
    43    repeated string missing = 2;
    44  }
    45  
    46  // A request message of the WatchMetricDescriptor method.
    47  message WatchMetricDescriptorRequest {
    48    // Name of ntt.monitoring.v3.MetricDescriptor
    49    string name = 1;
    50  
    51    // A list of extra fields to be obtained for each response item on top of
    52    // fields defined by request field view
    53    google.protobuf.FieldMask field_mask = 2;
    54  
    55    // View defines list of standard response fields present in response items.
    56    // Additional fields can be amended by request field field_mask
    57    goten.types.View view = 4;
    58  }
    59  
    60  // A response message of the WatchMetricDescriptor method.
    61  message WatchMetricDescriptorResponse { MetricDescriptorChange change = 1; }
    62  
    63  // A request message of the WatchMetricDescriptors method.
    64  message WatchMetricDescriptorsRequest {
    65    // Type of a watch. Identifies how server stream data to a client, which
    66    // fields in a request are allowed and which fields in response are relevant.
    67    goten.types.WatchType type = 9;
    68  
    69    // Parent name of ntt.monitoring.v3.MetricDescriptor
    70    string parent = 1;
    71  
    72    // Requested page size. Server may return fewer MetricDescriptors than
    73    // requested. If unspecified, server will pick an appropriate default. Can be
    74    // populated only for stateful watch type.
    75    int32 page_size = 2;
    76  
    77    // A token identifying a page of results the server should return.
    78    // Can be populated only for stateful watch type.
    79    string page_token = 3;
    80  
    81    // Order By -
    82    // https://cloud.google.com/apis/design/design_patterns#list_pagination Can be
    83    // populated only for stateful watch type.
    84    string order_by = 4;
    85  
    86    // A token identifying watch resume point from previous session.
    87    // Can be populated only for stateless watch type.
    88    string resume_token = 10;
    89  
    90    // Point in the time from which we want to start getting updates. This field
    91    // can be populated only for stateless watch type and if resume token is not
    92    // known yet. If specified, initial snapshot will NOT be provided. It is
    93    // assumed client can obtain it using separate means. Watch responses will
    94    // contain resume tokens which should be used to resume broken connection.
    95    google.protobuf.Timestamp starting_time = 12;
    96  
    97    // Filter - filter results by field criteria. Simplified SQL-like syntax with
    98    // following operators:
    99    // <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS
   100    // [NOT] NULL | NaN . Combine conditions with OR | AND example: 'meta.labels
   101    // CONTAINS "severity:important" OR (state.last_error_time >
   102    // "2018-11-15T10:00:00Z" AND state.status = "ERROR")'
   103    string filter = 5;
   104  
   105    // A list of extra fields to be obtained for each response item on top of
   106    // fields defined by request field view Changes to MetricDescriptor that don't
   107    // affect any of masked fields won't be sent back.
   108    google.protobuf.FieldMask field_mask = 6;
   109  
   110    // View defines list of standard response fields present in response items.
   111    // Additional fields can be amended by request field field_mask Changes to
   112    // MetricDescriptor that don't affect any of masked fields won't be sent back.
   113    goten.types.View view = 8;
   114  
   115    // Maximum amount of changes in each response message. Query result response
   116    // is divided on the server side into chunks with size of a specified amount
   117    // to limit memory footprint of each message. Responses will hold information
   118    // whether more elements will continue for the actual change. If unspecified,
   119    // server will pick an appropriate default.
   120    int32 max_chunk_size = 11;
   121  }
   122  
   123  // A response message of the WatchMetricDescriptors method.
   124  message WatchMetricDescriptorsResponse {
   125    // Changes of MetricDescriptors
   126    repeated MetricDescriptorChange metric_descriptor_changes = 2;
   127  
   128    // If request specified max_chunk_size (or this limit was enforced if
   129    // stateless watch has been chosen), then responses with "full changeset" will
   130    // be divided into chunks. Client should keep receiving messages and, once
   131    // is_current has value true, combine this recent message with all previous
   132    // ones where is_current is false. If this is the first is_current in a whole
   133    // watch stream, then it means that client should have, at this moment,
   134    // contain snapshot of the current situation (or more accurately, snapshot of
   135    // situation at the moment of request). All MetricDescriptors will be of type
   136    // Added/Current (depending on watch_type specified in the request). Further
   137    // responses will be incremental - however messages may still be chunked and
   138    // is_current logic still applies. is_current is always true for stateful
   139    // watch if max_chunk_size was left to 0.
   140    bool is_current = 4;
   141  
   142    // When present, PageTokens used for page navigation should be updated.
   143    // Present only if is_current is true (last chunk).
   144    PageTokenChange page_token_change = 3;
   145  
   146    // Token that can be used if current connection drops and client needs to
   147    // reconnect. Populated only for stateless watch type. Present only if
   148    // is_current is true (last chunk).
   149    string resume_token = 5;
   150  
   151    // Server may occasionally send information how many resources should client
   152    // have in its state so far (response message without any changes, but with
   153    // snapshot_size field specified). If client has different value than the one
   154    // sent by the server, then it should be treated by a client as an error and
   155    // should reconnect. If value is smaller then 0, then client should ignore
   156    // this field as unpopulated. This field should be checked only for stateless
   157    // watch. In stateful those kind of errors are handled by the server side.
   158    // Will be never sent together with is_current, is_soft_reset and
   159    // is_hard_reset flags.
   160    int64 snapshot_size = 6;
   161  
   162    // In case of internal issue server may send response message with this flag.
   163    // It indicates that client should drop all changes from recent responses
   164    // where is_current is false only! If last message had is_current set to true,
   165    // client should do nothing and process normally. Resume token received before
   166    // is still valid. This field should be checked only for stateless watch. In
   167    // stateful those kind of errors are handled by the server side. Will never be
   168    // sent along with is_current, is_hard_reset or snapshot_size.
   169    bool is_soft_reset = 7;
   170  
   171    // In case of internal issue server may send response message with this flag.
   172    // After receiving, client should clear whole state (drop all changes received
   173    // so far) as server will send new snapshot (MetricDescriptors will contains
   174    // changes of type Current only). Any resume tokens should be discarded as
   175    // well. This field should be checked only for stateless watch. In stateful
   176    // those kind of errors are handled by the server side. Will never be sent
   177    // along with is_current, is_soft_reset or snapshot_size.
   178    bool is_hard_reset = 8;
   179  
   180    message PageTokenChange {
   181      // New token to retrieve previous page of results.
   182      string prev_page_token = 1;
   183  
   184      // New token to retrieve next page of results.
   185      string next_page_token = 2;
   186    }
   187  }
   188  
   189  // MetricDescriptor service API for Monitoring
   190  service MetricDescriptorService {
   191    option (google.api.default_host) = "monitoring.edgelq.com";
   192    option (google.api.oauth_scopes) = "https://apis.edgelq.com";
   193  
   194    // BatchGetMetricDescriptors
   195    rpc BatchGetMetricDescriptors(BatchGetMetricDescriptorsRequest)
   196        returns (BatchGetMetricDescriptorsResponse) {
   197      option (google.api.http) = {
   198        get : "/v3/metricDescriptors:batchGet"
   199      };
   200    }
   201  
   202    // WatchMetricDescriptor
   203    rpc WatchMetricDescriptor(WatchMetricDescriptorRequest)
   204        returns (stream WatchMetricDescriptorResponse) {
   205      option (google.api.http) = {
   206        post : "/v3/{name=projects/*/metricDescriptors/*}:watch"
   207      };
   208    }
   209  
   210    // WatchMetricDescriptors
   211    rpc WatchMetricDescriptors(WatchMetricDescriptorsRequest)
   212        returns (stream WatchMetricDescriptorsResponse) {
   213      option (google.api.http) = {
   214        post : "/v3/{parent=projects/*}/metricDescriptors:watch"
   215      };
   216    }
   217  
   218    // GetMetricDescriptor
   219    rpc GetMetricDescriptor(GetMetricDescriptorRequest)
   220        returns (MetricDescriptor) {
   221      option (google.api.http) = {
   222        get : "/v3/{name=projects/*/metricDescriptors/*}"
   223      };
   224    }
   225  
   226    // CreateMetricDescriptor
   227    rpc CreateMetricDescriptor(CreateMetricDescriptorRequest)
   228        returns (MetricDescriptor) {
   229      option (google.api.http) = {
   230        post : "/v3/{parent=projects/*}/metricDescriptors"
   231        body : "metric_descriptor"
   232      };
   233    }
   234  
   235    // UpdateMetricDescriptor
   236    rpc UpdateMetricDescriptor(UpdateMetricDescriptorRequest)
   237        returns (MetricDescriptor) {
   238      option (google.api.http) = {
   239        put : "/v3/{metric_descriptor.name=projects/*/metricDescriptors/*}"
   240        body : "metric_descriptor"
   241      };
   242    }
   243  
   244    // DeleteMetricDescriptor
   245    rpc DeleteMetricDescriptor(DeleteMetricDescriptorRequest)
   246        returns (google.protobuf.Empty) {
   247      option (google.api.http) = {
   248        delete : "/v3/{name=projects/*/metricDescriptors/*}"
   249      };
   250    }
   251  
   252    // ListMetricDescriptors
   253    rpc ListMetricDescriptors(ListMetricDescriptorsRequest)
   254        returns (ListMetricDescriptorsResponse) {
   255      option (google.api.http) = {
   256        get : "/v3/{parent=projects/*}/metricDescriptors"
   257      };
   258    }
   259  }