public interface Packet
Lightweight API client library for accessing Packet REST APIs with project based (JVM hosted languages) on Java, Groovy, Scala, Clojure, etc.
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.
|
Facilities getFacilites(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
pageNo
- for paginationperPage
- no. of items per page (optional, can pass null)Facilities
PacketException
- for HTTP status code >= 400 && < 510
OperatingSystems getOperatingSystems(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
pageNo
- for paginationperPage
- no. of items per page (optional, can pass null)OperatingSystems
PacketException
- for HTTP status code >= 400 && < 510
Plans getPlans(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
pageNo
- for paginationperPage
- no. of items per page (optional, can pass null)Plans
PacketException
- for HTTP status code >= 400 && < 510
Projects getProjects(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
pageNo
- for paginationperPage
- no. of items per page (optional, can pass null)Projects
PacketException
- for HTTP status code >= 400 && < 510
Project getProject(java.lang.String projectId) throws PacketException
projectId
- a packet project idProject
PacketException
- for HTTP status code >= 400 && < 510
Project createProject(Project project) throws PacketException
project
- a Project
instanceProject
PacketException
- for HTTP status code >= 400 && < 510
Project updateProject(Project project) throws PacketException
project
- a Project
instanceProject
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean deleteProject(java.lang.String projectId) throws PacketException
projectId
- a packet project idBoolean
PacketException
- for HTTP status code >= 400 && < 510
Transfer transferProject(java.lang.String projectId, java.lang.String membershipId) throws PacketException
projectId
- a packet project idmembershipId
- a packet membership idTransfer
PacketException
- for HTTP status code >= 400 && < 510
Transfer getTransferInfo(java.lang.String transferId) throws PacketException
transferId
- project transfer idTransfer
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean acceptTransfer(java.lang.String transferId) throws PacketException
transferId
- project transfer idBoolean
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean declineTransfer(java.lang.String transferId) throws PacketException
transferId
- project transfer idBoolean
PacketException
- for HTTP status code >= 400 && < 510
Devices getDevices(java.lang.String projectId, java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
projectId
- a packet project idpageNo
- for paginationperPage
- no. of items per page (optional, can pass null)Devices
PacketException
- for HTTP status code >= 400 && < 510
Device getDevice(java.lang.String deviceId) throws PacketException
deviceId
- a packet device idDevice
PacketException
- for HTTP status code >= 400 && < 510
Device createDevice(java.lang.String projectId, Device device) throws PacketException
projectId
- a packet project iddevice
- a Device
instanceDevice
PacketException
- for HTTP status code >= 400 && < 510
Device updateDevice(Device device) throws PacketException
device
- a Device
instanceDevice
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean deleteDevice(java.lang.String deviceId) throws PacketException
deviceId
- a packet device idBoolean
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean powerOnDevice(java.lang.String deviceId) throws PacketException
deviceId
- a packet device idBoolean
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean powerOffDevice(java.lang.String deviceId) throws PacketException
deviceId
- a packet device idBoolean
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean rebootDevice(java.lang.String deviceId) throws PacketException
deviceId
- a packet device idBoolean
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean rescueDevice(java.lang.String deviceId) throws PacketException
deviceId
- a packet device idBoolean
PacketException
- for HTTP status code >= 400 && < 510
Metrics deviceTraffic(java.lang.String deviceId, TrafficDirection direction, java.util.Date timeframeStart, java.util.Date timeframeEnd) throws PacketException
deviceId
- a packet device iddirection
- a value of TrafficDirection
timeframeStart
- a starting date timetimeframeEnd
- a end date timeMetrics
PacketException
- for HTTP status code >= 400 && < 510
Metrics deviceTraffic(java.lang.String deviceId, TrafficDirection direction, java.util.Date timeframeStart, java.util.Date timeframeEnd, MetricInterval interval, TrafficBucket bucket) throws PacketException
deviceId
- a packet device iddirection
- a value of TrafficDirection
timeframeStart
- a starting date timetimeframeEnd
- a end date timeinterval
- a value of MetricInterval
bucket
- a value of TrafficBucket
Metrics
PacketException
- for HTTP status code >= 400 && < 510
IpAddresses getIpAddresses(java.lang.String projectId) throws PacketException
projectId
- a packet project idIpAddresses
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean reserveIpAddress(java.lang.String projectId, ReserveIpAddress reserveIpAddress) throws PacketException
projectId
- a packet project idreserveIpAddress
- a instance of ReserveIpAddress
Boolean
PacketException
- for HTTP status code >= 400 && < 510
IpAddress getIpAddress(java.lang.String ipAddressId) throws PacketException
ipAddressId
- id of the IP addressIpAddress
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean deleteIpAddress(java.lang.String ipAddressId) throws PacketException
ipAddressId
- id of the IP addressBoolean
PacketException
- for HTTP status code >= 400 && < 510
Users getUsers(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
pageNo
- for paginationperPage
- no. of items per page (optional, can pass null)Users
PacketException
- for HTTP status code >= 400 && < 510
User getUser(java.lang.String userId) throws PacketException
userId
- packet user idUser
PacketException
- for HTTP status code >= 400 && < 510
User getCurrentUser() throws PacketException
User
PacketException
- for HTTP status code >= 400 && < 510
User updateCurrentUser(User user) throws PacketException
user
- a instance of User
User
PacketException
- for HTTP status code >= 400 && < 510
Membership getMembership(java.lang.String membershipId) throws PacketException
membershipId
- project membership idMembership
PacketException
- for HTTP status code >= 400 && < 510
Membership updateMembership(Membership membership) throws PacketException
membership
- a instance of Membership
Membership
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean deleteMembership(java.lang.String membershipId) throws PacketException
membershipId
- project membership idBoolean
PacketException
- for HTTP status code >= 400 && < 510
SshKeys getSshKeys(java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
pageNo
- for paginationperPage
- no. of items per page (optional, can pass null)SshKeys
PacketException
- for HTTP status code >= 400 && < 510
SshKey getSshKey(java.lang.String sshKeyId) throws PacketException
sshKeyId
- id of the SSH keySshKey
PacketException
- for HTTP status code >= 400 && < 510
SshKey createSshKey(SshKey sshKey) throws PacketException
sshKey
- a instance of SshKey
SshKey
PacketException
- for HTTP status code >= 400 && < 510
SshKey updateSshKey(SshKey sshKey) throws PacketException
sshKey
- a instance of SshKey
SshKey
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean deleteSshKey(java.lang.String sshKeyId) throws PacketException
sshKeyId
- a instance of SshKey
Boolean
PacketException
- for HTTP status code >= 400 && < 510
Invitation invite(java.lang.String projectId, Invitation invitation) throws PacketException
projectId
- a packet project idinvitation
- a instance of Invitation
Invitation
PacketException
- for HTTP status code >= 400 && < 510
Invitation getInvite(java.lang.String invitationId) throws PacketException
invitationId
- a user invitation idInvitation
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean acceptInvite(java.lang.String invitationId) throws PacketException
invitationId
- a user invitation idInvitation
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean declineInvite(java.lang.String invitationId) throws PacketException
invitationId
- a user invitation idInvitation
PacketException
- for HTTP status code >= 400 && < 510
Events getEvents(java.util.Date since, java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
since
- date time of events to fetchpageNo
- for paginationperPage
- no. of items per page (optional, can pass null)Events
PacketException
- for HTTP status code >= 400 && < 510
Events getProjectEvents(java.lang.String projectId, java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
projectId
- packet project idpageNo
- for paginationperPage
- no. of items per page (optional, can pass null)Events
PacketException
- for HTTP status code >= 400 && < 510
Events getDeviceEvents(java.lang.String deviceId, java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
deviceId
- packet device idpageNo
- for paginationperPage
- no. of items per page (optional, can pass null)Events
PacketException
- for HTTP status code >= 400 && < 510
Event getEvent(java.lang.String eventId) throws PacketException
eventId
- id of project or device event idEvent
PacketException
- for HTTP status code >= 400 && < 510
Notifications getNotifications(java.util.Date since, java.lang.Boolean all, java.lang.Integer pageNo, java.lang.Integer perPage) throws PacketException
since
- date time of notifications to fetchall
- to include read notification toopageNo
- for paginationperPage
- no. of items per page (optional, can pass null)Notifications
PacketException
- for HTTP status code >= 400 && < 510
Notification getNotification(java.lang.String notificationId) throws PacketException
notificationId
- id of the packet notificationsNotification
PacketException
- for HTTP status code >= 400 && < 510
Notification updateNotification(Notification notification) throws PacketException
notification
- a instance of the Notification
Notification
PacketException
- for HTTP status code >= 400 && < 510
Email addEmailAddress(Email email) throws PacketException
email
- a valid email addressEmail
PacketException
- for HTTP status code >= 400 && < 510
Email getEmailAddress(java.lang.String emailId) throws PacketException
emailId
- id of the email address recordEmail
PacketException
- for HTTP status code >= 400 && < 510
Email updateEmailAddress(Email email) throws PacketException
email
- a instance of Email
Email
PacketException
- for HTTP status code >= 400 && < 510
java.lang.Boolean deleteEmailAddress(java.lang.String emailId) throws PacketException
emailId
- id of the email address recordBoolean
PacketException
- for HTTP status code >= 400 && < 510