-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from Bhavneet-Sharma/release_1.9.0
Release version 1.9.0
- Loading branch information
Showing
14 changed files
with
346 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright (c) 2024 Dell Inc. or its subsidiaries. | ||
# All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
import logging | ||
import requests | ||
from PyPowerFlex import base_client | ||
from PyPowerFlex import exceptions | ||
from PyPowerFlex import utils | ||
LOG = logging.getLogger(__name__) | ||
|
||
|
||
class Deployment(base_client.EntityRequest): | ||
def get(self, filters=None, full=None, include_devices=None, include_template=None, | ||
limit=None, offset=None, sort=None): | ||
""" | ||
Retrieve all Deployments with filter, sort, pagination | ||
:param filters: (Optional) The filters to apply to the results. | ||
:param full: (Optional) Whether to return full details for each result. | ||
:param include_devices: (Optional) Whether to include devices in the response. | ||
:param include_template: (Optional) Whether to include service templates in the response. | ||
:param limit: (Optional) Page limit. | ||
:param offset: (Optional) Pagination offset. | ||
:param sort: (Optional) The field to sort the results by. | ||
:return: A list of dictionary containing the retrieved Deployments. | ||
""" | ||
params = dict( | ||
filter=filters, | ||
full=full, | ||
sort=sort, | ||
offset=offset, | ||
limit=limit, | ||
includeDevices=include_devices, | ||
includeTemplate=include_template | ||
) | ||
r, response = self.send_get_request(utils.build_uri_with_params(self.deployment_url, **params)) | ||
if r.status_code != requests.codes.ok: | ||
msg = (f'Failed to retrieve deployments. Error: {response}') | ||
LOG.error(msg) | ||
raise exceptions.PowerFlexClientException(msg) | ||
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright (c) 2024 Dell Inc. or its subsidiaries. | ||
# All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
import logging | ||
import requests | ||
from PyPowerFlex import base_client | ||
from PyPowerFlex import exceptions | ||
from PyPowerFlex import utils | ||
LOG = logging.getLogger(__name__) | ||
|
||
class ManagedDevice(base_client.EntityRequest): | ||
def get(self, filters=None, limit=None, offset=None, sort=None): | ||
""" | ||
Retrieve all devices from inventory with filter, sort, pagination | ||
:param filters: (Optional) The filters to apply to the results. | ||
:param limit: (Optional) Page limit. | ||
:param offset: (Optional) Pagination offset. | ||
:param sort: (Optional) The field to sort the results by. | ||
:return: A list of dictionary containing the retrieved devices from inventory. | ||
""" | ||
params = dict( | ||
filter=filters, | ||
limit=limit, | ||
offset=offset, | ||
sort=sort | ||
) | ||
r, response = self.send_get_request(utils.build_uri_with_params(self.managed_device_url, **params)) | ||
if r.status_code != requests.codes.ok: | ||
msg = (f'Failed to retrieve managed devices. Error: {response}') | ||
LOG.error(msg) | ||
raise exceptions.PowerFlexClientException(msg) | ||
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright (c) 2024 Dell Inc. or its subsidiaries. | ||
# All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
import logging | ||
import requests | ||
from PyPowerFlex import base_client | ||
from PyPowerFlex import exceptions | ||
from PyPowerFlex import utils | ||
LOG = logging.getLogger(__name__) | ||
|
||
class ServiceTemplate(base_client.EntityRequest): | ||
def get(self, filters=None, full=None, limit=None, offset=None, sort=None, include_attachments=None): | ||
""" | ||
Retrieve all Service Templates with filter, sort, pagination | ||
:param filters: (Optional) The filters to apply to the results. | ||
:param full: (Optional) Whether to return full details for each result. | ||
:param limit: (Optional) Page limit. | ||
:param offset: (Optional) Pagination offset. | ||
:param sort: (Optional) The field to sort the results by. | ||
:param include_attachments: (Optional) Whether to include attachments. | ||
:return: A list of dictionary containing the retrieved Service Templates. | ||
""" | ||
params = dict( | ||
filter=filters, | ||
full=full, | ||
limit=limit, | ||
offset=offset, | ||
sort=sort, | ||
includeAttachments=include_attachments | ||
) | ||
r, response = self.send_get_request(utils.build_uri_with_params(self.service_template_url, **params)) | ||
if r.status_code != requests.codes.ok: | ||
msg = (f'Failed to retrieve service templates. Error: {response}') | ||
LOG.error(msg) | ||
raise exceptions.PowerFlexClientException(msg) | ||
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.