Add bandwidth related standard resource classes

Introduce NET_BW_EGR_KILOBIT_PER_SEC and
NET_BW_IGR_KILOBIT_PER_SEC resource classes.

blueprint bandwidth-resource-provider

Co-Authored-By: Balazs Gibizer <balazs.gibizer@ericsson.com>

Change-Id: I996bf705b14b564106426a2e57299638fb178750
This commit is contained in:
Matt Riedemann 2018-11-05 17:56:19 -05:00
parent 83e2ce65a0
commit 3f34f10cf6
3 changed files with 13 additions and 6 deletions

View File

@ -41,12 +41,19 @@ class ResourceClass(fields.StringField):
IPV4_ADDRESS = 'IPV4_ADDRESS'
VGPU = 'VGPU'
VGPU_DISPLAY_HEAD = 'VGPU_DISPLAY_HEAD'
# Standard resource class for network bandwidth egress measured in
# kilobits per second.
NET_BW_EGR_KILOBIT_PER_SEC = 'NET_BW_EGR_KILOBIT_PER_SEC'
# Standard resource class for network bandwidth ingress measured in
# kilobits per second.
NET_BW_IGR_KILOBIT_PER_SEC = 'NET_BW_IGR_KILOBIT_PER_SEC'
# The ordering here is relevant. If you must add a value, only
# append.
STANDARD = (VCPU, MEMORY_MB, DISK_GB, PCI_DEVICE, SRIOV_NET_VF,
NUMA_SOCKET, NUMA_CORE, NUMA_THREAD, NUMA_MEMORY_MB,
IPV4_ADDRESS, VGPU, VGPU_DISPLAY_HEAD)
IPV4_ADDRESS, VGPU, VGPU_DISPLAY_HEAD,
NET_BW_EGR_KILOBIT_PER_SEC, NET_BW_IGR_KILOBIT_PER_SEC)
@classmethod
def normalize_name(cls, rc_name):

View File

@ -16,7 +16,7 @@ tests:
- name: list resource classes
GET: /resource_classes
response_json_paths:
$.resource_classes.`len`: 12 # Number of standard resource classes
$.resource_classes.`len`: 14 # Number of standard resource classes
- name: create resource class
POST: /resource_classes

View File

@ -51,7 +51,7 @@ tests:
GET: /resource_classes
response_json_paths:
response_json_paths:
$.resource_classes.`len`: 12 # Number of standard resource classes
$.resource_classes.`len`: 14 # Number of standard resource classes
$.resource_classes[0].name: VCPU
- name: non admin forbidden
@ -138,9 +138,9 @@ tests:
- name: list resource classes after addition of custom res class
GET: /resource_classes
response_json_paths:
$.resource_classes.`len`: 13 # 12 standard plus 1 custom
$.resource_classes[12].name: $ENVIRON['CUSTOM_RES_CLASS']
$.resource_classes[12].links[?rel = "self"].href: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
$.resource_classes.`len`: 15 # 14 standard plus 1 custom
$.resource_classes[14].name: $ENVIRON['CUSTOM_RES_CLASS']
$.resource_classes[14].links[?rel = "self"].href: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
- name: update standard resource class bad json
PUT: /resource_classes/VCPU