Skip to content

Commit

Permalink
Update auto generated go snappi
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 29, 2024
1 parent cd418d4 commit 2243abf
Show file tree
Hide file tree
Showing 8 changed files with 21,683 additions and 20,669 deletions.
512 changes: 489 additions & 23 deletions gosnappi/gosnappi.go

Large diffs are not rendered by default.

36,195 changes: 18,260 additions & 17,935 deletions gosnappi/otg/otg.pb.go

Large diffs are not rendered by default.

36 changes: 35 additions & 1 deletion gosnappi/otg/otg.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Open Traffic Generator API 1.1.0
/* Open Traffic Generator API 1.2.0
* Open Traffic Generator API defines a model-driven, vendor-neutral and standard
* interface for emulating layer 2-7 network devices and generating test traffic.
*
Expand Down Expand Up @@ -6387,6 +6387,9 @@ message FlowTcp {

// Description missing in models
PatternFlowTcpWindow window = 15;

// Description missing in models
PatternFlowTcpChecksum checksum = 16;
}

// UDP packet header
Expand Down Expand Up @@ -17380,6 +17383,37 @@ message PatternFlowTcpWindow {
repeated PatternFlowTcpWindowMetricTag metric_tags = 7;
}

// The one's complement of the one's complement sum of all 16 bit words in header and
// text. An all-zero value means that no checksum will be transmitted. While computing
// the checksum, the checksum field itself is replaced with zeros.
message PatternFlowTcpChecksum {

message Choice {
enum Enum {
unspecified = 0;
generated = 1;
custom = 2;
}
}
// The type of checksum
// default = Choice.Enum.generated
optional Choice.Enum choice = 1;

message Generated {
enum Enum {
unspecified = 0;
good = 1;
bad = 2;
}
}
// A system generated checksum value
// default = Generated.Enum.good
optional Generated.Enum generated = 2;

// A custom checksum value
optional uint32 custom = 3;
}

// integer counter pattern
message PatternFlowUdpSrcPortCounter {

Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--prefer-binary
requests
grpcio~=1.59.0 ; python_version > '3.6'
grpcio~=1.35.0 ; python_version <= '3.6'
grpcio-tools~=1.35.0 ; python_version <= '3.6'
grpcio~=1.59.0 ; python_version > '3.6'
grpcio-tools~=1.59.0 ; python_version > '3.6'
grpcio~=1.35.0 ; python_version <= '3.6'
protobuf~=3.15.0 ; python_version <= '3.6'
requests
protobuf~=4.24.4 ; python_version > '3.6'
protobuf~=3.15.0 ; python_version <= '3.6'
PyYAML
urllib3
semantic_version
1 change: 1 addition & 0 deletions snappi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@
from .snappi import PatternFlowTcpWindowCounter
from .snappi import PatternFlowTcpWindowMetricTag
from .snappi import PatternFlowTcpWindowMetricTagIter
from .snappi import PatternFlowTcpChecksum
from .snappi import FlowUdp
from .snappi import PatternFlowUdpSrcPort
from .snappi import PatternFlowUdpSrcPortCounter
Expand Down
45 changes: 44 additions & 1 deletion snappi/docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ info:
\ issue](https://github.com/open-traffic-generator/models/issues) in the models\
\ repository\n- [fork the models repository](https://github.com/open-traffic-generator/models)\
\ and submit a PR"
version: 1.1.0
version: 1.2.0
contact:
url: https://github.com/open-traffic-generator/models
license:
Expand Down Expand Up @@ -8534,6 +8534,9 @@ components:
window:
x-field-uid: 15
$ref: '#/components/schemas/Pattern.Flow.Tcp.Window'
checksum:
x-field-uid: 16
$ref: '#/components/schemas/Pattern.Flow.Tcp.Checksum'
Flow.Udp:
description: |-
UDP packet header
Expand Down Expand Up @@ -24130,6 +24133,46 @@ components:
items:
$ref: '#/components/schemas/Pattern.Flow.Tcp.Window.MetricTag'
x-field-uid: 7
Pattern.Flow.Tcp.Checksum:
description: |-
The one's complement of the one's complement sum of all 16 bit words in header and text. An all-zero value means that no checksum will be transmitted. While computing the checksum, the checksum field itself is replaced with zeros.
type: object
properties:
choice:
description: |-
The type of checksum
type: string
x-enum:
generated:
x-field-uid: 1
custom:
x-field-uid: 2
default: generated
x-field-uid: 1
enum:
- generated
- custom
generated:
description: |-
A system generated checksum value
type: string
x-enum:
good:
x-field-uid: 1
bad:
x-field-uid: 2
default: good
x-field-uid: 2
enum:
- good
- bad
custom:
description: |-
A custom checksum value
type: integer
format: uint32
maximum: 65535
x-field-uid: 3
Pattern.Flow.Udp.SrcPort.Counter:
description: |-
integer counter pattern
Expand Down
5,414 changes: 2,712 additions & 2,702 deletions snappi/otg_pb2.py

Large diffs are not rendered by default.

141 changes: 138 additions & 3 deletions snappi/snappi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Open Traffic Generator API 1.1.0
# Open Traffic Generator API 1.2.0
# License: MIT

import importlib
Expand Down Expand Up @@ -58533,6 +58533,7 @@ class FlowTcp(OpenApiObject):
"ctl_syn": {"type": "PatternFlowTcpCtlSyn"},
"ctl_fin": {"type": "PatternFlowTcpCtlFin"},
"window": {"type": "PatternFlowTcpWindow"},
"checksum": {"type": "PatternFlowTcpChecksum"},
} # type: Dict[str, str]

_REQUIRED = () # type: tuple(str)
Expand Down Expand Up @@ -58710,6 +58711,17 @@ def window(self):
"""
return self._get_property("window", PatternFlowTcpWindow)

@property
def checksum(self):
# type: () -> PatternFlowTcpChecksum
"""checksum getter

The one's complement of the one's complement sum of all 16 bit words in header and text. An all-zero value means that no checksum will be transmitted. While computing the checksum, the checksum field itself is replaced with zeros.The one's complement of the one's complement sum of all 16 bit words in header and text. An all-zero value means that no checksum will be transmitted. While computing the checksum, the checksum field itself is replaced with zeros.The one's complement of the one's complement sum of all 16 bit words in header and text. An all-zero value means that no checksum will be transmitted. While computing the checksum, the checksum field itself is replaced with zeros.The one's complement of the one's complement sum of all 16 bit words in header and text. An all-zero value means that no checksum will be transmitted. While computing the checksum, the checksum field itself is replaced with zeros.

Returns: PatternFlowTcpChecksum
"""
return self._get_property("checksum", PatternFlowTcpChecksum)


class PatternFlowTcpSrcPort(OpenApiObject):
__slots__ = ("_parent", "_choice")
Expand Down Expand Up @@ -65270,6 +65282,129 @@ def add(self, name=None, offset=0, length=16):
return item


class PatternFlowTcpChecksum(OpenApiObject):
__slots__ = ("_parent", "_choice")

_TYPES = {
"choice": {
"type": str,
"enum": [
"generated",
"custom",
],
},
"generated": {
"type": str,
"enum": [
"good",
"bad",
],
},
"custom": {
"type": int,
"format": "uint32",
"maximum": 65535,
},
} # type: Dict[str, str]

_REQUIRED = () # type: tuple(str)

_DEFAULTS = {
"choice": "generated",
"generated": "good",
} # type: Dict[str, Union(type)]

GENERATED = "generated" # type: str
CUSTOM = "custom" # type: str

GOOD = "good" # type: str
BAD = "bad" # type: str

_STATUS = {} # type: Dict[str, Union(type)]

def __init__(self, parent=None, choice=None, generated="good", custom=None):
super(PatternFlowTcpChecksum, self).__init__()
self._parent = parent
self._set_property("generated", generated)
self._set_property("custom", custom)
if (
"choice" in self._DEFAULTS
and choice is None
and self._DEFAULTS["choice"] in self._TYPES
):
getattr(self, self._DEFAULTS["choice"])
else:
self._set_property("choice", choice)

def set(self, generated=None, custom=None):
for property_name, property_value in locals().items():
if property_name != "self" and property_value is not None:
self._set_property(property_name, property_value)

@property
def choice(self):
# type: () -> Union[Literal["custom"], Literal["generated"]]
"""choice getter

The type of checksum

Returns: Union[Literal["custom"], Literal["generated"]]
"""
return self._get_property("choice")

@choice.setter
def choice(self, value):
"""choice setter

The type of checksum

value: Union[Literal["custom"], Literal["generated"]]
"""
self._set_property("choice", value)

@property
def generated(self):
# type: () -> Union[Literal["bad"], Literal["good"]]
"""generated getter

A system generated checksum value

Returns: Union[Literal["bad"], Literal["good"]]
"""
return self._get_property("generated")

@generated.setter
def generated(self, value):
"""generated setter

A system generated checksum value

value: Union[Literal["bad"], Literal["good"]]
"""
self._set_property("generated", value, "generated")

@property
def custom(self):
# type: () -> int
"""custom getter

A custom checksum value

Returns: int
"""
return self._get_property("custom")

@custom.setter
def custom(self, value):
"""custom setter

A custom checksum value

value: int
"""
self._set_property("custom", value, "custom")


class FlowUdp(OpenApiObject):
__slots__ = "_parent"

Expand Down Expand Up @@ -133432,8 +133567,8 @@ class Api(object):

def __init__(self, **kwargs):
self._version_meta = self.version()
self._version_meta.api_spec_version = "1.1.0"
self._version_meta.sdk_version = "1.1.1"
self._version_meta.api_spec_version = "1.2.0"
self._version_meta.sdk_version = "1.2.0"
self._version_check = kwargs.get("version_check")
if self._version_check is None:
self._version_check = False
Expand Down

0 comments on commit 2243abf

Please sign in to comment.