Skip to content

Commit

Permalink
Auto-Generated Python SDK modules (#45)
Browse files Browse the repository at this point in the history
Signed-off-by: Suneethkumar Byadarahalli <[email protected]>
  • Loading branch information
suneeth51 authored Mar 18, 2021
1 parent e9e295c commit 073e8fe
Show file tree
Hide file tree
Showing 8 changed files with 1,148 additions and 896 deletions.
6 changes: 6 additions & 0 deletions nimbleclient/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
InitiatorGroupFields,
JobFields,
KeyManagerFields,
LdapDomainFields,
MasterKeyFields,
NetworkConfigFields,
NetworkInterfaceFields,
Expand All @@ -44,6 +45,8 @@
SoftwareVersionFields,
SpaceDomainFields,
SubnetFields,
SubscriberFields,
SubscriptionFields,
TokenFields,
UserFields,
UserGroupFields,
Expand Down Expand Up @@ -77,6 +80,7 @@
"InitiatorGroupFields",
"JobFields",
"KeyManagerFields",
"LdapDomainFields",
"MasterKeyFields",
"NetworkConfigFields",
"NetworkInterfaceFields",
Expand All @@ -93,6 +97,8 @@
"SoftwareVersionFields",
"SpaceDomainFields",
"SubnetFields",
"SubscriberFields",
"SubscriptionFields",
"TokenFields",
"UserFields",
"UserGroupFields",
Expand Down
123 changes: 123 additions & 0 deletions nimbleclient/v1/api/ldap_domains.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#
# © Copyright 2020 Hewlett Packard Enterprise Development LP
#
# This file was auto-generated by the Python SDK generator; DO NOT EDIT.
#


from ...resource import Resource, Collection


class LdapDomain(Resource):
"""Manages the storage array's membership with LDAP servers.
# Parameters
id : Identifier for the LDAP Domain.
domain_name : Domain name.
domain_description : Description of the domain.
domain_enabled : Indicates whether the LDAP domain is currently active or not.
server_uri_list : A set of up to 3 LDAP URIs.
bind_user : Full Distinguished Name of LDAP admin user. If empty, attempt to bind anonymously.
bind_password : Password for the Full Distinguished Name of LDAP admin user. This parameter is mandatory if the bind_user is given.
base_dn : The Distinguished Name of the base object from which to start all searches.
user_search_filter : Limit the results returned based on specific search criteria.
user_search_base_list : A set of upto 10 Relative Distinguished Names, relative to the Base DN, from which to search for User objects.
group_search_filter : Limit the results returned based on specific search criteria.
group_search_base_list : A set of upto 10 Relative Distinguished Names, relative to the Base DN, from which to search for Group objects.
schema_type : Enum values are OpenLDAP or AD.
"""
def test_user(self, user, **kwargs):
"""Tests whether the user exist in the given LDAP Domain.
# Parameters
id : Unique identifier for the LDAP Domain.
user : Name of the LDAP Domain user.
"""

return self._collection.test_user(
self.id,
user,
**kwargs
)
def test_group(self, group, **kwargs):
"""Tests whether the user group exist in the given LDAP Domain.
# Parameters
id : Unique identifier for the LDAP Domain.
group : Name of the group.
"""

return self._collection.test_group(
self.id,
group,
**kwargs
)
def report_status(self, **kwargs):
"""Reports the LDAP connectivity status of the given LDAP ID.
# Parameters
id : Unique identifier for the LDAP Domain.
"""

return self._collection.report_status(
self.id,
**kwargs
)


class LdapDomainList(Collection):
resource = LdapDomain
resource_type = "ldap_domains"

def test_user(self, id, user, **kwargs):
"""Tests whether the user exist in the given LDAP Domain.
# Parameters
id : Unique identifier for the LDAP Domain.
user : Name of the LDAP Domain user.
"""

return self._client.perform_resource_action(
self.resource_type,
id,
'test_user',
id=id,
user=user,
**kwargs
)

def test_group(self, id, group, **kwargs):
"""Tests whether the user group exist in the given LDAP Domain.
# Parameters
id : Unique identifier for the LDAP Domain.
group : Name of the group.
"""

return self._client.perform_resource_action(
self.resource_type,
id,
'test_group',
group=group,
id=id,
**kwargs
)

def report_status(self, id, **kwargs):
"""Reports the LDAP connectivity status of the given LDAP ID.
# Parameters
id : Unique identifier for the LDAP Domain.
"""

return self._client.perform_resource_action(
self.resource_type,
id,
'report_status',
id=id,
**kwargs
)

def create(self, **kwargs):
resp = self._client.create_resource(self.resource_type, **kwargs)
return self.resource(resp['id'], resp, client=self._client, collection=self)
Loading

0 comments on commit 073e8fe

Please sign in to comment.