Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add loopback interface command #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions sonic_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,123 @@ paths:
schema:
$ref: '#/definitions/Error'
#----------------------------------------------
# Loopback interface object
#----------------------------------------------
'/config/interface/loopback/{id}':
put:
summary: Create/update loopback interface.
description: If the interface is already exists, update the attr
parameters:
- name: id
in: path
required: true
type: integer
description: loopback interface number
- in: body
name: attr
required: true
description: attributes loopback interface
schema:
$ref: '#/definitions/LoopbackEntry'
responses:
'204':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'403':
description: Capacity insufficient
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
delete:
summary: Remove loopback interface
description: If the loopback interface doesn't exist, return '404'
parameters:
- in: path
name: id
type: integer
required: true
description: loopback interface number
responses:
'204':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Object not found
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
get:
summary: Get loopback interface information
description: If the loopback interface doesn't exist, return '404'
parameters:
- name: id
in: path
required: true
type: integer
description: loopback interface number
responses:
'200':
description: OK
schema:
type: object
required:
- id
- attr
properties:
id:
type: integer
description: loopback interface number
attr:
$ref: '#/definitions/LoopbackEntry'
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Object not found
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
#----------------------------------------------
# Schema definitions
#----------------------------------------------
definitions:
Expand Down Expand Up @@ -1400,3 +1517,18 @@ definitions:
ip_addr:
type: string
description: IP address of directly attached device to the switch
LoopbackEntry:
type: object
required:
- description
properties:
description:
type: string
ipv4_addr:
type: string
ipv6_addr:
type: string
ip_redirects:
type: boolean
ip_proxy_arp:
type: boolean