Interface CompanyResource
- Author:
- Cory Snyder
-
Method Summary
Modifier and TypeMethodDescriptioncreateRole(String companyId, RoleCreateRequest roleCreationRequest) Creates a new role for a company.createSSOUser(String companyId, SSOUserCreateRequest createRequest) Create a new SSO user for a company.createSSOUsers(String companyId, SSOUserCreateRequestSet ssoUserCreateRequestSet) Create multiple SSO users for a company.createSSOUsersFromFile(String companyId, byte[] ssoCSVFile) Create multiple SSO users from a CSV file.createUser(String companyId, UserCreateRequest createRequest) Creates a new user for a company.createUsers(String companyId, UserCreateRequestSet userCreateRequestSet) Create multiple users for a company.createUsersFromFile(String companyId, byte[] userCSVFile) Create multiple users from a file.voiddeleteRole(String companyId, String roleId) Deletes a company role.downloadExampleUserCreationCSVFile(String companyId, boolean ssoUsers) Download an example of the user creation CSV file.voidenforceTwoFactorAuthForUser(String companyId, EnforceTwoFactorAuthForUserRequest request) Enforce two factor authentication for the specified user.getBaCompanyBillingHistory(String companyId, String locationId, Integer startYear, Integer startMonth, Integer endYear, Integer endMonth) Get the historical VAC billing for a given company.getCloudTenantBillingHistory(String companyId, String locationId, Integer startYear, Integer startMonth, Integer endYear, Integer endMonth) Get the historical billing for a given company.getCompany(String companyId) Gets a company.getCompanyAdminCount(String companyId) Get the number of company admins in a given company.getCompanyTwoFactorAuthSettings(String companyId) Get the specified company's two factor authentication settings.Gets the company logo.getRoleResponse(String companyId, String roleId) Gets a company role by ID.Gets all company roles.getUserDomains(String companyId) Get the user domains that are associated with this company.Gets all users for a company.getVacCompanies(String companyId) Get all the VAC companies for a given company.voidmarkUserAsInvited(String companyId, String username) Mark a given user without sending an invitation email.voidremoveCompanyLogo(String companyId) Removes the company's logo.voidresetTwoFactorAuthForUser(String companyId, ResetTwoFactorAuthRequest request) Reset two factor authentication for the specified user.Perform a full-text search of entities pertaining to this company.voidsendUserInvitationEmail(String companyId, String username) Send a user invitation email to the given user.voidsendUsersInvitationEmails(String companyId, InviteUserEmailSet userNames) Send user invitation emails to the given set of users.voidsetCompanyTwoFactorAuthSettings(String companyId, EnforceTwoFactorAuthRequest request) Set the two factor authentication settings for a company.voidupdateCompanyLogo(String companyId, byte[] pictureBytes) Updates the company's logo.updateRole(String companyId, String roleId, RoleUpdateRequest roleUpdateRequest) Modifies a company role.
-
Method Details
-
getCompany
Gets a company.- Parameters:
companyId- the company identifier- Returns:
- the company details
-
createUser
@POST @Path("/{companyId}/users") @Consumes("application/json") UserResponse createUser(@PathParam("companyId") String companyId, UserCreateRequest createRequest) Creates a new user for a company.- Parameters:
createRequest- new user details- Returns:
- created user
-
createSSOUser
@POST @Path("/{companyId}/sso-user") @Consumes("application/json") UserResponse createSSOUser(@PathParam("companyId") String companyId, SSOUserCreateRequest createRequest) Create a new SSO user for a company.- Parameters:
companyId- company to create users increateRequest- new user details- Returns:
- created user
-
createUsers
@POST @Path("/{companyId}/users-batch") @Consumes("application/json") UserCreationSetResponse createUsers(@PathParam("companyId") String companyId, UserCreateRequestSet userCreateRequestSet) Create multiple users for a company.- Parameters:
companyId- company to create users inuserCreateRequestSet- set of new user details
-
createSSOUsers
@POST @Path("/{companyId}/users-sso-batch") @Consumes("application/json") UserCreationSetResponse createSSOUsers(@PathParam("companyId") String companyId, SSOUserCreateRequestSet ssoUserCreateRequestSet) Create multiple SSO users for a company.- Parameters:
companyId- company to create users inssoUserCreateRequestSet- set of new SSO user details
-
createUsersFromFile
@POST @Path("/{companyId}/create-users-from-file") @Consumes("application/json") UserCreationSetResponse createUsersFromFile(@PathParam("companyId") String companyId, byte[] userCSVFile) Create multiple users from a file. To see an example of a valid CSV file seedownloadExampleUserCreationCSVFile(String, boolean)where the boolean is set to false.- Parameters:
companyId- company to create users inuserCSVFile- file to import users from
-
createSSOUsersFromFile
@POST @Path("/{companyId}/create-sso-users-from-file") @Consumes("application/json") UserCreationSetResponse createSSOUsersFromFile(@PathParam("companyId") String companyId, byte[] ssoCSVFile) Create multiple SSO users from a CSV file. To see an example of valid CSV file seedownloadExampleUserCreationCSVFile(String, boolean)where the SSO boolean flag is set to true.- Parameters:
companyId- company to create users inssoCSVFile- file to import users from
-
downloadExampleUserCreationCSVFile
@POST @Path("/{companyId}/download-user-create-csv-example") @Consumes("application/json") @Produces("application/vnd.ilandcloud.api.v1.0+octet-stream") InputStream downloadExampleUserCreationCSVFile(@PathParam("companyId") String companyId, @QueryParam("ssoUsers") boolean ssoUsers) Download an example of the user creation CSV file. Will include all the domains and all the roles you can use.- Parameters:
companyId- company of the example csv file- Returns:
- example CSV file for user creation
-
getUsers
@GET @Path("/{companyId}/users") CompanyUserListResponse getUsers(@PathParam("companyId") String companyId, @QueryParam("role") String roleId) Gets all users for a company.- Parameters:
companyId- the company identifier- Returns:
- list of the companies users
-
createRole
@POST @Path("/{companyId}/roles") @Consumes("application/json") RoleResponse createRole(@PathParam("companyId") String companyId, RoleCreateRequest roleCreationRequest) Creates a new role for a company.- Parameters:
companyId- the company IDroleCreationRequest- data object specifying new role parameters- Returns:
- created role
-
getRoles
@GET @Path("/{companyId}/roles") RoleListResponse getRoles(@PathParam("companyId") String companyId, @QueryParam("domain") String domain) Gets all company roles.- Parameters:
companyId- the company IDdomain- optional user domain to scope the role list to. When supplied, must be one of the domain strings returned bygetUserDomains(String)for this company. If the domain is not an MSPShared domain, theMSP Company Administratorrole is omitted from the response.- Returns:
- the list of company roles
-
getRoleResponse
@GET @Path("/{companyId}/roles/{roleId}") RoleResponse getRoleResponse(@PathParam("companyId") String companyId, @PathParam("roleId") String roleId) Gets a company role by ID.- Parameters:
companyId- the company IDroleId- the role ID- Returns:
- the role details
-
updateRole
@PUT @Path("/{companyId}/roles/{roleId}") @Consumes("application/json") RoleResponse updateRole(@PathParam("companyId") String companyId, @PathParam("roleId") String roleId, RoleUpdateRequest roleUpdateRequest) Modifies a company role.- Parameters:
companyId- the company IDroleId- the role IDroleUpdateRequest- data object with role update parameters- Returns:
- the role details
-
deleteRole
@DELETE @Path("/{companyId}/roles/{roleId}") void deleteRole(@PathParam("companyId") String companyId, @PathParam("roleId") String roleId) Deletes a company role.- Parameters:
companyId- the company IDroleId- the role ID
-
getUserDomains
@GET @Path("/{companyId}/user-domains") StringListResponse getUserDomains(@PathParam("companyId") String companyId) Get the user domains that are associated with this company.- Parameters:
companyId- the company identifier- Returns:
- list of domains that are associated with the company
-
getCloudTenantBillingHistory
@GET @Path("/{companyId}/vcc-backup-tenants-billing") CloudTenantBillHistoryResponse getCloudTenantBillingHistory(@PathParam("companyId") String companyId, @QueryParam("location") String locationId, @QueryParam("startYear") Integer startYear, @QueryParam("startMonth") Integer startMonth, @QueryParam("endYear") Integer endYear, @QueryParam("endMonth") Integer endMonth) Get the historical billing for a given company.- Parameters:
companyId- the company identifierlocationId- the location identifier (optional)startYear- the year to startstartMonth- the month to start (1-12)endYear- the year to end withendMonth- the month to end (1-12)- Returns:
- map of location to list of bills
-
getBaCompanyBillingHistory
@GET @Path("/{companyId}/vac-backup-tenants-billing") CloudTenantBillHistoryResponse getBaCompanyBillingHistory(@PathParam("companyId") String companyId, @QueryParam("location") String locationId, @QueryParam("startYear") Integer startYear, @QueryParam("startMonth") Integer startMonth, @QueryParam("endYear") Integer endYear, @QueryParam("endMonth") Integer endMonth) Get the historical VAC billing for a given company.- Parameters:
companyId- the company identifierlocationId- the location identifier (optional)startYear- the year to startstartMonth- the month to start (1-12)endYear- the year to end withendMonth- the month to end (1-12)- Returns:
- map of location to list of vac bills
-
updateCompanyLogo
@POST @Path("/{companyId}/logo") @Consumes("image/jpeg") void updateCompanyLogo(@PathParam("companyId") String companyId, byte[] pictureBytes) Updates the company's logo.- Parameters:
companyId- the company identifierpictureBytes- a JPEG image
-
removeCompanyLogo
Removes the company's logo.- Parameters:
companyId- the company identifier
-
getLogo
@GET @Path("/{companyId}/logo") @Produces("image/vnd.ilandcloud.api.v1.0+jpeg") InputStream getLogo(@PathParam("companyId") String companyId) Gets the company logo.- Parameters:
companyId- the company identifier- Returns:
- the picture as a byte array
-
search
@GET @Path("/{companyId}/search") SearchResultResponse search(@PathParam("companyId") String companyId, @QueryParam("query") String query, @QueryParam("pageOffset") int pageOffset, @QueryParam("pageSize") int pageSize) Perform a full-text search of entities pertaining to this company.- Parameters:
companyId- the company identifierquery- query string
The query string accepts Lucene style query input.
For example, to search for networks with IPs in the 10.10.10.X subnet you would supply '10.10.10.*' as a query string. Tht * represents a wildcard character and can be used anywhere in a query EXCEPT for as the first character.
To search for multiple terms that MUST occur the AND operator can be used. E.g. to find documents containing both 'network' and 'vapp' you would supply the query string 'network AND vapp' .
pageOffset- page offset for return documentspageSize- limit to number of hits (default value is 10 and maximum is 50)
-
getVacCompanies
@GET @Path("/{companyId}/vac-companies") BaCompanySetResponse getVacCompanies(@PathParam("companyId") String companyId) Get all the VAC companies for a given company.- Parameters:
companyId- company id- Returns:
- a set of vac companies
-
enforceTwoFactorAuthForUser
@POST @Path("/{companyId}/actions/enforce-two-factor-auth") void enforceTwoFactorAuthForUser(@PathParam("companyId") String companyId, EnforceTwoFactorAuthForUserRequest request) Enforce two factor authentication for the specified user.- Parameters:
companyId- company idrequest- request to enforce two factor auth for user
-
resetTwoFactorAuthForUser
@POST @Path("/{companyId}/actions/reset-two-factor-auth") void resetTwoFactorAuthForUser(@PathParam("companyId") String companyId, ResetTwoFactorAuthRequest request) Reset two factor authentication for the specified user. After resetting the user's two factor auth credentials, will default back to the global settings for the company regarding two factor authentication.- Parameters:
companyId- company idrequest- request to reset two factor auth for user
-
setCompanyTwoFactorAuthSettings
@PUT @Path("/{companyId}/two-factor-auth-settings") void setCompanyTwoFactorAuthSettings(@PathParam("companyId") String companyId, EnforceTwoFactorAuthRequest request) Set the two factor authentication settings for a company. Can either set for all users in the company or for specified roles.- Parameters:
companyId- company idrequest- request whether to enforce for all users or specified roles
-
getCompanyTwoFactorAuthSettings
@GET @Path("/{companyId}/two-factor-auth-settings") CompanyTwoFactorAuthSettingsResponse getCompanyTwoFactorAuthSettings(@PathParam("companyId") String companyId) Get the specified company's two factor authentication settings.- Parameters:
companyId- company id- Returns:
- company's two factor auth settings
-
sendUserInvitationEmail
@POST @Path("/{companyId}/actions/{username}/send-invite-email") void sendUserInvitationEmail(@PathParam("companyId") String companyId, @PathParam("username") String username) Send a user invitation email to the given user.- Parameters:
companyId- company idusername- user to send invite email to
-
markUserAsInvited
@POST @Path("/{companyId}/actions/{username}/mark-as-invited") void markUserAsInvited(@PathParam("companyId") String companyId, @PathParam("username") String username) Mark a given user without sending an invitation email.- Parameters:
companyId- company idusername- user to be marked as invited
-
sendUsersInvitationEmails
@POST @Path("/{companyId}/actions/send-invite-emails") void sendUsersInvitationEmails(@PathParam("companyId") String companyId, InviteUserEmailSet userNames) Send user invitation emails to the given set of users.- Parameters:
companyId- company iduserNames- users to send invite emails to
-
getCompanyAdminCount
@GET @Path("/{companyId}/company-admin-count") CompanyAdminCountResponse getCompanyAdminCount(@PathParam("companyId") String companyId) Get the number of company admins in a given company.- Parameters:
companyId- company id- Returns:
- number of company admins in company
-