ACCEPT_HDR_FORMAT, DATE_FORMAT, HOSTNAME, MEDIA_TYPE_JSON, URI_SCHEME, USER_AGENT, UTC_TIMEZONE, UTF_8| Constructor and Description |
|---|
PacketClient(java.lang.String authToken,
java.lang.String version)
Constructor for creating Packet API Client Instance.
|
PacketClient(java.lang.String authToken,
java.lang.String version,
org.apache.http.impl.client.CloseableHttpClient httpClient)
Constructor for creating Packet API Client Instance with HTTP Client.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Boolean |
acceptInvite(java.lang.String invitationId)
To accept user invitation.
|
java.lang.Boolean |
acceptTransfer(java.lang.String transferId)
To accept project ownership transfer.
|
Email |
addEmailAddress(Email email)
Add email address to current user profile.
|
Device |
createDevice(java.lang.String projectId,
Device device)
Creating new device on packet project.
|
Project |
createProject(Project project)
Create a project on your packet account.
|
SshKey |
createSshKey(SshKey sshKey)
To create a new SSH key on packet account.
|
java.lang.Boolean |
declineInvite(java.lang.String invitationId)
To decline user invitation.
|
java.lang.Boolean |
declineTransfer(java.lang.String transferId)
To decline project ownership transfer.
|
java.lang.Boolean |
deleteDevice(java.lang.String deviceId)
To delete a device from Packet project and deprovisions it in packet datacenter.
|
java.lang.Boolean |
deleteEmailAddress(java.lang.String emailId)
To delete email address from current user profile.
|
java.lang.Boolean |
deleteIpAddress(java.lang.String ipAddressId)
To remove an IP reservation from the project.
|
java.lang.Boolean |
deleteMembership(java.lang.String membershipId)
To deletes a membership record and also it will remove the user from the project.
|
java.lang.Boolean |
deleteProject(java.lang.String projectId)
Deletes a device and de-provisions it in our datacenter.
|
java.lang.Boolean |
deleteSshKey(java.lang.String sshKeyId)
To delete SSH key from packet account.
|
Metrics |
deviceTraffic(java.lang.String deviceId,
TrafficDirection direction,
java.util.Date timeframeStart,
java.util.Date timeframeEnd)
To get traffic information for device.
|
Metrics |
deviceTraffic(java.lang.String deviceId,
TrafficDirection direction,
java.util.Date timeframeStart,
java.util.Date timeframeEnd,
MetricInterval interval,
TrafficBucket bucket)
To get traffic information for device.
|
User |
getCurrentUser()
To get current user information.
|
Device |
getDevice(java.lang.String deviceId)
To get single device information.
|
Events |
getDeviceEvents(java.lang.String deviceId,
java.lang.Integer pageNo,
java.lang.Integer perPage)
To fetch all the events belongs to particular device.
|
Devices |
getDevices(java.lang.String projectId,
java.lang.Integer pageNo,
java.lang.Integer perPage)
To get all available devices from your packet account on particular project.
|
Email |
getEmailAddress(java.lang.String emailId)
To fetch one email address information.
|
Event |
getEvent(java.lang.String eventId)
To get single event details.
|
Events |
getEvents(java.util.Date since,
java.lang.Integer pageNo,
java.lang.Integer perPage)
Provides all the events from since date.
|
Facilities |
getFacilites(java.lang.Integer pageNo,
java.lang.Integer perPage)
Provides a listing of available datacenters where you can provision Packet devices.
|
Invitation |
getInvite(java.lang.String invitationId)
To get particular invite details.
|
IpAddress |
getIpAddress(java.lang.String ipAddressId)
To get particular IP Address details.
|
IpAddresses |
getIpAddresses(java.lang.String projectId)
To get all available IP Addresses form packet project.
|
Membership |
getMembership(java.lang.String membershipId)
To get project membership details.
|
Notification |
getNotification(java.lang.String notificationId)
To get single notification details.
|
Notifications |
getNotifications(java.util.Date since,
java.lang.Boolean all,
java.lang.Integer pageNo,
java.lang.Integer perPage)
To fetch all the notification from packet account.
|
OperatingSystems |
getOperatingSystems(java.lang.Integer pageNo,
java.lang.Integer perPage)
Provides a listing of available operating systems to provision your new device with.
|
Plans |
getPlans(java.lang.Integer pageNo,
java.lang.Integer perPage)
Provides a listing of available services plans available to provision your device on.
|
Project |
getProject(java.lang.String projectId)
Provides single project object.
|
Events |
getProjectEvents(java.lang.String projectId,
java.lang.Integer pageNo,
java.lang.Integer perPage)
To fetch all the events belongs to particular project.
|
Projects |
getProjects(java.lang.Integer pageNo,
java.lang.Integer perPage)
Projects are a way to group devices and grant users access to them.
|
SshKey |
getSshKey(java.lang.String sshKeyId)
To get single SSH key details.
|
SshKeys |
getSshKeys(java.lang.Integer pageNo,
java.lang.Integer perPage)
To get all the available SSH keys from packet account.
|
Transfer |
getTransferInfo(java.lang.String transferId)
Get the project transfer information.
|
User |
getUser(java.lang.String userId)
To get single user information.
|
Users |
getUsers(java.lang.Integer pageNo,
java.lang.Integer perPage)
To get all the available users information.
|
Invitation |
invite(java.lang.String projectId,
Invitation invitation)
Inviting a user to the project or adding user to the project.
|
java.lang.Boolean |
powerOffDevice(java.lang.String deviceId)
To turn-off power on your device.
|
java.lang.Boolean |
powerOnDevice(java.lang.String deviceId)
To power on your device.
|
java.lang.Boolean |
rebootDevice(java.lang.String deviceId)
To reboot device normally.
|
java.lang.Boolean |
rescueDevice(java.lang.String deviceId)
To reboot the device into rescue OS.
|
java.lang.Boolean |
reserveIpAddress(java.lang.String projectId,
ReserveIpAddress reserveIpAddress)
Reserve/Request more IP address for a project.
|
Transfer |
transferProject(java.lang.String projectId,
java.lang.String membershipId)
Project owners can transfer ownership of their projects to other members.
|
User |
updateCurrentUser(User user)
To update current user information.
|
Device |
updateDevice(Device device)
To update device details on packet project.
|
Email |
updateEmailAddress(Email email)
To update email address to default address or non-default.
|
Membership |
updateMembership(Membership membership)
To update membership details.
|
Notification |
updateNotification(Notification notification)
To update single notification.
|
Project |
updateProject(Project project)
Updates a project information.
|
SshKey |
updateSshKey(SshKey sshKey)
To update existing SSH key on packet account.
|
public PacketClient(java.lang.String authToken,
java.lang.String version)
authToken - authentication tokens from
Packet Portalversion - API version numberpublic PacketClient(java.lang.String authToken,
java.lang.String version,
org.apache.http.impl.client.CloseableHttpClient httpClient)
authToken - authentication tokens from
Packet Portalversion - API version numberhttpClient - Apache HTTP Client instancepublic Facilities getFacilites(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
PacketgetFacilites in interface PacketpageNo - for paginationperPage - no. of items per page (optional, can pass null)FacilitiesPacketException - for HTTP status code >= 400 && < 510public OperatingSystems getOperatingSystems(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
PacketgetOperatingSystems in interface PacketpageNo - for paginationperPage - no. of items per page (optional, can pass null)OperatingSystemsPacketException - for HTTP status code >= 400 && < 510public Plans getPlans(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
PacketgetPlans in interface PacketpageNo - for paginationperPage - no. of items per page (optional, can pass null)PlansPacketException - for HTTP status code >= 400 && < 510public Projects getProjects(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException, HttpErrorException
PacketgetProjects in interface PacketpageNo - for paginationperPage - no. of items per page (optional, can pass null)ProjectsPacketException - for HTTP status code >= 400 && < 510HttpErrorExceptionpublic Project getProject(java.lang.String projectId) throws PacketException
PacketgetProject in interface PacketprojectId - a packet project idProjectPacketException - for HTTP status code >= 400 && < 510public Project createProject(Project project) throws PacketException
PacketcreateProject in interface Packetproject - a Project instanceProjectPacketException - for HTTP status code >= 400 && < 510public Project updateProject(Project project) throws PacketException
PacketupdateProject in interface Packetproject - a Project instanceProjectPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean deleteProject(java.lang.String projectId)
throws PacketException
PacketdeleteProject in interface PacketprojectId - a packet project idBooleanPacketException - for HTTP status code >= 400 && < 510public Transfer transferProject(java.lang.String projectId, java.lang.String membershipId) throws PacketException
PackettransferProject in interface PacketprojectId - a packet project idmembershipId - a packet membership idTransferPacketException - for HTTP status code >= 400 && < 510public Transfer getTransferInfo(java.lang.String transferId) throws PacketException
PacketgetTransferInfo in interface PackettransferId - project transfer idTransferPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean acceptTransfer(java.lang.String transferId)
throws PacketException
PacketacceptTransfer in interface PackettransferId - project transfer idBooleanPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean declineTransfer(java.lang.String transferId)
throws PacketException
PacketdeclineTransfer in interface PackettransferId - project transfer idBooleanPacketException - for HTTP status code >= 400 && < 510public Devices getDevices(java.lang.String projectId, java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
PacketgetDevices in interface PacketprojectId - a packet project idpageNo - for paginationperPage - no. of items per page (optional, can pass null)DevicesPacketException - for HTTP status code >= 400 && < 510public Device getDevice(java.lang.String deviceId) throws PacketException
PacketgetDevice in interface PacketdeviceId - a packet device idDevicePacketException - for HTTP status code >= 400 && < 510public Device createDevice(java.lang.String projectId, Device device) throws PacketException
PacketcreateDevice in interface PacketprojectId - a packet project iddevice - a Device instanceDevicePacketException - for HTTP status code >= 400 && < 510public Device updateDevice(Device device) throws PacketException
PacketupdateDevice in interface Packetdevice - a Device instanceDevicePacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean deleteDevice(java.lang.String deviceId)
throws PacketException
PacketdeleteDevice in interface PacketdeviceId - a packet device idBooleanPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean powerOnDevice(java.lang.String deviceId)
throws PacketException
PacketpowerOnDevice in interface PacketdeviceId - a packet device idBooleanPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean powerOffDevice(java.lang.String deviceId)
throws PacketException
PacketpowerOffDevice in interface PacketdeviceId - a packet device idBooleanPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean rebootDevice(java.lang.String deviceId)
throws PacketException
PacketrebootDevice in interface PacketdeviceId - a packet device idBooleanPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean rescueDevice(java.lang.String deviceId)
throws PacketException
PacketrescueDevice in interface PacketdeviceId - a packet device idBooleanPacketException - for HTTP status code >= 400 && < 510public Metrics deviceTraffic(java.lang.String deviceId, TrafficDirection direction, java.util.Date timeframeStart, java.util.Date timeframeEnd) throws PacketException
PacketdeviceTraffic in interface PacketdeviceId - a packet device iddirection - a value of TrafficDirectiontimeframeStart - a starting date timetimeframeEnd - a end date timeMetricsPacketException - for HTTP status code >= 400 && < 510public Metrics deviceTraffic(java.lang.String deviceId, TrafficDirection direction, java.util.Date timeframeStart, java.util.Date timeframeEnd, MetricInterval interval, TrafficBucket bucket) throws PacketException
PacketdeviceTraffic in interface PacketdeviceId - a packet device iddirection - a value of TrafficDirectiontimeframeStart - a starting date timetimeframeEnd - a end date timeinterval - a value of MetricIntervalbucket - a value of TrafficBucketMetricsPacketException - for HTTP status code >= 400 && < 510public IpAddresses getIpAddresses(java.lang.String projectId) throws PacketException
PacketgetIpAddresses in interface PacketprojectId - a packet project idIpAddressesPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean reserveIpAddress(java.lang.String projectId,
ReserveIpAddress reserveIpAddress)
throws PacketException
PacketreserveIpAddress in interface PacketprojectId - a packet project idreserveIpAddress - a instance of ReserveIpAddressBooleanPacketException - for HTTP status code >= 400 && < 510public IpAddress getIpAddress(java.lang.String ipAddressId) throws PacketException
PacketgetIpAddress in interface PacketipAddressId - id of the IP addressIpAddressPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean deleteIpAddress(java.lang.String ipAddressId)
throws PacketException
PacketdeleteIpAddress in interface PacketipAddressId - id of the IP addressBooleanPacketException - for HTTP status code >= 400 && < 510public Users getUsers(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
PacketgetUsers in interface PacketpageNo - for paginationperPage - no. of items per page (optional, can pass null)UsersPacketException - for HTTP status code >= 400 && < 510public User getUser(java.lang.String userId) throws PacketException
PacketgetUser in interface PacketuserId - packet user idUserPacketException - for HTTP status code >= 400 && < 510public User getCurrentUser() throws PacketException
PacketgetCurrentUser in interface PacketUserPacketException - for HTTP status code >= 400 && < 510public User updateCurrentUser(User user) throws PacketException
PacketupdateCurrentUser in interface Packetuser - a instance of UserUserPacketException - for HTTP status code >= 400 && < 510public Membership getMembership(java.lang.String membershipId) throws PacketException
PacketgetMembership in interface PacketmembershipId - project membership idMembershipPacketException - for HTTP status code >= 400 && < 510public Membership updateMembership(Membership membership) throws PacketException
PacketupdateMembership in interface Packetmembership - a instance of MembershipMembershipPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean deleteMembership(java.lang.String membershipId)
throws PacketException
PacketdeleteMembership in interface PacketmembershipId - project membership idBooleanPacketException - for HTTP status code >= 400 && < 510public SshKeys getSshKeys(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
PacketgetSshKeys in interface PacketpageNo - for paginationperPage - no. of items per page (optional, can pass null)SshKeysPacketException - for HTTP status code >= 400 && < 510public SshKey getSshKey(java.lang.String sshKeyId) throws PacketException
PacketgetSshKey in interface PacketsshKeyId - id of the SSH keySshKeyPacketException - for HTTP status code >= 400 && < 510public SshKey createSshKey(SshKey sshKey) throws PacketException
PacketcreateSshKey in interface PacketsshKey - a instance of SshKeySshKeyPacketException - for HTTP status code >= 400 && < 510public SshKey updateSshKey(SshKey sshKey) throws PacketException
PacketupdateSshKey in interface PacketsshKey - a instance of SshKeySshKeyPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean deleteSshKey(java.lang.String sshKeyId)
throws PacketException
PacketdeleteSshKey in interface PacketsshKeyId - a instance of SshKeyBooleanPacketException - for HTTP status code >= 400 && < 510public Invitation invite(java.lang.String projectId, Invitation invitation) throws PacketException
Packetinvite in interface PacketprojectId - a packet project idinvitation - a instance of InvitationInvitationPacketException - for HTTP status code >= 400 && < 510public Invitation getInvite(java.lang.String invitationId) throws PacketException
PacketgetInvite in interface PacketinvitationId - a user invitation idInvitationPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean acceptInvite(java.lang.String invitationId)
throws PacketException
PacketacceptInvite in interface PacketinvitationId - a user invitation idInvitationPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean declineInvite(java.lang.String invitationId)
throws PacketException
PacketdeclineInvite in interface PacketinvitationId - a user invitation idInvitationPacketException - for HTTP status code >= 400 && < 510public Events getEvents(java.util.Date since, java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
PacketgetEvents in interface Packetsince - date time of events to fetchpageNo - for paginationperPage - no. of items per page (optional, can pass null)EventsPacketException - for HTTP status code >= 400 && < 510public Events getProjectEvents(java.lang.String projectId, java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
PacketgetProjectEvents in interface PacketprojectId - packet project idpageNo - for paginationperPage - no. of items per page (optional, can pass null)EventsPacketException - for HTTP status code >= 400 && < 510public Events getDeviceEvents(java.lang.String deviceId, java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
PacketgetDeviceEvents in interface PacketdeviceId - packet device idpageNo - for paginationperPage - no. of items per page (optional, can pass null)EventsPacketException - for HTTP status code >= 400 && < 510public Event getEvent(java.lang.String eventId) throws PacketException
PacketgetEvent in interface PacketeventId - id of project or device event idEventPacketException - for HTTP status code >= 400 && < 510public Notifications getNotifications(java.util.Date since, java.lang.Boolean all, java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
PacketgetNotifications in interface Packetsince - date time of notifications to fetchall - to include read notification toopageNo - for paginationperPage - no. of items per page (optional, can pass null)NotificationsPacketException - for HTTP status code >= 400 && < 510public Notification getNotification(java.lang.String notificationId) throws PacketException
PacketgetNotification in interface PacketnotificationId - id of the packet notificationsNotificationPacketException - for HTTP status code >= 400 && < 510public Notification updateNotification(Notification notification) throws PacketException
PacketupdateNotification in interface Packetnotification - a instance of the NotificationNotificationPacketException - for HTTP status code >= 400 && < 510public Email addEmailAddress(Email email) throws PacketException
PacketaddEmailAddress in interface Packetemail - a valid email addressEmailPacketException - for HTTP status code >= 400 && < 510public Email getEmailAddress(java.lang.String emailId) throws PacketException
PacketgetEmailAddress in interface PacketemailId - id of the email address recordEmailPacketException - for HTTP status code >= 400 && < 510public Email updateEmailAddress(Email email) throws PacketException
PacketupdateEmailAddress in interface Packetemail - a instance of EmailEmailPacketException - for HTTP status code >= 400 && < 510public java.lang.Boolean deleteEmailAddress(java.lang.String emailId)
throws PacketException
PacketdeleteEmailAddress in interface PacketemailId - id of the email address recordBooleanPacketException - for HTTP status code >= 400 && < 510