-
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 #16 from dell/Rv1.10.0
Rv1.10.0
- Loading branch information
Showing
15 changed files
with
324 additions
and
40 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
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,51 @@ | ||
# 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 FirmwareRepository(base_client.EntityRequest): | ||
def get(self, filters=None, limit=None, offset=None, sort=None, related=False, bundles=False, components=False): | ||
""" | ||
Retrieve all firmware repository 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. | ||
:param related: Whether to include related entities in the response. | ||
:param bundles: Whether to include bundles in the response. | ||
:param components: Whether to include components in the response. | ||
:return: A list of dictionary containing the retrieved firmware repository. | ||
""" | ||
params = dict( | ||
filter=filters, | ||
sort=sort, | ||
offset=offset, | ||
limit=limit, | ||
related=related, | ||
bundles=bundles, | ||
components=components | ||
) | ||
r, response = self.send_get_request(utils.build_uri_with_params(self.firmware_repository_url, **params)) | ||
if r.status_code != requests.codes.ok: | ||
msg = (f'Failed to retrieve firmware repository. 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
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
Oops, something went wrong.