github.com/cloudwan/edgelq-sdk@v1.15.4/devices/proto/v1/provisioning_policy_service.proto (about)

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