@itentialopensource/adapter-paragon_dcs
Version:
This adapter integrates with system described as: naas/ems/dcs/proto/v1/dcs.proto.
945 lines (874 loc) • 34.4 kB
YAML
openapi: 3.0.0
info:
title: naas/ems/dcs/proto/v1/dcs.proto
description: "\n\n# Copyright\n\nJuniper Networks, Inc. \n1133 Innovation Way Sunnyvale, California 94089 USA \n408-745-2000 \nwww.juniper.net\n\nCopyright © 2021, Juniper Networks, Inc. All rights reserved.\n\nJuniper Networks, the Juniper Networks logo, Juniper, and Junos are registered trademarks of Juniper Networks, Inc. and/or its affiliates in the United States and other countries. All other trademarks may be property of their respective owners.\nJuniper Networks assumes no responsibility for any inaccuracies in this document. Juniper Networks reserves the right to change, modify, transfer, or otherwise revise this publication without notice.\n\n\nThe information in this document is current as of the date on the title page.\n\nYEAR 2000 NOTICE\n\nJuniper Networks hardware and software products are Year 2000 compliant. Junos OS has no known time-related limitations through the year 2038. However, the NTP application is known to have some difficulty in the year 2036.\n\nEND USER LICENSE AGREEMENT\n\nThe Juniper Networks product that is the subject of this technical documentation consists of (or is intended for use with) Juniper Networks software. Use of such software is subject to the terms and conditions of the End User License Agreement (“EULA”) posted at http://www.juniper.net/support/eula.html. By downloading, installing or using such software, you agree to the terms and conditions of that EULA.\n\n\n"
contact: {}
version: '1.0'
servers:
- url: https://{defaultHost}
variables:
defaultHost:
default: www.example.com
paths:
/dcs/v1/disconnect-device:
post:
tags:
- ConnectivityService
summary: ConnectivityService_DisconnectDevice
description: RPC used to terminate device connection.
operationId: ConnectivityService_DisconnectDevice
parameters: []
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/v1DisconnectDeviceRequest'
required: true
responses:
'200':
description: A successful response.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/Disconnectdeviceresponse'
default:
description: An unexpected error response
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/gatewayruntimeError'
deprecated: false
/dcs/v1/execute-op:
post:
tags:
- ConnectivityService
summary: ConnectivityService_Op
description: >-
RPC used to perform operations on device like reboot device or request
file put. Takes input as list of commands and returns the result
operationId: ConnectivityService_Op
parameters: []
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/v1OpRequest'
required: true
responses:
'200':
description: A successful response.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/OperationalCommandResponse'
default:
description: An unexpected error response
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/gatewayruntimeError'
deprecated: false
/dcs/v1/connect-device:
post:
tags:
- ConnectivityService
summary: ConnectivityService_ConnectDevice
description: RPC for initiating device connection. The device must be reachable.
operationId: ConnectivityService_ConnectDevice
parameters: []
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/v1ConnectDeviceRequest'
required: true
responses:
'200':
description: A successful response.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/Connectdeviceresponse'
default:
description: An unexpected error response
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/gatewayruntimeError'
deprecated: false
/dcs/v1/execute-get:
post:
tags:
- ConnectivityService
summary: ConnectivityService_Get
description: >-
RPC used to retrieve snapshot of the data from device. Takes input
as list of command that needs to be executed sequentially.
operationId: ConnectivityService_Get
parameters: []
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/dcsv1GetRequest'
required: true
responses:
'200':
description: A successful response.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/GetCommandResponse'
default:
description: An unexpected error response
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/gatewayruntimeError'
deprecated: false
/dcs/v1/execute-set:
post:
tags:
- ConnectivityService
summary: ConnectivityService_Set
description: >-
RPC used to modify the configuration on the device. Takes input
as set of configuration commands along with to commit or validate
or confirmed commit the commands.
operationId: ConnectivityService_Set
parameters: []
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/dcsv1SetRequest'
required: true
responses:
'200':
description: A successful response.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/typesSetResponse'
- description: SetResponse contains the result of executing configuration commands on device.
default:
description: An unexpected error response
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/gatewayruntimeError'
deprecated: false
components:
schemas:
typesDeviceConnectionStatus:
title: typesDeviceConnectionStatus
type: object
properties:
timeStamp:
type: string
endPoint:
type: string
deviceId:
type: string
connectionStatus:
allOf:
- $ref: '#/components/schemas/typesConnectionStatus'
- description: >-
ConnectionStatus use to publish device connection status UP/DOWN.
- UP: device connection status UP
- DOWN: device connection status down
description: DeviceConnectionStatus contains connection id and device status.
ErrorCoderepresentstypeoftheerrorgotwhileexecutingcommand.ErrorCodepossiblevalues:
title: ErrorCoderepresentstypeoftheerrorgotwhileexecutingcommand.ErrorCodepossiblevalues
enum:
- NoError
- ConnectionError
- SetCommandFailed
- RequestTimedOut
- CommitFailed
- ConfigLockFailed
- EphemeralOpenFailed
- EphemeralCloseFailed
type: string
description: >-
- NoError: returns default no error to the caller
- ConnectionError: ConnectionError if there is connection lost to device
- SetCommandFailed: SetCommandFailed returned when the first from list of edit command fails
- RequestTimedOut: RequestTimedOut returned execution of get, set or op rpc times out
- CommitFailed: CommitFailed returned when configuration to device fail
- ConfigLockFailed: ConfigLockFailed returned when lock to device fail
- EphemeralOpenFailed: EphemeralOpenFailed returns when opening ephemeral database fails.
- EphemeralCloseFailed: EphemeralCloseFailed return when closing ephemeral database fails.
gatewayruntimeError:
title: gatewayruntimeError
type: object
properties:
message:
type: string
code:
type: integer
format: int32
details:
type: array
items:
$ref: '#/components/schemas/protobufAny'
description: ''
error:
type: string
typesUserInputCommand:
title: typesUserInputCommand
type: object
properties:
regexp:
type: string
command:
type: string
v1GetDeviceConnectionDetailsResponse:
title: v1GetDeviceConnectionDetailsResponse
type: object
properties:
connection_data:
$ref: '#/components/schemas/typesConnData'
typesChassisType:
title: typesChassisType
enum:
- STANDALONE
- VIRTUAL_CHASSIS
- CHASSIS_CLUSTER
type: string
v1OpRequest:
title: v1OpRequest
type: object
properties:
telemetry:
type: boolean
description: >-
To know whether the request is from application or from HB for metric collection.
based on this parameter netconf session is reused. This parameter is applicable only for netconf.
Also dedicated netconf sessions of device will be used apart from application requests.
device_info:
allOf:
- $ref: '#/components/schemas/typesDeviceInfo'
- description: DeviceInfo is the object in which the device details for command are passed from clients to deviceplugins.
command:
type: array
items:
type: string
description: ''
timeout:
type: integer
format: int32
user_input_cmd:
type: array
items:
$ref: '#/components/schemas/typesUserInputCommand'
description: ''
typesProtocol:
title: typesProtocol
enum:
- UNKNOWN_PROTOCOL
- SSH
- HTTP
type: string
description: >-
Protocol to use to communicate with device.
- SSH: SSH Protocol
- HTTP: HTTP Protocol
CommandResultPair:
title: CommandResultPair
type: object
properties:
command:
type: string
result:
type: string
typesCommitInfo:
title: typesCommitInfo
type: object
properties:
comment:
type: string
description: >-
Junos allows user to add comment to each commit.
This comment will be pushed to device along with commit command or confirm. It is only used for SET command.
synchronize:
type: boolean
description: Virtual chassis (VC) having multiple RE to commit configuration in both master and backup.
auto_confirmed_commit_timeout:
type: integer
description: >-
Specify the time in seconds to commit the confirmed configuration, so that DCS will first push configuration
with confirm commit timeout greater than this field and then send commit after the
time period of auto_confirmed_commit_timeout value.
format: int32
commit_check:
type: boolean
description: Junos allows user to do commit check the configuration to validate. It is only used for SET command.
typesConnData:
title: typesConnData
type: object
properties:
time_stamp:
type: string
description: time stamp when the connection is UP.
endpoint:
type: string
connection_id:
type: string
typesDeviceInfo:
title: typesDeviceInfo
type: object
properties:
subSystem:
allOf:
- $ref: '#/components/schemas/typesSubSystem'
- description: >-
SubSystem to use to communicate with device, applicable for SSH protocol.
- Netconf: Netconf subsystem
- Cli: Cli subsystem
networkOS:
type: string
vendor:
type: string
UUID:
type: string
family:
type: string
component:
type: string
auth:
allOf:
- $ref: '#/components/schemas/typesAuthInfo'
- description: AuthInfo username and password to connect to device.
routingEngines:
type: array
items:
type: string
description: ''
lastConfigSyncedTimeStamp:
type: string
members:
type: array
items:
$ref: '#/components/schemas/typesMember'
description: ''
chassisType:
$ref: '#/components/schemas/typesChassisType'
protocol:
allOf:
- $ref: '#/components/schemas/typesProtocol'
- description: >-
Protocol to use to communicate with device.
- SSH: SSH Protocol
- HTTP: HTTP Protocol
hardwareModel:
type: string
OSVersion:
type: string
Name:
type: string
description: DeviceInfo is the object in which the device details for command are passed from clients to deviceplugins.
-ALLreturnslistoffconnectionsheldbyallDCSpods-PARTICULARreturnslistofconnectionheldbythatparticularDCSpod:
title: -ALLreturnslistoffconnectionsheldbyallDCSpods-PARTICULARreturnslistofconnectionheldbythatparticularDCSpod
enum:
- ALL
- PARTICULAR
type: string
typesManagementInfo:
title: typesManagementInfo
type: object
properties:
retry:
type: integer
description: Number of time to retry in case connection to device not established.
format: int32
vendor:
type: string
device_uuid:
type: string
ip:
type: string
retry_interval:
type: integer
description: time interval in seconds to retry.
format: int32
host_name:
type: string
auth_info:
allOf:
- $ref: '#/components/schemas/typesAuthInfo'
- description: AuthInfo username and password to connect to device.
port:
type: integer
format: int32
description: ManagementInfo contains the information necessary to dail out device connection.
typesStreamGetResponse:
title: typesStreamGetResponse
type: object
properties:
chunk_data:
type: string
error_code:
allOf:
- $ref: '#/components/schemas/ErrorCoderepresentstypeoftheerrorgotwhileexecutingcommand.ErrorCodepossiblevalues'
- description: >-
- NoError: returns default no error to the caller
- ConnectionError: ConnectionError if there is connection lost to device
- SetCommandFailed: SetCommandFailed returned when the first from list of edit command fails
- RequestTimedOut: RequestTimedOut returned execution of get, set or op rpc times out
- CommitFailed: CommitFailed returned when configuration to device fail
- ConfigLockFailed: ConfigLockFailed returned when lock to device fail
- EphemeralOpenFailed: EphemeralOpenFailed returns when opening ephemeral database fails.
- EphemeralCloseFailed: EphemeralCloseFailed return when closing ephemeral database fails.
error:
type: string
description: StreamGetResponse sends data in chunks.
GetCommandResponse:
title: GetCommandResponse
type: object
properties:
error_code:
allOf:
- $ref: '#/components/schemas/ErrorCoderepresentstypeoftheerrorgotwhileexecutingcommand.ErrorCodepossiblevalues'
- description: >-
- NoError: returns default no error to the caller
- ConnectionError: ConnectionError if there is connection lost to device
- SetCommandFailed: SetCommandFailed returned when the first from list of edit command fails
- RequestTimedOut: RequestTimedOut returned execution of get, set or op rpc times out
- CommitFailed: CommitFailed returned when configuration to device fail
- ConfigLockFailed: ConfigLockFailed returned when lock to device fail
- EphemeralOpenFailed: EphemeralOpenFailed returns when opening ephemeral database fails.
- EphemeralCloseFailed: EphemeralCloseFailed return when closing ephemeral database fails.
result:
type: array
items:
$ref: '#/components/schemas/CommandResultPair'
description: ''
error:
type: string
v1DisconnectDeviceRequest:
title: v1DisconnectDeviceRequest
type: object
properties:
device_uuid:
type: string
v1GetDeviceConnectionsResponse:
title: v1GetDeviceConnectionsResponse
type: object
properties:
pod_connections:
type: array
items:
$ref: '#/components/schemas/v1PodConnections'
description: returns list of device connections held by each DCS pod having UUIDs.
typesCloseStreamingCmdResponse:
title: typesCloseStreamingCmdResponse
type: object
properties:
status:
$ref: '#/components/schemas/StatusofRequest'
error:
type: string
description: 'close long running device command eg: closing syslog channel over netconf.'
v1PodConnections:
title: v1PodConnections
type: object
properties:
connection_data:
type: array
items:
$ref: '#/components/schemas/typesConnData'
description: ''
pod_ip:
type: string
dcsv1GetRequest:
title: dcsv1GetRequest
type: object
properties:
device_info:
allOf:
- $ref: '#/components/schemas/typesDeviceInfo'
- description: DeviceInfo is the object in which the device details for command are passed from clients to deviceplugins.
command:
type: array
items:
type: string
description: ''
timeout:
type: integer
format: int32
user_input_cmd:
type: array
items:
$ref: '#/components/schemas/typesUserInputCommand'
description: ''
openlongrunningdevicecommandovernetconfegsyslog:
title: openlongrunningdevicecommandovernetconfegsyslog
type: object
properties:
status:
$ref: '#/components/schemas/StatusofRequest'
error:
type: string
error_code:
allOf:
- $ref: '#/components/schemas/ErrorCoderepresentstypeoftheerrorgotwhileexecutingcommand.ErrorCodepossiblevalues'
- description: >-
- NoError: returns default no error to the caller
- ConnectionError: ConnectionError if there is connection lost to device
- SetCommandFailed: SetCommandFailed returned when the first from list of edit command fails
- RequestTimedOut: RequestTimedOut returned execution of get, set or op rpc times out
- CommitFailed: CommitFailed returned when configuration to device fail
- ConfigLockFailed: ConfigLockFailed returned when lock to device fail
- EphemeralOpenFailed: EphemeralOpenFailed returns when opening ephemeral database fails.
- EphemeralCloseFailed: EphemeralCloseFailed return when closing ephemeral database fails.
command_id:
type: string
typesEphemeralInfo:
title: typesEphemeralInfo
type: object
properties:
ephemeral_open_cmd:
type: string
description: >-
Junos devices allow user to open ephemeral database and push the configuration.
command to open ephemeral database.
ephemeral_close_cmd:
type: string
description: command to close ephemeral database after pushing configuration to device.
typesCommandControl:
title: typesCommandControl
type: object
properties:
chunks:
type: string
start:
type: boolean
description: start of the command.
end:
type: boolean
description: end of the command.
dcsv1SetRequest:
title: dcsv1SetRequest
type: object
properties:
commit_info:
$ref: '#/components/schemas/typesCommitInfo'
device_info:
allOf:
- $ref: '#/components/schemas/typesDeviceInfo'
- description: DeviceInfo is the object in which the device details for command are passed from clients to deviceplugins.
command:
type: array
items:
type: string
description: ''
ephemeral_info:
$ref: '#/components/schemas/typesEphemeralInfo'
timeout:
type: integer
format: int32
Connectdeviceresponse:
title: Connectdeviceresponse
type: object
properties:
status:
$ref: '#/components/schemas/StatusofRequest'
error:
type: string
runtimeStreamError:
title: runtimeStreamError
type: object
properties:
message:
type: string
grpcCode:
type: integer
format: int32
httpStatus:
type: string
details:
type: array
items:
$ref: '#/components/schemas/protobufAny'
description: ''
httpCode:
type: integer
format: int32
OperationalCommandResponse:
title: OperationalCommandResponse
type: object
properties:
error_code:
allOf:
- $ref: '#/components/schemas/ErrorCoderepresentstypeoftheerrorgotwhileexecutingcommand.ErrorCodepossiblevalues'
- description: >-
- NoError: returns default no error to the caller
- ConnectionError: ConnectionError if there is connection lost to device
- SetCommandFailed: SetCommandFailed returned when the first from list of edit command fails
- RequestTimedOut: RequestTimedOut returned execution of get, set or op rpc times out
- CommitFailed: CommitFailed returned when configuration to device fail
- ConfigLockFailed: ConfigLockFailed returned when lock to device fail
- EphemeralOpenFailed: EphemeralOpenFailed returns when opening ephemeral database fails.
- EphemeralCloseFailed: EphemeralCloseFailed return when closing ephemeral database fails.
result:
type: array
items:
$ref: '#/components/schemas/CommandResultPair'
description: ''
error:
type: string
protobufAny:
title: protobufAny
type: object
properties:
typeUrl:
type: string
description: >-
A URL/resource name that uniquely identifies the type of the serialized
protocol buffer message. This string must contain at least
one "/" character. The last segment of the URL's path must represent
the fully qualified name of the type (as in
`path/google.protobuf.Duration`). The name should be in a canonical form
(e.g., leading "." is not accepted).
In practice, teams usually precompile into the binary all types that they
expect it to use in the context of Any. However, for URLs which use the
scheme `http`, `https`, or no scheme, one can optionally set up a type
server that maps type URLs to message definitions as follows:
* If no scheme is provided, `https` is assumed.
* An HTTP GET on the URL must yield a [google.protobuf.Type][]
value in binary format, or produce an error.
* Applications are allowed to cache lookup results based on the
URL, or have them precompiled into a binary to avoid any
lookup. Therefore, binary compatibility needs to be preserved
on changes to types. (Use versioned type names to manage
breaking changes.)
Note: this functionality is not currently available in the official
protobuf release, and it is not used for type URLs beginning with
type.googleapis.com.
Schemes other than `http`, `https` (or the empty scheme) might be
used with implementation specific semantics.
value:
type: string
description: Must be a valid serialized protocol buffer of the above specified type.
description: >-
`Any` contains an arbitrary serialized protocol buffer message along with a
URL that describes the type of the serialized message.
Protobuf library provides support to pack/unpack Any values in the form
of utility functions or additional generated methods of the Any type.
Example 1: Pack and unpack a message in C++.
Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
...
}
Example 2: Pack and unpack a message in Java.
Foo foo = ...;
Any any = Any.pack(foo);
...
if (any.is(Foo.class)) {
foo = any.unpack(Foo.class);
}
Example 3: Pack and unpack a message in Python.
foo = Foo(...)
any = Any()
any.Pack(foo)
...
if any.Is(Foo.DESCRIPTOR):
any.Unpack(foo)
...
Example 4: Pack and unpack a message in Go
foo := &pb.Foo{...}
any, err := ptypes.MarshalAny(foo)
...
foo := &pb.Foo{}
if err := ptypes.UnmarshalAny(any, foo); err != nil {
...
}
The pack methods provided by protobuf library will by default use
'type.googleapis.com/full.type.name' as the type URL and the unpack
methods only use the fully qualified type name after the last '/'
in the type URL, for example "foo.bar.com/x/y.z" will yield type
name "y.z".
JSON
====
The JSON representation of an `Any` value uses the regular
representation of the deserialized, embedded message, with an
additional field `@type` which contains the type URL. Example:
package google.profile;
message Person {
string first_name = 1;
string last_name = 2;
}
{
"@type": "type.googleapis.com/google.profile.Person",
"firstName": <string>,
"lastName": <string>
}
If the embedded message type is well-known and has a custom JSON
representation, that representation will be embedded adding a field
`value` which holds the custom JSON in addition to the `@type`
field. Example (for message [google.protobuf.Duration][]):
{
"@type": "type.googleapis.com/google.protobuf.Duration",
"value": "1.212s"
}
typesConnectionStatus:
title: typesConnectionStatus
enum:
- UNKNOWN_CONNECTION_STATUS
- UP
- DOWN
type: string
description: >-
ConnectionStatus use to publish device connection status UP/DOWN.
- UP: device connection status UP
- DOWN: device connection status down
StatusofRequest:
title: StatusofRequest
enum:
- UNKNOWN_STATUS
- SUCCESS
- FAILURE
type: string
typesStreamSetResponse:
title: typesStreamSetResponse
type: object
properties:
status:
$ref: '#/components/schemas/StatusofRequest'
error_code:
allOf:
- $ref: '#/components/schemas/ErrorCoderepresentstypeoftheerrorgotwhileexecutingcommand.ErrorCodepossiblevalues'
- description: >-
- NoError: returns default no error to the caller
- ConnectionError: ConnectionError if there is connection lost to device
- SetCommandFailed: SetCommandFailed returned when the first from list of edit command fails
- RequestTimedOut: RequestTimedOut returned execution of get, set or op rpc times out
- CommitFailed: CommitFailed returned when configuration to device fail
- ConfigLockFailed: ConfigLockFailed returned when lock to device fail
- EphemeralOpenFailed: EphemeralOpenFailed returns when opening ephemeral database fails.
- EphemeralCloseFailed: EphemeralCloseFailed return when closing ephemeral database fails.
error:
type: string
description: StreamSetResponse contains the result of executing huge configuration on device.
typesSubSystem:
title: typesSubSystem
enum:
- UNKNOWN_SUBSYSTEM
- Netconf
- Cli
type: string
description: >-
SubSystem to use to communicate with device, applicable for SSH protocol.
- Netconf: Netconf subsystem
- Cli: Cli subsystem
typesAuthInfo:
title: typesAuthInfo
type: object
properties:
password:
type: string
user:
type: string
description: user name to ssh to device.
ssh_key:
type: string
description: ssh public key of the device.
description: AuthInfo username and password to connect to device.
v1Callback:
title: v1Callback
type: object
properties:
endpoint:
type: string
uri:
type: string
typesSetResponse:
title: typesSetResponse
type: object
properties:
status:
$ref: '#/components/schemas/StatusofRequest'
index:
type: integer
format: int32
error_code:
allOf:
- $ref: '#/components/schemas/ErrorCoderepresentstypeoftheerrorgotwhileexecutingcommand.ErrorCodepossiblevalues'
- description: >-
- NoError: returns default no error to the caller
- ConnectionError: ConnectionError if there is connection lost to device
- SetCommandFailed: SetCommandFailed returned when the first from list of edit command fails
- RequestTimedOut: RequestTimedOut returned execution of get, set or op rpc times out
- CommitFailed: CommitFailed returned when configuration to device fail
- ConfigLockFailed: ConfigLockFailed returned when lock to device fail
- EphemeralOpenFailed: EphemeralOpenFailed returns when opening ephemeral database fails.
- EphemeralCloseFailed: EphemeralCloseFailed return when closing ephemeral database fails.
error:
type: string
description: SetResponse contains the result of executing configuration commands on device.
v1ConnectDeviceRequest:
title: v1ConnectDeviceRequest
type: object
properties:
edge_uuid:
type: string
least_used:
type: boolean
description: >-
flag used to identify least used DCS pod.
If it sets true which means already least used pod computation is done
and invoking particular pod instead of dcs service.
management_info:
allOf:
- $ref: '#/components/schemas/typesManagementInfo'
- description: ManagementInfo contains the information necessary to dail out device connection.
typesMember:
title: typesMember
type: object
properties:
loginConnectionState:
allOf:
- $ref: '#/components/schemas/typesConnectionStatus'
- description: >-
ConnectionStatus use to publish device connection status UP/DOWN.
- UP: device connection status UP
- DOWN: device connection status down
serialNumber:
type: string
role:
type: string
id:
type: string
Name:
type: string
Disconnectdeviceresponse:
title: Disconnectdeviceresponse
type: object
properties:
status:
$ref: '#/components/schemas/StatusofRequest'
error:
type: string
tags:
- name: ConnectivityService
description: ''