org.jclouds.iam.features.UserApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iam Show documentation
Show all versions of iam Show documentation
jclouds components to access an implementation of Identity and Access Management (IAM)
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.jclouds.iam.features;
import javax.inject.Named;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import org.jclouds.Fallbacks.NullOnNotFoundOr404;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.collect.IterableWithMarker;
import org.jclouds.collect.PagedIterable;
import org.jclouds.iam.domain.User;
import org.jclouds.iam.functions.UsersToPagedIterable;
import org.jclouds.iam.xml.ListUsersResultHandler;
import org.jclouds.iam.xml.UserHandler;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.FormParams;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.Transform;
import org.jclouds.rest.annotations.VirtualHost;
import org.jclouds.rest.annotations.XMLResponseParser;
/**
* Provides access to Amazon IAM via the Query API
*
*
* @see
*/
@RequestFilters(FormSigner.class)
@VirtualHost
public interface UserApi {
/**
* returns all users in order.
*/
@Named("ListUsers")
@POST
@Path("/")
@FormParams(keys = "Action", values = "ListUsers")
@XMLResponseParser(ListUsersResultHandler.class)
@Transform(UsersToPagedIterable.class)
PagedIterable list();
/**
* retrieves up to 100 users in order.
*/
@Named("ListUsers")
@POST
@Path("/")
@FormParams(keys = "Action", values = "ListUsers")
@XMLResponseParser(ListUsersResultHandler.class)
IterableWithMarker listFirstPage();
/**
* retrieves up to 100 users in order, starting at {@code marker}
*
* @param marker
* starting point to resume the list
*/
@Named("ListUsers")
@POST
@Path("/")
@FormParams(keys = "Action", values = "ListUsers")
@XMLResponseParser(ListUsersResultHandler.class)
IterableWithMarker listAt(@FormParam("Marker") String marker);
/**
* returns all users in order at the specified {@code pathPrefix}.
*
* @param pathPrefix
* ex. {@code /division_abc/subdivision_xyz/}
*/
@Named("ListUsers")
@POST
@Path("/")
@FormParams(keys = "Action", values = "ListUsers")
@XMLResponseParser(ListUsersResultHandler.class)
@Transform(UsersToPagedIterable.class)
PagedIterable listPathPrefix(@FormParam("PathPrefix") String pathPrefix);
/**
* retrieves up to 100 users in order at the specified {@code pathPrefix}.
*
* @param pathPrefix
* ex. {@code /division_abc/subdivision_xyz/}
*/
@Named("ListUsers")
@POST
@Path("/")
@FormParams(keys = "Action", values = "ListUsers")
@XMLResponseParser(ListUsersResultHandler.class)
IterableWithMarker listPathPrefixFirstPage(@FormParam("PathPrefix") String pathPrefix);
/**
* retrieves up to 100 users in order at the specified {@code pathPrefix}, starting at {@code marker}.
*
* @param pathPrefix
* ex. {@code /division_abc/subdivision_xyz/}
* @param marker
* starting point to resume the list
*/
@Named("ListUsers")
@POST
@Path("/")
@FormParams(keys = "Action", values = "ListUsers")
@XMLResponseParser(ListUsersResultHandler.class)
IterableWithMarker listPathPrefixAt(@FormParam("PathPrefix") String pathPrefix,
@FormParam("Marker") String marker);
/**
* Retrieves information about the current user, including the user's path, GUID, and ARN.
*/
@Named("GetUser")
@POST
@Path("/")
@XMLResponseParser(UserHandler.class)
@FormParams(keys = "Action", values = "GetUser")
User getCurrent();
/**
* Retrieves information about the specified user, including the user's path, GUID, and ARN.
*
* @param name
* Name of the user to get information about.
* @return null if not found
*/
@Named("GetUser")
@POST
@Path("/")
@XMLResponseParser(UserHandler.class)
@FormParams(keys = "Action", values = "GetUser")
@Fallback(NullOnNotFoundOr404.class)
@Nullable
User get(@FormParam("UserName") String name);
}