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

unable to increase hard quotas #20

Open
newbee162 opened this issue Jan 12, 2020 · 2 comments
Open

unable to increase hard quotas #20

newbee162 opened this issue Jan 12, 2020 · 2 comments
Assignees
Labels
Bug_SDK Bugs related to SDK and surrounding scripts

Comments

@newbee162
Copy link

want to increase the hard quotas , but can't seem to get it right. I am able to update "enforced"

api_instance = isi_sdk_8_2_1.QuotaApi(isi_sdk_8_2_1.ApiClient(configuration))
quota_api = isi_sdk_8_2_1.QuotaApi(api_client)
quota_quota_id = 'HwAHAAEAAAAAAAAAAAAAQAEAAAAAAAAA'

quota_quota = isi_sdk_8_2_1.QuotaQuotaThresholds(
hard=3221225472)

Output:
"code" : "AEC_BAD_REQUEST",
"field" : "hard",
"message" : "Field: hard has error: A property was present that is not defined by the schema."
},
{
"code" : "AEC_BAD_REQUEST",
"message" : "Input validation failed."
}

What am i doing wrong?

@vboddui vboddui added Bug_SDK Bugs related to SDK and surrounding scripts bug labels Apr 21, 2020
@vboddui
Copy link

vboddui commented Apr 21, 2020

Updating hard via OneFS CLI is working fine, should be a bug in SDK.

@vboddui vboddui removed the bug label Apr 24, 2020
@vboddui
Copy link

vboddui commented Apr 24, 2020

import isi_sdk_8_2_2 as sdk
conf = sdk.Configuration()

conf.host = 'https://<onefs_node_ip>:8080'
conf.username='root'
conf.password='a'
conf.verify_ssl = False

client = sdk.ApiClient(conf)
qapi = sdk.QuotaApi(client)
resp = qapi.list_quota_quotas()

print(resp.quotas[0].id)

hquota = sdk.QuotaQuotaThresholds(hard=3221225472)
print(hquota)
qapi.update_quota_quota(hquota, resp.quotas[0].id)
python  quotatest.py
EAEGAAEAAAAAAAAAAAAAQAEAAAAAAAAA
{'advisory': None,
 'hard': 3221225472,
 'percent_advisory': None,
 'percent_soft': None,
 'soft': None,
 'soft_grace': None}
Traceback (most recent call last):
  File "quotatest.py", line 17, in <module>
    qapi.update_quota_quota(hquota, resp.quotas[0].id)
  File "..//isi_sdk_python/isi_sdk_8_2_2/isi_sdk_8_2_2/api/quota_api.py", line 2317, in update_quota_quota
    (data) = self.update_quota_quota_with_http_info(quota_quota, quota_quota_id, **kwargs)  # noqa: E501
  File "..//isi_sdk_python/isi_sdk_8_2_2/isi_sdk_8_2_2/api/quota_api.py", line 2402, in update_quota_quota_with_http_info
    collection_formats=collection_formats)
  File "..//isi_sdk_python/isi_sdk_8_2_2/isi_sdk_8_2_2/api_client.py", line 346, in call_api
    _preload_content, _request_timeout)
  File "..//isi_sdk_python/isi_sdk_8_2_2/isi_sdk_8_2_2/api_client.py", line 177, in __call_api
    _request_timeout=_request_timeout)
  File "..//isi_sdk_python/isi_sdk_8_2_2/isi_sdk_8_2_2/api_client.py", line 397, in request
    body=body)
  File "..//isi_sdk_python/isi_sdk_8_2_2/isi_sdk_8_2_2/rest.py", line 369, in PUT
    body=body)
  File "..//isi_sdk_python/isi_sdk_8_2_2/isi_sdk_8_2_2/rest.py", line 236, in request
    raise ApiException(http_resp=r)
isi_sdk_8_2_2.rest.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Transfer-Encoding': 'chunked', 'Strict-Transport-Security': 'max-age=31536000;', 'Server': 'Apache', 'Connection': 'close', 'Allow': 'GET, PUT, DELETE, HEAD', 'Date': 'Fri, 24 Apr 2020 09:46:42 GMT', 'X-Frame-Options': 'sameorigin', 'Content-Type': 'application/json'})
HTTP response body:
{
"errors" :
[

{
"code" : "AEC_BAD_REQUEST",
"field" : "hard",
"message" : "Field: hard has error: A property was present that is not defined by the schema."
},

{
"code" : "AEC_BAD_REQUEST",
"message" : "Input validation failed."
}
]
}

@vboddui vboddui self-assigned this Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug_SDK Bugs related to SDK and surrounding scripts
Projects
None yet
Development

No branches or pull requests

2 participants