purity_fb_1dot6.AdminsApi
All URIs are relative to https://purity_fb_server/api
Method | HTTP request | Description |
---|---|---|
list_admins | GET /1.6/admins | |
update_admins | PATCH /1.6/admins |
list_admins
AdminResponse list_admins(expose=expose, names=names)
list all administrative accounts
Example
from purity_fb import PurityFb, Admin, rest
fb = PurityFb('10.255.8.20') # assume the array IP is 10.255.8.20
fb.disable_verify_ssl()
try:
res = fb.login(API_TOKEN) # login to the array with your API_TOKEN
except rest.ApiException as e:
print('Exception when logging in to the array: %s\n' % e)
if res:
try:
# list all admin accounts (given sufficient permissions)
res = fb.admins.list_admins()
# list a subset of admin accounts by name
res = fb.admins.list_admins(names=['pureuser'])
except rest.ApiException as e:
print("Exception when listing admins: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
expose | bool | display the unmasked API token | [optional] [default to false] |
names | list[str] | A list of names. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to Overview]
update_admins
AdminResponse update_admins(admin, names=names)
update administrative account attributes
Example
from purity_fb import PurityFb, Admin, rest
fb = PurityFb('10.255.8.20') # assume the array IP is 10.255.8.20
fb.disable_verify_ssl()
try:
res = fb.login(API_TOKEN) # login to the array with your API_TOKEN
except rest.ApiException as e:
print('Exception when logging in to the array: %s\n' % e)
if res:
try:
# change password
myAdmin = Admin()
myAdmin.old_password = "pureuser"
myAdmin.password = "fakepass"
res = fb.admins.update_admins(myAdmin, names=['pureuser'])
except rest.ApiException as e:
print("Exception when changing password: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
admin | Admin | ||
names | list[str] | A list of names. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to Overview]