Skip to content

Commit

Permalink
docs/content: Documentation for GetSome, SetSome, DeleteSome
Browse files Browse the repository at this point in the history
Change-Id: I9290cf20f29620b9eff040c7729f01daa9edc7ec
  • Loading branch information
oumichae1 committed Sep 16, 2024
1 parent 37f77d3 commit 1295161
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 10 deletions.
5 changes: 5 additions & 0 deletions docs/content/examples/REST/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ Examples scripts: [examples_cvprac.py](https://github.com/aristanetworks/cloudvi
REST bindings for Resource APIs were introduced in CVP 2021.1.0
{{% /notice %}}

{{% notice note %}}
REST bindings for GetSome, SetSome, DeleteSome were updated in CVP 2024.3.0.
The request payload for these endpoints should have the same structure as the request to the GetSome, SetSome, DeleteSome gRPC endpoints.
{{% /notice %}}

{{% notice note %}}
When fetching a state from NetDB between two arbitrary dates, the result returned will contain data that existed between those two dates and not just data that was created between those dates. For instance if BGP events are queried between 2023-05-01 10:00 and 2023-05-01 12:00 the result will contain events that were active in the range of 10 AM to 12 PM. If there were events that started before 10 AM and were not resolved (still active) at that time, the result will contain those events too.
{{% /notice %}}
4 changes: 2 additions & 2 deletions docs/content/rpcs/delete.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Delete
weight: 14
pre: "<b>e. </b>"
weight: 16
pre: "<b>g. </b>"
---

`Delete` deletes a resource and returns the time the delete became effective.
Expand Down
58 changes: 58 additions & 0 deletions docs/content/rpcs/deletesome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: DeleteSome
weight: 17
pre: "<b>h. </b>"
---

`DeleteSome` deletes a resource and streams back the resources that failed to be deleted and a description for the failure.

{{% notice note %}}
DeleteSome is supported on all keyed resources.\
However, in certain releases, this may have been missing. See Support section below for details.
{{% /notice %}}

{{% notice note %}}
The `Keys` field is required to be fully-specified because `DeleteSome` needs to identify resources to delete.
{{% /notice %}}

#### RPC Definition

The protobuf definition of `DeleteSome` is defined as such (for `ExampleConfig`):

```protobuf
rpc DeleteSome (ExampleConfigDeleteSomeRequest) returns (stream ExampleConfigDeleteSomeResponse);
```

#### Request Type

The generated request for a model (`ExampleConfig`, here) looks like so:


```protobuf
message ExampleConfigDeleteSomeRequest {
// Keys indicates which ExampleConfig instances to remove.
// This field must always be set.
repeated ExampleKey keys = 1;
};
```

#### Response Type

The generated response for a model (`ExampleConfig`, here) looks like so:

```protobuf
// ExampleConfigDeleteSomeResponse is only sent when there is an error.
message ExampleConfigDeleteSomeResponse {
// Key echoes back the key of ExampleConfig instance that failed to be deleted.
ExampleKey key = 1;
// Error is a description of the error encountered while deleting the
// ExampleConfig instance.
string error = 2;
};
```

#### Support
Supported for configlet.v1, studio.v1, tag.v2, workspace.v1 in CloudVision-as-a-Service.

Supported for configlet.v1, studio.v1, tag.v2 from CVP 2024.2.0
4 changes: 2 additions & 2 deletions docs/content/rpcs/getall.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: GetAll
weight: 11
pre: "<b>b. </b>"
weight: 12
pre: "<b>c. </b>"
---


Expand Down
71 changes: 71 additions & 0 deletions docs/content/rpcs/getsome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
title: GetSome
weight: 11
pre: "<b>b. </b>"
---


`GetSome` returns multiple instances of a resource.

{{% notice note %}}
GetSome is supported on all keyed resources.\
However, in certain releases, this may have been missing. See Support section below for details.
{{% /notice %}}

{{% notice note %}}
The `Keys` field is required to be fully-specified because `GetSome` needs to identify resources to fetch.
{{% /notice %}}

#### RPC Definition

The protobuf definition of `GetSome` is defined as such (for `ExampleConfig`):

```protobuf
rpc GetSome (ExampleConfigSomeRequest) returns (stream ExampleConfigSomeResponse);
```

#### Request Type

The generated request for a model (`ExampleConfig`, here) looks like so:

```protobuf
message ExampleConfigSomeRequest {
// Keys identifies the ExampleConfig instances to retrieve.
// This value must be populated (non-null) and all fields set.
repeated ExampleKey keys = 1;
// Time indicates the time for which you are interested in the data.
// If no time is given, the server will use the time at which it makes the request.
//
// This time is used as an upper-bound. The returned value may have been set at
// an earlier time, however, it was the value as of the supplied time.
google.protobuf.Timestamp time = 2;
}
```

#### Response Type

The generated response for a model (`ExampleConfig`, here) looks like so:


```protobuf
message ExampleConfigSomeResponse {
// Value is the value requested.
// This structure will be fully-populated as it exists in the datastore. If
// optional fields were not given at creation, these fields will be empty or
// set to default values.
ExampleConfig value = 1;
// Time carries the (UTC) timestamp of the last-modification of the
// ExampleConfig instance in this response.
//
// As stated in the request above, this time will likely not match the request
// exactly. But it will be before-or-equal to the requested time.
google.protobuf.Timestamp time = 2;
};
```

#### Support
Supported for configlet.v1, connectivitymonitor.v1, tag.v2 in CloudVision-as-a-Service.

Supported for configlet.v1, connectivitymonitor.v1, tag.v2 from CVP 2024.2.0
8 changes: 4 additions & 4 deletions docs/content/rpcs/set.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: Set
weight: 13
pre: "<b>d. </b>"
weight: 14
pre: "<b>e. </b>"
---

`Set` updates a resource. Updates can be whole or partial (see: nullable fields) using only fields populated in the request.

{{% notice note %}}
The `Key` field is required to be fully-specified because `Set` needs to identify exactly-one
resource to delete.
The `Value` field is required to be fully-specified because `Set` needs to identify exactly-one
resource to update.
{{% /notice %}}


Expand Down
62 changes: 62 additions & 0 deletions docs/content/rpcs/setsome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: SetSome
weight: 15
pre: "<b>f. </b>"
---

`SetSome` updates multiple instances of a keyed resource. Updates can be whole or partial (see: nullable fields) using only fields populated in the request.

{{% notice note %}}
SetSome is supported on all keyed resources.\
However, in certain releases, this may have been missing. See Support section below for details.
{{% /notice %}}

{{% notice note %}}
The `Values` field is required to be fully-specified because `SetSome` needs to identify
resources to update.
{{% /notice %}}

A `*SetSomeResponse` will "echo" back the key of a resource that failed to set. It will also contain an error description on why the resource failed to set.

```protobuf
rpc Set (ExampleConfigSetSomeRequest) returns (stream ExampleSetSomeResponse);
```

#### Request Type

The generated request for a model (`ExampleConfig`, here) looks like so:

```protobuf
message ExampleConfigSetSomeRequest {
// values contains a list of ExampleConfig values to write.
// It is possible to provide more values than can fit within either:
// - the maxiumum send size of the client
// - the maximum receive size of the server
// If this error occurs you must reduce the number of values sent.
// See gRPC "maximum message size" documentation for more information.
// ExampleConfig carries the value to set into the datastore.
repeated ExampleConfig values = 1;
};
```

#### Response Type

The generated response for a model (`ExampleConfig`, here) looks like so:

```protobuf
message ExampleConfigSetResponse {
// Key is the key of the resource that failed to set.
ExampleKey key = 1;
// Error indicates the reason why the set failed for the resource.
string error = 2;
};
```

#### Support
Supported for configlet.v1, event.v1, studio.v1, tag.v2, workspace.v1 in CloudVision-as-a-Service.

Supported for tag.v2, studio.v1 from CVP 2023.2.0

Supported for configlet.v1, event.v1 from CVP 2024.2.0


4 changes: 2 additions & 2 deletions docs/content/rpcs/subscribe.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Subscribe
weight: 12
pre: "<b>c. </b>"
weight: 13
pre: "<b>d. </b>"
---

`Subscribe` first returns the initial state (fully-specified messages) and then any received updates.
Expand Down

0 comments on commit 1295161

Please sign in to comment.