Skip to content

Commit

Permalink
Update docs and actions
Browse files Browse the repository at this point in the history
Update docs and actions using server properties to use hypervisor name instead of hypervisor id
  • Loading branch information
gmatthews20 committed Sep 26, 2024
1 parent 3cb10c3 commit 744c3f0
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 22 deletions.
4 changes: 2 additions & 2 deletions actions/server.list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parameters:
properties_to_select:
default:
- "flavor_id"
- "hypervisor_id"
- "hypervisor_name"
- "image_id"
- "project_id"
- "server_creation_date"
Expand All @@ -43,7 +43,7 @@ parameters:
description: "
A comma-spaced list of server properties to display for the resulting servers - leave empty for all properties. One of:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand Down
8 changes: 4 additions & 4 deletions actions/server.search.by.datetime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parameters:
properties_to_select:
default:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand All @@ -43,7 +43,7 @@ parameters:
description: "
A comma-spaced list of server properties to display for the resulting servers - leave empty for all properties. One of:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand Down Expand Up @@ -125,7 +125,7 @@ parameters:
default: null
enum:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand All @@ -140,7 +140,7 @@ parameters:
- multiple of the same property will be ignored.
Any of:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand Down
10 changes: 5 additions & 5 deletions actions/server.search.by.property.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parameters:
properties_to_select:
default:
- "flavor_id"
- "hypervisor_id"
- "hypervisor_name"
- "image_id"
- "project_id"
- "server_creation_date"
Expand All @@ -43,7 +43,7 @@ parameters:
description: "
A comma-spaced list of server properties to display for the resulting servers - leave empty for all properties. One of:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand Down Expand Up @@ -75,7 +75,7 @@ parameters:
description: "choose property to search by (acts as OR for each)"
enum:
- "flavor_id"
- "hypervisor_id"
- "hypervisor_name"
- "image_id"
- "server_description"
- "server_id"
Expand Down Expand Up @@ -113,7 +113,7 @@ parameters:
default: null
enum:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand All @@ -128,7 +128,7 @@ parameters:
- multiple of the same property will be ignored.
Any of:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand Down
10 changes: 5 additions & 5 deletions actions/server.search.by.regex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parameters:
properties_to_select:
default:
- "flavor_id"
- "hypervisor_id"
- "hypervisor_name"
- "image_id"
- "project_id"
- "server_creation_date"
Expand All @@ -43,7 +43,7 @@ parameters:
description: "
A comma-spaced list of server properties to display for the resulting servers - leave empty for all properties. One of:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand Down Expand Up @@ -75,7 +75,7 @@ parameters:
description: "choose property to search by"
enum:
- "flavor_id"
- "hypervisor_id"
- "hypervisor_name"
- "image_id"
- "server_description"
- "server_id"
Expand Down Expand Up @@ -105,7 +105,7 @@ parameters:
default: null
enum:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand All @@ -120,7 +120,7 @@ parameters:
- multiple of the same property will be ignored.
Any of:
- 'flavor_id'
- 'hypervisor_id'
- 'hypervisor_name'
- 'image_id'
- 'project_id'
- 'server_creation_date'
Expand Down
2 changes: 1 addition & 1 deletion lib/email_api/email_template_schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ shutoff_vm:
html_filepath: "html/shutoff_vm.html.j2"
plaintext_filepath: "plaintext/shutoff_vm.txt.j2"

hypervisor_vm:
vms_on_hypervisor:
schema:
username: null
vm_table: "No VMs"
Expand Down
5 changes: 4 additions & 1 deletion lib/enums/query/props/server_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def _get_aliases():
A method that returns all valid string alias mappings
"""
return {
ServerProperties.HYPERVISOR_NAME: ["hv_name", "hypervisor_name"],
ServerProperties.HYPERVISOR_NAME: [
"hv_name",
"hypervisor_name",
], # Changed from Host ID as hosts aren't the same as hypervisors
ServerProperties.SERVER_CREATION_DATE: ["created_at"],
ServerProperties.SERVER_DESCRIPTION: [
"description",
Expand Down
6 changes: 3 additions & 3 deletions lib/openstack_query/docs/user_docs/query_docs/SERVERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ from enums.query.props.server_properties import ServerProperties
| Property Enum | Type | Aliases | Description |
|--------------------------|--------------|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| FLAVOR_ID | `string` | `None` | The ID of the Flavor the Server is using |
| HYPERVISOR_ID | `string` | `None` | The ID of the Hypervisor the Server is being hosted on |
| HYPERVISOR_NAME | `string` | `None` | Name of the Hypervisor the Server is being hosted on |
| IMAGE_ID | `string` | `None` | The ID of the Image the Server is using |
| PROJECT_ID | `string` | `None` | The ID of the Project the Server is associated with |
| SERVER_CREATION_DATE | `string` (x) | "created_at" | Timestamp of when the server was created. |
Expand Down Expand Up @@ -69,7 +69,7 @@ The following shared-common properties are listed below (as well as the Query ob
| ServerProperties.PROJECT_ID | ProjectProperties.PROJECT_ID | Many-to-One | `ServerQuery` to `ProjectQuery` | [PROJECTS.md](PROJECTS.md) |
| ServerProperties.FLAVOR_ID | FlavorProperties.FLAVOR_ID | Many-to-One | `ServerQuery` to `FlavorQuery` | [FLAVORS.md](FLAVORS.md) |
| ServerProperties.IMAGE_ID | ImageProperties.IMAGE_ID | Many-to-One | `ServerQuery` to `ImageQuery` | [IMAGES.md](IMAGES.md) |
| ServerProperties.HYPERVISOR_ID | HypervisorProperties.HYPERVISOR_ID | Many-to-One | `ServerQuery` to `HypervisorQuery` | [HYPERVISORS.md](HYPERVISORS.md) |
| ServerProperties.HYPERVISOR_NAME | HypervisorProperties.HYPERVISOR_NAME | Many-to-One | `ServerQuery` to `HypervisorQuery` | [HYPERVISORS.md](HYPERVISORS.md) |



Expand All @@ -82,7 +82,7 @@ Chaining from other `ServerQuery` requires passing `SERVER_QUERY` or any aliases
| `ProjectQuery` | ProjectProperties.PROJECT_ID | ServerProperties.PROJECT_ID | One-to-Many | [PROJECTS.md](PROJECTS.md) |
| `FlavorQuery` | FlavorProperties.FLAVOR_ID | ServerProperties.FLAVOR_ID | One-to-Many | [FLAVORS.md](FLAVORS.md) |
| `ImageQuery` | ImageProperties.IMAGE_ID | ServerProperties.IMAGE_ID | Many-to-One | [IMAGES.md](IMAGES.md) |
| `HypervisorQuery` | HypervisorProperties.HYPERVISOR_ID | ServerProperties.FLAVOR_ID | One-to-Many | [HYPERVISORS.md](HYPERVISORS.md) |
| `HypervisorQuery` | HypervisorProperties.HYPERVISOR_NAME | ServerProperties.FLAVOR_ID | One-to-Many | [HYPERVISORS.md](HYPERVISORS.md) |


## run() meta-parameters
Expand Down
2 changes: 1 addition & 1 deletion tests/enums/props/test_server_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_flavor_id_serialization(val):
)
def test_hypervisor_name_serialization(val):
"""
Tests that variants of HYPERVISOR_ID can be serialized
Tests that variants of HYPERVISOR_NAME can be serialized
"""
assert ServerProperties.from_string(val) is ServerProperties.HYPERVISOR_NAME

Expand Down

0 comments on commit 744c3f0

Please sign in to comment.