Skip to content

Commit 10c18d3

Browse files
author
Alan Quillin
committed
Fixed issue with List Roles method and updated docs for Get All Users By Role
1 parent 1a5b405 commit 10c18d3

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

src/corelib/Providers/Rackspace/CloudIdentityProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,23 +122,23 @@ public CloudIdentityProvider(CloudIdentity defaultIdentity, IRestService restSer
122122
}
123123

124124
/// <inheritdoc/>
125-
public IEnumerable<Role> ListRoles(string serviceId = null, string markerId = null, int? limit = null, CloudIdentity identity = null)
125+
public IEnumerable<Role> ListRoles(string serviceId = null, int? marker = null, int? limit = null, CloudIdentity identity = null)
126126
{
127127
if (limit < 0)
128128
throw new ArgumentOutOfRangeException("limit");
129129

130130
var provider = GetProvider(identity);
131-
return provider.ListRoles(serviceId, markerId, limit, identity);
131+
return provider.ListRoles(serviceId, marker, limit, identity);
132132
}
133133

134134
/// <inheritdoc/>
135-
public IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, string markerId = null, int? limit = null, CloudIdentity identity = null)
135+
public IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, int? marker = null, int? limit = null, CloudIdentity identity = null)
136136
{
137137
if (limit < 0 || limit > 1000)
138138
throw new ArgumentOutOfRangeException("limit");
139139

140140
var provider = GetProvider(identity);
141-
return provider.ListUsersByRole(roleId, enabled, markerId, limit, identity);
141+
return provider.ListUsersByRole(roleId, enabled, marker, limit, identity);
142142
}
143143

144144
/// <inheritdoc/>

src/corelib/Providers/Rackspace/GeographicalCloudIdentityProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public GeographicalCloudIdentityProvider(Uri urlBase, CloudIdentity identity, IR
3636
#region Roles
3737

3838
/// <inheritdoc/>
39-
public IEnumerable<Role> ListRoles(string serviceId = null, string markerId = null, int? limit = null, CloudIdentity identity = null)
39+
public IEnumerable<Role> ListRoles(string serviceId = null, int? marker = null, int? limit = null, CloudIdentity identity = null)
4040
{
4141
if (limit < 0)
4242
throw new ArgumentOutOfRangeException("limit");
@@ -45,7 +45,7 @@ public IEnumerable<Role> ListRoles(string serviceId = null, string markerId = nu
4545
var parameters = BuildOptionalParameterList(new Dictionary<string, string>
4646
{
4747
{"serviceId", serviceId},
48-
{"marker", markerId},
48+
{"marker", !marker.HasValue ? null : marker.Value.ToString()},
4949
{"limit", !limit.HasValue ? null : limit.Value.ToString()},
5050
});
5151

@@ -156,7 +156,7 @@ public bool DeleteRoleFromUser(string userId, string roleId, CloudIdentity ident
156156
}
157157

158158
/// <inheritdoc/>
159-
public IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, string markerId = null, int? limit = null, CloudIdentity identity = null)
159+
public IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, int? marker = null, int? limit = null, CloudIdentity identity = null)
160160
{
161161
if (limit < 0 || limit > 1000)
162162
throw new ArgumentOutOfRangeException("limit");
@@ -166,7 +166,7 @@ public IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, st
166166
var parameters = BuildOptionalParameterList(new Dictionary<string, string>
167167
{
168168
{"enabled", !enabled.HasValue ? null : enabled.Value ? "true" : "false"},
169-
{"marker", markerId},
169+
{"marker", !marker.HasValue ? null : marker.Value.ToString()},
170170
{"limit", !limit.HasValue ? null : limit.Value.ToString()},
171171
});
172172

src/corelib/Providers/Rackspace/IExtendedCloudIdentityProvider.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface IExtendedCloudIdentityProvider : IIdentityProvider
1919
/// <note type="warning">The behavior of this API method is not defined. Do not use.</note>
2020
/// </summary>
2121
/// <param name="serviceId">The "serviceId".</param>
22-
/// <param name="markerId">The <see cref="Role.Id"/> of the last item in the previous list. Used for pagination. If the value is <c>null</c>, the list starts at the beginning.</param>
22+
/// <param name="marker">The index of the last item in the previous list. Used for pagination. If the value is <c>null</c>, the list starts at the beginning.</param>
2323
/// <param name="limit">Indicates the maximum number of items to return. Used for pagination. If the value is <c>null</c>, a provider-specific default value is used.</param>
2424
/// <param name="identity">The cloud identity to use for this request. If not specified, the default identity for the current provider instance will be used.</param>
2525
/// <returns>A collection of <see cref="Role"/> objects describing the requested roles.</returns>
@@ -28,23 +28,22 @@ public interface IExtendedCloudIdentityProvider : IIdentityProvider
2828
/// <exception cref="InvalidOperationException">If <paramref name="identity"/> is <c>null</c> and no default identity is available for the provider.</exception>
2929
/// <exception cref="ResponseException">If the REST API request failed.</exception>
3030
/// <seealso href="http://docs.rackspace.com/openstack-extensions/auth/OS-KSADM-admin-devguide/content/GET_listRoles_v2.0_OS-KSADM_roles_Admin_API_Service_Developer_Operations-d1e1357.html">List Roles (Rackspace OS-KSADM Extension - API v2.0)</seealso>
31-
IEnumerable<Role> ListRoles(string serviceId = null, string markerId = null, int? limit = null, CloudIdentity identity = null);
31+
IEnumerable<Role> ListRoles(string serviceId = null, int? marker = null, int? limit = null, CloudIdentity identity = null);
3232

3333
/// <summary>
34-
/// Lists all roles.
35-
/// <note type="warning">The behavior of this API method is not defined. Do not use.</note>
34+
/// Lists all users for a given role.
3635
/// </summary>
3736
/// <param name="roleId">The role ID. The behavior is unspecified if this is not obtained from <see cref="Role.Id"/>.</param>
3837
/// <param name="enabled">Allows you to filter enabled or un-enabled users. If the value is <c>null</c>, a provider-specific default value is used.</param>
39-
/// <param name="markerId">The <see cref="Role.Id"/> of the last item in the previous list. Used for pagination. If the value is <c>null</c>, the list starts at the beginning.</param>
38+
/// <param name="marker">The index of the last item in the previous list. Used for pagination. If the value is <c>null</c>, the list starts at the beginning.</param>
4039
/// <param name="limit">Indicates the maximum number of items to return. Used for pagination. If the value is <c>null</c>, a provider-specific default value is used.</param>
4140
/// <param name="identity">The cloud identity to use for this request. If not specified, the default identity for the current provider instance will be used.</param>
4241
/// <returns>A collection of <see cref="Role"/> objects describing the requested roles.</returns>
4342
/// <exception cref="ArgumentOutOfRangeException">If <paramref name="limit"/> is less than 0 or greater than 1000.</exception>
4443
/// <exception cref="NotSupportedException">If the provider does not support the given <paramref name="identity"/> type.</exception>
4544
/// <exception cref="InvalidOperationException">If <paramref name="identity"/> is <c>null</c> and no default identity is available for the provider.</exception>
4645
/// <exception cref="ResponseException">If the REST API request failed.</exception>
47-
IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, string markerId = null, int? limit = null, CloudIdentity identity = null);
46+
IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, int? marker = null, int? limit = null, CloudIdentity identity = null);
4847

4948
/// <summary>
5049
/// Create a new role.

0 commit comments

Comments
 (0)