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

Update API Spec for host mapping model changes #815

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion delfin/api/v1/storage_host_initiators.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class StorageHostInitiatorController(wsgi.Controller):
def __init__(self):
super(StorageHostInitiatorController, self).__init__()
self.search_options = ['name', 'status', 'wwn', 'id', 'storage_id',
'native_storage_host_id',
'type', 'native_storage_host_id',
'native_storage_host_initiator_id']

def _get_storage_host_initiator_search_options(self):
Expand Down
10 changes: 9 additions & 1 deletion delfin/drivers/fake_storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,11 @@ def list_storage_host_initiators(self, ctx):
MIN_STORAGE_HOST_INITIATORS, MAX_STORAGE_HOST_INITIATORS)
LOG.info("###########fake_storage_host_initiators for %s: %d"
% (self.storage_id, rd_storage_host_initiators_count))
initiator_type = list(constants.InitiatorType.ALL)
initiator_type_len = len(constants.InitiatorType.ALL) - 1
initiator_status = list(constants.InitiatorStatus.ALL)
initiator_status_len = len(constants.InitiatorStatus.ALL) - 1

storage_host_initiators_list = []
for idx in range(rd_storage_host_initiators_count):
f = {
Expand All @@ -871,7 +876,10 @@ def list_storage_host_initiators(self, ctx):
"native_storage_host_initiator_id":
"storage_host_initiator_" + str(idx),
"wwn": "wwn_" + str(idx),
"status": "Normal",
"type": initiator_type[
random.randint(0, initiator_type_len)],
"status": initiator_status[
random.randint(0, initiator_status_len)],
"native_storage_host_id": "storage_host_" + str(idx),
}
storage_host_initiators_list.append(f)
Expand Down
31 changes: 26 additions & 5 deletions openapi-spec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2430,6 +2430,21 @@ paths:
explode: true
schema:
type: string
- name: type
in: query
description: The storage host initiator type
required: false
style: form
explode: true
schema:
type: string
enum:
- fc
- iscsi
- roce
- nvm-of
- sas
- unknown
- name: status
in: query
description: The storage host initiator status
Expand Down Expand Up @@ -4233,6 +4248,17 @@ components:
type: string
readOnly: true
example: "storage host initiator"
type:
type: string
readOnly: true
enum:
- fc
- iscsi
- roce
- nvm-of
- sas
- unknown
example: fc
wwn:
type: string
readOnly: true
Expand Down Expand Up @@ -4435,11 +4461,6 @@ components:
readOnly: true
description: Actual ID of the volume in the storage backend.
example: volume_0
native_port_id:
type: string
readOnly: true
description: Actual ID of the port in the storage backend.
example: port_0
StorageBackendAlertSync:
type: object
properties:
Expand Down