{"_id":"liboneandone","_rev":"291002","name":"liboneandone","description":"The 1&1 Library for Node and Io","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"alibazlamit","email":"ali@stackpointcloud.com"},{"name":"oneandone","email":"repositories@arsys.es"}],"time":{"modified":"2021-06-03T18:50:44.000Z","created":"2017-08-10T14:29:42.210Z","1.2.0":"2018-07-31T11:00:58.691Z","1.1.0":"2018-06-04T16:33:51.625Z","1.0.0":"2017-08-10T14:29:42.210Z"},"users":{},"author":{"name":"alibaz","email":"ali@stackpointcloud.com"},"repository":{"type":"git","url":"git+https://github.com/temp/temp.git"},"versions":{"1.2.0":{"name":"liboneandone","version":"1.2.0","description":"The 1&1 Library for Node and Io","main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/temp/temp.git"},"author":{"name":"alibaz","email":"ali@stackpointcloud.com"},"license":"BSD","homepage":"https://github.com/temp/temp#readme","dependencies":{"mocha":"^2.5.3","request":"^2.74.0"},"devDependencies":{},"directories":{"example":"examples"},"keywords":["OneAndOne","sdk","cloud","REST","cloud sdk","SDK","deploy","api","Stack Point Cloud","libOneAndone","1&1","fs"],"gitHead":"76777544b58b02823c9e328db1e2bc95e6b91839","_id":"liboneandone@1.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alibazlamit","email":"ali@stackpointcloud.com"},"dist":{"shasum":"8d2c91c72a6323a96aed8410de05e06d6584b602","size":39945,"noattachment":false,"key":"/liboneandone/-/liboneandone-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/liboneandone/download/liboneandone-1.2.0.tgz"},"maintainers":[{"name":"alibazlamit","email":"ali@stackpointcloud.com"},{"name":"oneandone","email":"repositories@arsys.es"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/liboneandone_1.2.0_1533034858571_0.9132510792769601"},"_hasShrinkwrap":false,"publish_time":1533034858691,"_cnpm_publish_time":1533034858691},"1.1.0":{"name":"liboneandone","version":"1.1.0","description":"The 1&1 Library for Node and Io","main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/temp/temp.git"},"author":{"name":"alibaz","email":"ali@stackpointcloud.com"},"license":"BSD","homepage":"https://github.com/temp/temp#readme","dependencies":{"mocha":"^2.5.3","request":"^2.74.0"},"devDependencies":{},"directories":{"example":"examples"},"keywords":["OneAndOne","sdk","cloud","REST","cloud sdk","SDK","deploy","api","Stack Point Cloud","libOneAndone","1&1","fs"],"gitHead":"11fc856b3113d0a810d016a867930ccce00612b9","_id":"liboneandone@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alibazlamit","email":"ali@stackpointcloud.com"},"dist":{"shasum":"11947b05c8bb867b6f124c05033011e9b3659c63","size":39756,"noattachment":false,"key":"/liboneandone/-/liboneandone-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/liboneandone/download/liboneandone-1.1.0.tgz"},"maintainers":[{"name":"alibazlamit","email":"ali@stackpointcloud.com"},{"name":"oneandone","email":"repositories@arsys.es"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/liboneandone_1.1.0_1528130031210_0.1717700705666434"},"_hasShrinkwrap":false,"publish_time":1528130031625,"_cnpm_publish_time":1528130031625},"1.0.0":{"name":"liboneandone","version":"1.0.0","description":"The 1&1 Library for Node and Io","main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/temp/temp.git"},"author":{"name":"alibaz","email":"ali@stackpointcloud.com"},"license":"BSD","homepage":"https://github.com/temp/temp#readme","dependencies":{"mocha":"^2.5.3","request":"^2.74.0"},"devDependencies":{},"directories":{"example":"examples"},"keywords":["OneAndOne","sdk","cloud","REST","cloud sdk","SDK","deploy","api","Stack Point Cloud","libOneAndone","1&1"],"gitHead":"9f36f7834e8607e30c703f5ceba7ae7f26a788d1","_id":"liboneandone@1.0.0","_shasum":"d6da74dbae0530fbf3e2dd33f7304e76431fc0d3","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"alibazlamit","email":"ali@stackpointcloud.com"},"dist":{"shasum":"d6da74dbae0530fbf3e2dd33f7304e76431fc0d3","size":35277,"noattachment":false,"key":"/liboneandone/-/liboneandone-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/liboneandone/download/liboneandone-1.0.0.tgz"},"maintainers":[{"name":"alibazlamit","email":"ali@stackpointcloud.com"},{"name":"oneandone","email":"repositories@arsys.es"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/liboneandone-1.0.0.tgz_1502375382083_0.6564226991031319"},"publish_time":1502375382210,"_hasShrinkwrap":false,"_cnpm_publish_time":1502375382210}},"readme":"# 1&1 Cloudserver Node.js SDK\r\n\r\nThe 1&1 Node.js SDK is a Node.js library designed for interaction with the 1&1 cloud platform over the REST API.\r\n\r\nThis guide contains instructions on getting started with the library and automating various management tasks available through the 1&1 Cloud Panel UI. For more information on the 1&1 Cloudserver Node.js SDK see the [1&1 Community Portal](https://www.1and1.com/cloud-community/).\r\n\r\n## Table of Contents\r\n\r\n- [Overview](#overview)\r\n- [Getting Started](#getting-started)\r\n  * [Installation](#installation)\r\n  * [Authentication](#authentication)\r\n  * [Error Handling](#error-handling)\r\n- [Operations](#operations)\r\n  - [Servers](#servers)\r\n  - [Images](#images)\r\n  - [Shared Storages](#shared-storages)\r\n  - [Firewall Policies](#firewall-policies)\r\n  - [Load Balancers](#load-balancers)\r\n  - [Public IPs](#public-ips)\r\n  - [Private Networks](#private-networks)\r\n  - [VPNs](#vpns)  \r\n  - [Monitoring Center](#monitoring-center)\r\n  - [Monitoring Policies](#monitoring-policies)\r\n  - [Logs](#logs)\r\n  - [Users](#users)\r\n  - [Roles](#roles)\r\n  - [Usages](#usages)\r\n  - [Server Appliances](#server-appliances)\r\n  - [DVD ISO](#dvd-iso)\r\n  - [Ping](#ping)\r\n  - [Pricing](#pricing)\r\n  - [Data Centers](#data-centers)\r\n  - [SSH Keys](#ssh-keys)\r\n  - [Block Storages](#block-storages)\r\n- [Example](#example)\r\n- [Index](#index)\r\n\r\n\r\n## Overview\r\n\r\nThis SDK is a wrapper for the 1&1 REST API written in Node.js. All operations against the API are performed over SSL and authenticated using your 1&1 token key. The Node.js library facilitates the access to the REST API within an instance running on 1&1 platform.\r\n\r\nFor more information on the 1&1 Cloud Server for Node.js, visit the [Community Portal](https://www.1and1.com/cloud-community/).\r\n\r\n## Getting Started\r\n\r\nBefore you begin you will need to have signed up for a 1&1 account. The credentials you create during sign-up will be used to authenticate against the API.\r\n\r\nThe Node.js Client Library is available on npm. You can install the latest stable version using npm:\r\n\r\n### Installation\r\n\r\nThe official Node.js library is available from the 1&1 GitHub account found [here](https://github.com/1and1/oneandone-cloudserver-sdk-nodejs).\r\n\r\n### Authentication\r\n\r\nSet the authentication token and create the API client:\r\n\r\n```\r\noneandone.oneandoneauth(\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\");\r\n```\r\nSet the url of the API as follows\r\nas follows\r\n\r\n```\r\noneandone.setendpoint(\"https://cloudpanel-api.1and1.com/v1\");\r\n```\r\n\r\n### Error Handling\r\n\r\nPlease note that the 1&1 API always returns the error message in the body of the response, in the testhelper.js there is the method below, check its usages for how to handle errors:\r\n```\r\n//expectedStatus you pass this parameter to define what is the expected http status code\r\n//response is the parameter returned from the 1&1 response\r\nhelper.assertNoError = function (expectedStatus, response, callback) {\r\n    callback(expectedStatus == response.statusCode);\r\n};\r\n```\r\n\r\n\r\nRefer to the [Examples](#examples) and [Operations](#operations) sections for additional information.\r\n\r\n\r\n## Operations\r\n### Servers\r\n\r\n**List all servers:**\r\n\r\n`oneandone.listServers(function (error, response, body) { //consume the result });`\r\n\r\n**List all servers with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```\r\noneandone.listServersWithOptions(options, function (error, response, body) {//consume the result });\r\n```\r\n\r\nTo paginate the list of servers received in the response use `page` and `perPage` parameters. Set `perPage` to the number of servers that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of servers sorted in expected order pass a server property (e.g. `\"name\"`) in `sort` parameter.\r\n\r\nUse `query` parameter to search for a string in the response and return only the server instances that contain it.\r\n\r\nTo retrieve a collection of servers containing only the requested fields, pass a list of comma-separated properties (e.g. `\"id,name,description,hardware.ram\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**Retrieve a single server:**\r\n\r\n`oneandone.getServer(\"server_id\", function (error, response, body) {//consume the result });`\r\n\r\n**List fixed-size server templates:**\r\n\r\n`oneandone.listHardwareFlavours(function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a fixed-size server template:**\r\n\r\n`oneandone.getHardwareFlavour(hardware_flavour_id, function (error, response, body) {//consume the result });`\r\n\r\n**List Baremetal models:**\r\n\r\n`oneandone.listBaremetalModels(function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a baremetal model:**\r\n\r\n`oneandone.getBaremetalModel(baremetalModel.id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a server's hardware:**\r\n\r\n`oneandone.getHardware(server.id, function (error, response, body) {//consume the result });`\r\n\r\n**List a server's HDDs:**\r\n\r\n`oneandone.listHdds(server_id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve a single server HDD:**\r\n\r\n`oneandone.getHdd(server_id, hdd_id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a server's image:**\r\n\r\n`oneandone.getServerImage(server_id, function (error, response, body) {//consume the result });`\r\n\r\n**List a server's IPs:**\r\n\r\n`oneandone.listIps(server_id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a single server IP:**\r\n\r\n`oneandone.getIp(server_id, ip_id, function (error, response, body) {//consume the result });`\r\n\r\n**List all firewall policies assigned to a server IP:**\r\n\r\n`oneandone.listIpFirewallPolicies(server_id, ip_id, function (error, response, body) {//consume the result });`\r\n\r\n**List all load balancers assigned to a server IP:**\r\n\r\n`oneandone.listIpLoadBalancer(server_id, ip_id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a server's status:**\r\n\r\n`oneandone.getServerStatus(server_id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about the DVD loaded into the virtual DVD unit of a server:**\r\n\r\n` oneandone.getDvd(server_id, function (error, response, body) {//consume the result });`\r\n\r\n**List a server's private networks:**\r\n\r\n` oneandone.listServerPrivateNetworks(server_id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a server's private network:**\r\n\r\n`oneandone.getServerPrivateNetwork(server_id, current_privateNetwork_id, function (error, response, body) {//consume the result });`\r\n\r\n**List all server's snapshots:**\r\n\r\n`oneandone.listSnapshots(server_id, function (error, response, body) {//consume the result });`\r\n\r\n**Create a server:**\r\n\r\n```\r\nvar serverData = {\r\n  \"name\": \"My server\",\r\n  \"description\": \"My server description\",\r\n  \"rsa_key\": \"Put a valid public SSH Key to be copied into the server during creation. Then you will be able to access to the server using your SSH keys\",\r\n  \"password\":\"Password of the server. Password must contain more than 8 characters using uppercase letters, numbers and other special symbols.\",\r\n  \"firewall_policy_id\":\"Firewall policy's ID. If it is not provided, the server will assign the best firewall policy, creating a new one if necessary. If the parameter is sent with a 0 value, the server will be created with all ports blocked.\",\r\n  \"load_balancer_id\":\"Load balancer's ID\"?\r\n  \"monitoring_policy_id\":\"Monitoring policy's ID\",\r\n  \"ip_id\":\"IP's ID\",\r\n  \"server_type\":\"cloud or baremetal\",\r\n  \"hardware\": {\r\n    \"vcore\": 2,\r\n    \"cores_per_processor\": 1,\r\n    \"ram\": 2,\r\n    \"hdds\": [\r\n    {\r\n      \"size\": 40,\r\n      \"is_main\": true\r\n    },\r\n    {\r\n      \"size\": 20,\r\n      \"is_main\": false\r\n    }\r\n    ]\r\n  },\r\n  \"appliance_id\": \"B5F778B85C041347BCDCFC3172AB3F3C\",\r\n  \"datacenter_id\": \"908DC2072407C94C8054610AD5A53B8C\"\r\n};\r\n```\r\n```\r\noneandone.createServer(serverData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Create a baremetal server:**\r\n\r\n```\r\nvar serverData = {\r\n  \"name\": \"My server\",\r\n  \"description\": \"My server description\"\r\n  \"server_type\":\"baremetal\",\r\n  \"hardware\": {\r\n    \"baremetal_model_id\": \"Id of the baremetal model\"\r\n  },\r\n  \"appliance_id\": \"B5F778B85C041347BCDCFC3172AB3F3C\",\r\n  \"datacenter_id\": \"908DC2072407C94C8054610AD5A53B8C\"\r\n};\r\n```\r\n```\r\noneandone.createServer(serverData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Create a fixed-size server and return back the server's IP address and first password:**\r\n\r\n```\r\nvar serverData = {\r\n\t\"name\": \"Node Fixed Instance server\",\r\n\t\"description\": \"My server description\",\r\n\t\"hardware\": {\r\n\t\t\"fixed_instance_size_id\": \"65929629F35BBFBA63022008F773F3EB\"\r\n\t},\r\n\t\"appliance_id\": \"B5F778B85C041347BCDCFC3172AB3F3C\",\r\n\t\"datacenter_id\": \"908DC2072407C94C8054610AD5A53B8C\"\r\n};\r\n```\r\n```\r\noneandone.createServer(serverData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Update a server:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"name\": \"Node Server - UPDATED\",\r\n\t\"description\": \"desc\"\r\n};\r\noneandone.updateServer(server_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Delete a server:**\r\n\r\n`oneandone.deleteServer(server_id,keep_ips, function (error, response, body) {//consume the result });`\r\n\r\nSet `keep_ips` parameter to `true` for keeping server IPs after deleting a server.\r\n\r\n**Update a server's hardware:**\r\n\r\n```\r\nvar updateHardwareData = {\r\n\t\"vcore\": 4,\r\n\t\"cores_per_processor\": 2,\r\n\t\"ram\": 6\r\n};\r\noneandone.updateHardware(server_id, updateHardwareData, function (error, response, body) {//consume the result });       \r\n```\r\n\r\n**Add new hard disk(s) to a server:**\r\n\r\n```\r\nvar hddData = {\r\n\t\"hdds\": [\r\n\t\t{\r\n\t\t\t\"size\": 40,\r\n\t\t\t\"is_main\": false\r\n\t\t}\r\n\t]\r\n};\r\n```\r\n```\r\noneandone.addHdd(server_id, hddData, function (error, response, body) {//consume the result }); \r\n```\r\n\r\n**Resize a server's hard disk:**\r\n\r\n```\r\n var updateData = {\r\n\t\"size\": 40\r\n};\r\noneandone.updateHdd(server_id, hdd_id, updateData, function (error, response, body) {//consume the result }); \r\n```\r\n\r\n**Remove a server's hard disk:**\r\n\r\n`oneandone.deleteHdd(server_id, hdd_id, function (error, response, body) {//consume the result });`\r\n\r\n**Load a DVD into the virtual DVD unit of a server:**\r\n\r\n```\r\nvar updateDVD = {\r\n\t\"id\": \"908DC2072407C94C8054610AD5A53B8C\"\r\n};\r\noneandone.loadDvd(server_id, updateDVD, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Unload a DVD from the virtual DVD unit of a server:**\r\n\r\n`oneandone.unloadDvd(server_id, function (error, response, body) {//consume the result });`\r\n\r\n**Reinstall a new image into a server:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"id\": \"908DC2072407C94C8054610AD5A53B8C\",//imageid\r\n\t\"password\": \"Test123!\"\r\n};\r\noneandone.updateServerImage(server_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Assign a new IP to a server:**\r\n\r\n```\r\nvar ipData = {\r\n\t\"type\": \"IPV4\"\r\n};\r\noneandone.addIp(server_id, ipData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Release an IP and optionally remove it from a server:**\r\n\r\n```\r\n var keepip = {\r\n\t\"keep_ip\": false\r\n};\r\noneandone.deleteIp(server_id, ip_id,keepip, function (error, response, body) {//consume the result });\r\n```\r\n\r\nSet `keep_ip` to true for releasing the IP without removing it.\r\n\r\n**Assign a new firewall policy to a server's IP:**\r\n\r\n```\r\nvar firewallPolicyData = {\r\n\t\"id\": \"071C8EB665DBA2EE574F3ED1256E5694\"\r\n};\r\noneandone.addFirewallPolicy(server_id, ip_id, firewallPolicyData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Assign a new load balancer to a server's IP:**\r\n\r\n```\r\nvar loadBalancerData = {\r\n\t\"load_balancer_id\": \"071C8EB665DBA2EE574F3ED1256E5694\"\r\n};\r\noneandone.addIpLoadBalancer(server_id, ip_id, loadBalancerData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Remove a load balancer from a server's IP:**\r\n\r\n`oneandone.deleteIpLoadBalancer(server_id, ip_id, load_balancer_id, function (error, response, body) {//consume the result });`\r\n\r\n**Start a server:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"action\": oneandone.ServerUpdateAction.POWER_ON,\r\n\t\"method\": oneandone.ServerUpdateMethod.SOFTWARE\r\n};\r\noneandone.updateServerStatus(server_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\n\r\nSet `setMethod` to either for `Types.ServerActionMethod.SOFTWARE` or `Types.ServerActionMethod.HARDWARE`for method of rebooting.\r\n\r\n**Recovery Reboot a server:**\r\n\r\n```\r\noneandone.recoveryRebootServer (server_id, recovery_image_id, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Reboot a server:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"action\": oneandone.ServerUpdateAction.REBOOT,\r\n\t\"method\": oneandone.ServerUpdateMethod.SOFTWARE\r\n\t};\r\noneandone.updateServerStatus(server_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\n\r\nSet `setMethod` to either for `Types.ServerActionMethod.SOFTWARE` or `Types.ServerActionMethod.HARDWARE`for method of rebooting.\r\n\r\n**Shutdown a server:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"action\": oneandone.ServerUpdateAction.POWER_OFF,\r\n\t\"method\": oneandone.ServerUpdateMethod.SOFTWARE\r\n\t};\r\noneandone.updateServerStatus(server_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\n\r\nSet `method` to either for `oneandone.ServerUpdateMethod.SOFTWARE` or `oneandone.ServerUpdateMethod.HARDWARE`for method of rebooting.\r\n\r\n**Assign a private network to a server:**\r\n\r\n```\r\nvar pnData = {\r\n\t\"id\": \"071C8EB665DBA2EE574F3ED1256E5694\"\r\n};\r\noneandone.assignPrivateNetworkToServer(server_id, pnData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Remove a server's private network:**\r\n\r\n`oneandone.deletePrivateNetworkFromServer(server_id, current_privateNetwork_id, function (error, response, body) {//consume the result });`\r\n\r\n**Create a new server's snapshot:**\r\n\r\n`oneandone.createSnapshot(server_id, null, function (error, response, body) {//consume the result });`\r\n\r\n**Restore a server's snapshot:**\r\n\r\n`oneandone.restoreSnapshot(server_id, current_snapShot_id, null, function (error, response, body) {//consume the result });`\r\n\r\n**Remove a server's snapshot:**\r\n\r\n`oneandone.deleteSnapshot(server_id, current_snapShot_id, function (error, response, body) {//consume the result });`\r\n\r\n**Clone a server:**\r\n\r\n```\r\nvar cloneData = {\r\n\t\"name\": \"node clone\",\r\n\t\"datacenter_id\": \"datacenter_id\"\r\n};\r\noneandone.clone(server.id, cloneData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n\r\n### Images\r\n\r\n**List all images:**\r\n\r\n` oneandone.listImages(function (error, response, body) {//consume the result });`\r\n\r\n**List all images with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```\r\noneandone.listImagesWithOptions(options, function (error, response, body) {//consume the result });\r\n```\r\n\r\nTo paginate the list of load balancers received in the response use `page` and `perPage` parameters. Set `perPage` to the number of load balancers that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of load balancers sorted in expected order, pass a load balancer property (e.g. `\"name\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the load balancer instances that contain it.\r\n\r\nTo retrieve a collection of load balancers containing only the requested fields, pass a list of comma-separated properties (e.g. `\"ip,name,method\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**Retrieve a single image:**\r\n\r\n`oneandone.getImage(image_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Create an image:**\r\n\r\n```\r\nvar imageData = {\r\n\t\"server_id\": server.id,\r\n\t\"name\": \"node image\",\r\n\t\"description\": \"My image description\",\r\n\t\"frequency\": oneandone.ImageFrequency.WEEKLY,\r\n\t\"num_images\": 1,\r\n\t\"source\":\"[\"server\", \"image\", \"iso\"]\",\r\n        \"url\":\"URL where the image can be downloaded. It is required when the source is image or iso.\",\r\n        \"os_id\":\"ID of the Operative System you want to import. You can get a list of the available ones with the method **List all images**\"\r\n        \"type\":\"[\"os\", \"app\"]\".\r\n};\r\noneandone.createImage(imageData, function (error, response, body) {//consume the result });\r\n```\r\nAll fields except `Description` are required. `Frequency` may be set to `\"ONCE\"`, `\"DAILY\"` or `\"WEEKLY\"`.\r\n\r\nUse the same method to import an existing ISO image.\r\n\r\n```\r\nvar imageData = {\r\n\t\"name\": \"node image\",\r\n\t\"description\": \"My image description\",\r\n        \"source\": \"iso\",\r\n        \"url\": \"source of the image url\",\r\n        \"type\": \"os\",\r\n        \"os_id\": os id,\r\n        \"datacenter_id\": datacenterId\r\n\r\n};\r\n```\r\n`Type` should be set to `os` or `app`. `OsId` is required if the image type is `os`.\r\n\r\nTo import a `vdi`, `qcow`, `qcow2`, `vhd`, `vhdx` or `vmdk` image, instantiate the image request as follows:\r\n\r\n```\r\nvar imageData = {\r\n\t\"name\": \"node image\",\r\n\t\"description\": \"My image description\",\r\n        \"source\": \"image\",\r\n        \"url\": image_url,\r\n        \"os_id\": os id,\r\n        \"datacenter_id\": datacenterId\r\n\r\n};\r\n```\r\n\r\n**Update an image:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"name\": \"image updated nodejs\",\r\n\t\"description\": \"New image description\",\r\n\t\"frequency\": oneandone.ImageFrequency.ONCE\r\n};\r\noneandone.updateImage(image_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n`Frequency` may be set to `\"ONCE\"`, `\"DAILY\"` or `\"WEEKLY\"`.\r\n\r\n**Delete an image:**\r\n\r\n`oneandone.deleteImage(image_id, function (error, response, body) {//consume the result });`\r\n\r\n### Shared Storages\r\n\r\n**List all Shared Storages:**\r\n\r\n`oneandone.listSharedStorages(function (error, response, body) {//consume the result });`\r\n\r\n**List all Shared Storages with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```\r\noneandone.listSharedStoragesWithOptions(options, function (error, response, body) {//consume the result });\r\n```\r\n\r\nTo paginate the list of load balancers received in the response use `page` and `perPage` parameters. Set `perPage` to the number of load balancers that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of load balancers sorted in expected order, pass a load balancer property (e.g. `\"name\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the load balancer instances that contain it.\r\n\r\nTo retrieve a collection of load balancers containing only the requested fields, pass a list of comma-separated properties (e.g. `\"ip,name,method\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**Retrieve a shared storage:**\r\n\r\n`oneandone.getSharedStorage(shared_storage_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Create a shared storage:**\r\n\r\n```\r\nvar storageData = {\r\n\t\"name\": \"Node storage test\",\r\n\t\"description\": \"My shared storage test description\",\r\n\t\"size\": 50\r\n};\r\noneandone.createSharedStorage(storageData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n`Description` is optional parameter.\r\n\r\n\r\n**Update a shared storage:**\r\n\r\n```\r\nupdateData = {\r\n\t\"name\": \"node js storage test rename\",\r\n\t\"description\": \"My shared storage rename\"\r\n};\r\noneandone.updateSharedStorage(shared_storage_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\nAll request's parameters are optional.\r\n\r\n\r\n**Remove a shared storage:**\r\n\r\n`oneandone.deleteSharedStorage(shared_storage_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**List a shared storage servers:**\r\n\r\n`oneandone.listSharedStorageServers(shared_storage_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Retrieve a shared storage server:**\r\n\r\n`oneandone.getSharedStorageServer(shared_storage_id, server_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Add servers to a shared storage:**\r\n\r\n```\r\nvar attachData = {\r\n\t\"servers\": [\r\n\t\t{\r\n\t\t\t\"id\": server_id,\r\n\t\t\t\"rights\": oneandone.StorageServerRights.RW\r\n\t\t}\r\n\t]\r\n};\r\noneandone.attachServerToSharedStorage(shared_storage_id, attachData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n`StorageServerRights` may be set to `R` or `RW` string.\r\n\r\n\t\t\t\t\r\n**Remove a server from a shared storage:**\r\n\r\n`oneandone.detachServerFromSharedStorage(shared_storage_id, server_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Retrieve the credentials for accessing the shared storages:**\r\n\r\n`oneandone.getAccessCredentials(function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Change the password for accessing the shared storages:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"password\": \"Test123!\"\r\n};\r\noneandone.changePassword(updateData, function (error, response, body) {//consume the result });\t\r\n```\r\n\r\n\r\n### Firewall Policies\r\n\r\n**List firewall policies:**\r\n\r\n`oneandone.listFirewallPolicies(function (error, response, body) {//consume the result });`\r\n\r\n**List all firewall policies with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```\r\noneandone.listFirewallPoliciesWithOptions(options, function (error, response, body) {//consume the result });\r\n```\r\n\r\nTo paginate the list of load balancers received in the response use `page` and `perPage` parameters. Set `perPage` to the number of load balancers that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of load balancers sorted in expected order, pass a load balancer property (e.g. `\"name\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the load balancer instances that contain it.\r\n\r\nTo retrieve a collection of load balancers containing only the requested fields, pass a list of comma-separated properties (e.g. `\"ip,name,method\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**Retrieve a single firewall policy:**\r\n\r\n`oneandone.getFirewallPolicy(firewall_policy_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Create a firewall policy:**\r\n\r\n```\r\nvar firewallData = {\r\n\t\"name\": \"node firewall policy\",\r\n\t\"description\": \"My firewall policy description\",\r\n\t\"rules\": [\r\n\t\t{\r\n\t\t\t\"protocol\": \"TCP\",\r\n\t\t\t\"port\": \"80\",\r\n            \"action\": \"allow\",\r\n\t\t\t\"source\": \"0.0.0.0\"\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"protocol\": \"TCP\",\r\n\t\t\t\"port\": \"443\",\r\n            \"action\": \"allow\",\r\n\t\t\t\"source\": \"0.0.0.0\"\r\n\t\t}\r\n\t]\r\n};\r\n```\r\n```\r\noneandone.createFirewallPolicy(firewallData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n`setSource` and `setDescription` are optional parameters.\r\n\r\n\t\t\t\r\n**Update a firewall policy:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"name\": \"node js Firewall test rename\",\r\n\t\"description\": \"My Firewall Policy rename\"\r\n};\r\n```\r\n```\r\noneandone.updateFirewallPolicy(firewall_policy_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n\t\t\t\r\n**Delete a firewall policy:**\r\n\r\n`oneandone.deleteFirewallPolicy(firewall_policy_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**List servers/IPs attached to a firewall policy:**\r\n\r\n`oneandone.listFirewallPolicyServerIps(firewall_policy_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Retrieve information about a server/IP assigned to a firewall policy:**\r\n\r\n`oneandone.getFirewallPolicyServerIp(firewall_policy_id, server_ip_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Add servers/IPs to a firewall policy:**\r\n\r\n```\r\nvar assignData = {\r\n\t\"server_ips\": [\r\n\t\tserver_ip_id\r\n\t]\r\n};\r\noneandone.assignServerIpToFirewallPolicy(firewall_policy_id, assignData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**List rules of a firewall policy:**\r\n\r\n`oneandone.listFirewallPolicyRules(firewall_policy_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Retrieve information about a rule of a firewall policy:**\r\n\r\n`oneandone.getFirewallPolicyRule(firewall_policy_id, firewall_policy_rule_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Adds new rules to a firewall policy:**\r\n\r\n```\r\nvar ruleData = {\r\n\t\"rules\": [\r\n\t\t{\r\n\t\t\t\"protocol\": oneandone.RuleProtocol.TCP,\r\n\t\t\t\"port\": \"4567\",\r\n\t\t\t\"action\": \"allow\",\r\n\t\t\t\"source\": \"0.0.0.0\"\r\n\t\t}\r\n\t]\r\n};\r\n```\r\n```\r\noneandone.addRulesToFirewallPolicy(firewall_policy_id, ruleData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Remove a rule from a firewall policy:**\r\n\r\n`oneandone.removeRuleFromFirewallPolicy(firewall_policy_id, firewall_policy_rule_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n### Load Balancers\r\n\r\n**List load balancers:**\r\n\r\n`oneandone.listLoadBalancers(function (error, response, body) {//consume the result });`\r\n\r\n**List all load balancers with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```\r\noneandone.listLoadBalancersWithOptions(options, function (error, response, body) {//consume the result });\r\n```\r\n\r\nTo paginate the list of load balancers received in the response use `page` and `perPage` parameters. Set `perPage` to the number of load balancers that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of load balancers sorted in expected order, pass a load balancer property (e.g. `\"name\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the load balancer instances that contain it.\r\n\r\nTo retrieve a collection of load balancers containing only the requested fields, pass a list of comma-separated properties (e.g. `\"ip,name,method\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**Retrieve a single load balancer:**\r\n\r\n`oneandone.getLoadBalancer(load_balancer_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Create a load balancer:**\r\n\r\n```\r\nvar balancerData = {\r\n\t\"name\": \"node balancer\",\r\n\t\"description\": \"My load balancer description\",\r\n\t\"health_check_test\": oneandone.HealthCheckTestTypes.TCP,\r\n\t\"health_check_interval\": 1,\r\n\t\"health_check_path\": \"path\",\r\n\t\"health_check_parser\": null,\r\n\t\"persistence\": true,\r\n\t\"persistence_time\": 200,\r\n\t\"method\": oneandone.LoadBalancerMethod.ROUND_ROBIN,\r\n\t\"rules\": [\r\n\t\t{\r\n\t\t\t\"protocol\": \"TCP\",\r\n\t\t\t\"port_balancer\": 80,\r\n\t\t\t\"port_server\": 80,\r\n\t\t\t\"source\": \"0.0.0.0\"\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"protocol\": \"TCP\",\r\n\t\t\t\"port_balancer\": 9999,\r\n\t\t\t\"port_server\": 8888,\r\n\t\t\t\"source\": \"0.0.0.0\"\r\n\t\t}\r\n\t]\r\n};\r\n```\r\n```\r\noneandone.createLoadBalancer(balancerData, function (error, response, body) {//consume the result });\r\n```\r\nOptional parameters are `HealthCheckPath`, `HealthCheckPathParser`, `Source` and `Description`. Load balancer `Method` must be set to `\"ROUND_ROBIN\"` or `\"LEAST_CONNECTIONS\"`.\r\n\r\n**Update a load balancer:**\r\n```\r\nvar updateData = {\r\n            \"name\": \"node balancer rename\",\r\n            \"description\": \"My load balancer rename description\",\r\n            \"health_check_test\": oneandone.HealthCheckTestTypes.TCP,\r\n            \"health_check_interval\": 40,\r\n            \"persistence\": true,\r\n            \"persistence_time\": 1200,\r\n            \"method\": oneandone.LoadBalancerMethod.ROUND_ROBIN\r\n        };\r\noneandone.updateLoadBalancer(load_balancer_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\nAll updatable fields are optional.\r\n\r\n\r\n**Delete a load balancer:**\r\n\r\n`oneandone.deleteLoadBalancer(load_balancer_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**List servers/IPs attached to a load balancer:**\r\n\r\n`oneandone.listLoadBalancerServerIps(load_balancer_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Retrieve information about a server/IP assigned to a load balancer:**\r\n\r\n`oneandone.getLoadBalancerServerIp(load_balancer_id, server_ip_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Add servers/IPs to a load balancer:**\r\n\r\n```\r\nvar assignData = {\r\n\t\"server_ips\": [\r\n\t\tserver_ip_id\r\n\t]\r\n};\r\noneandone.assignServerIpToLoadBalancer(load_balancer_id, assignData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n\r\n**Remove a server/IP from a load balancer:**\r\n\r\n`oneandone.unassignServerIpFromLoadBalancer(load_balancer_id, server_ip_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**List rules of a load balancer:**\r\n\r\n`oneandone.listLoadBalancerRules(load_balancer_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Retrieve information about a rule of a load balancer:**\r\n\r\n`oneandone.getLoadBalancerRule(load_balancer_id, loadBalancer_rule_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Adds new rules to a load balancer:**\r\n\r\n```\r\nvar ruleData = {\r\n\t\"rules\": [\r\n\t\t{\r\n\t\t\t\"protocol\": oneandone.RuleProtocol.TCP,\r\n\t\t\t\"port_balancer\": 82,\r\n\t\t\t\"port_server\": 82,\r\n\t\t\t\"source\": \"0.0.0.0\"\r\n\t\t}\r\n\t]\r\n};\r\noneandone.addRulesToLoadBalancer(load_balancer_id, ruleData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Remove a rule from a load balancer:**\r\n\r\n`oneandone.removeRuleFromLoadBalancer(load_balancer_id, loadBalancer_rule_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n### Public IPs\r\n\r\n**Retrieve a list of your public IPs:**\r\n\r\n`oneandone.listPublicIps(function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve a list of your public IPs with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n\r\n```oneandone.listPublicIpsWithOptions(options, function (error, response, body) {//consume the result });```\r\n\r\nTo paginate the list of public IPs received in the response use `page` and `per_page` parameters. Set `per_page` to the number of public IPs that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of public IPs sorted in expected order, pass a public IP property (e.g. `\"ip\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the public IP instances that contain it.\r\n\r\nTo retrieve a collection of public IPs containing only the requested fields, pass a list of comma-separated properties (e.g. `\"id,ip,reverse_dns\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n\r\n**Retrieve a single public IP:**\r\n\r\n`oneandone.getPublicIp(public_ip_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Create a public IP:**\r\n\r\n```\r\n var publicIpData = {\r\n\t\"reverse_dns\": \"node.com\",\r\n\t\"type\": oneandone.IPType.IPV4\r\n};\r\noneandone.createPublicIp(publicIpData, function (error, response, body) {//consume the result });\r\n```\r\n\t\r\nBoth parameters are optional and may be left blank. `type` may be set to `\"IPV4\"` or `\"IPV6\"`. Presently, only IPV4 is supported.\r\n\r\n**Update the reverse DNS of a public IP:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"reverse_dns\": \"example.es\"\r\n};\r\noneandone.updatePublicIp(public_ip_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\n\r\nIf an empty string is passed in `reverseDns,` it removes previous reverse dns of the public IP.\r\n\r\n**Remove a public IP:**\r\n\r\n`oneandone.deletePublicIp(public_ip_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n### Private Networks\r\n\r\n**List all private networks:**\r\n\r\n`oneandone.listPrivateNetworks(function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve a list of your private networks with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```\r\noneandone.listPrivateNetworksWithOptions(options, function (error, response, body) {//consume the result });\r\n```\r\n\r\nTo paginate the list of private networks received in the response use `page` and `per_page` parameters. Set `per_page` to the number of private networks that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of private networks sorted in expected order pass a private network property (e.g. `\"-creation_date\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the private network instances that contain it.\r\n\r\nTo retrieve a collection of private networks containing only the requested fields, pass a list of comma-separated properties (e.g. `\"id,name,creation_date\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is blank, it is ignored in the request.\r\n\r\n**Retrieve information about a private network:**\r\n\r\n`oneandone.getPrivateNetwork(private_network_id, function (error, response, body) {//consume the result });`\r\n\r\n**Create a new private network:**\r\n\r\n```\r\nvar pnData = {\r\n\t\"name\": \"node Private Network\",\r\n\t\"description\": \"node Private network description\",\r\n\t\"network_address\": \"192.168.1.0\",\r\n\t\"subnet_mask\": \"255.255.255.0\"\r\n};\r\noneandone.createPrivateNetwork(pnData, function (error, response, body) {//consume the result });\r\n```\r\nPrivate network `Name` is required parameter.\r\n\r\n\r\n**Modify a private network:**\r\n\r\n```\r\nupdateData = {\r\n\t\"name\": \"node update Private Network\",\r\n\t\"description\": \"Private network description\",\r\n\t\"network_address\": \"192.168.1.0\",\r\n\t\"subnet_mask\": \"255.255.255.0\"\r\n};\r\n```\r\n```\r\noneandone.updatePrivateNetwork(private_network_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\nAll parameters in the request are optional.\r\n\r\n\r\n**Delete a private network:**\r\n\r\n`oneandone.deletePrivateNetwork(private_network_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**List all servers attached to a private network:**\r\n\r\n`oneandone.listPrivateNetworkServers(private_network_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Retrieve a server attached to a private network:**\r\n\r\n`oneandone.getPrivateNetworkServer(private_network_id, server_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Attach servers to a private network:**\r\n\r\n```\r\nvar attach = {\r\n\t\"servers\": [\r\n\t\t\"server_id\"\r\n\t]\r\n};\r\noneandone.attachServerToPrivateNetwork(private_network_id, attach, function (error, response, body) {\r\n```\r\n*Note:* Servers cannot be attached to a private network if they currently have a snapshot.\r\n\r\n\r\n**Remove a server from a private network:**\r\n\r\n`oneandone.detachServerFromPrivateNetwork(private_network_id, server_id, function (error, response, body) {`\r\n\r\n*Note:* The server cannot be removed from a private network if it currently has a snapshot or it is powered on.\r\n\r\n### VPNs\r\n\r\n**List all VPNs:**\r\n\r\n`oneandone.listVpns(function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve a list of your VPNs with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n\r\n```oneandone.listVpnsWithOptions(options, function (error, response, body) {//consume the result });```\r\n\r\nTo paginate the list of VPNs received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of VPNs that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of VPNs sorted in expected order pass a VPN property (e.g. `\"name\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the VPN instances that contain it.\r\n\r\nTo retrieve a collection of VPNs containing only the requested fields pass a list of comma separated properties (e.g. `\"id,name,creation_date\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**Retrieve information about a VPN:**\r\n\r\n`oneandone.getVpn(vpn.id, function (error, response, body) {//consume the result });`\r\n\r\n**Create a VPN:**\r\n\r\n``` \r\nvar vpnData = {\r\n  \"name\": \"My VPN\",\r\n  \"description\": \"My VPN description\",\r\n  \"datacenter_id\": \"D0F6D8C8ED29D3036F94C27BBB7BAD36\"\r\n};\r\n```\r\n```\r\noneandone.createVpn(vpnData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Modify a VPN:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"name\": \"node VPN rename\",\r\n\t\"description\": \"node VPN rename description\"\r\n};\r\n```\r\n```\r\noneandone.updateVpn(vpn.id, updateData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Delete a VPN:**\r\n\r\n`oneandone.deleteVpn(vpnToRemove.id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve a VPN's configuration file:**\r\n\r\n`oneandone.getConfigurationFile('C:\\\\'+vpn.name, vpn.id, function (error, response, body) {//this operation will create a zip file in the provided path and name});`\r\n\r\n### Monitoring Center\r\n\r\n**List all usages and alerts of monitoring servers:**\r\n\r\n`oneandone.listMonitoringCenters(function (error, response, body) {//consume the result });`\r\n\r\n**List all usages and alerts of monitoring servers with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n\r\n```oneandone.listMonitoringCentersWithOption(options, function (error, response, body) {//consume the result });```\r\n\r\nTo paginate the list of server usages received in the response use `page` and `per_page` parameters. Set `per_page` to the number of server usages that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of server usages sorted in expected order, pass a server usage property (e.g. `\"name\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the usage instances that contain it.\r\n\r\nTo retrieve a collection of server usages containing only the requested fields, pass a list of comma-separated properties (e.g. `\"id,name,status.state\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is blank, it is ignored in the request.\r\n\r\n**Retrieve the usages and alerts for a monitoring server:**\r\n\r\n`oneandone.getServerMonitoringCenterFixedPeriod(server_id, oneandone.PeriodType.LAST_24H, function (error, response, body) {//consume the result });`\r\n\r\n`period` may be set to `\"LAST_HOUR\"`, `\"LAST_24H\"`, `\"LAST_7D\"`, `\"LAST_30D\"`, `\"LAST_365D\"` or `\"CUSTOM\"`. If `period` is set to `\"CUSTOM\"`, \r\n\r\n**Retrieve the usages and alerts for a monitoring server for a customer period:**\r\n\r\n`Mneandone.getServerMonitoringCenterCustomPeriod(server_id, start_date, end_date, function (error, response, body) {//consume the result });`\r\n\r\n\r\n### Monitoring Policies\r\n\r\n**List all monitoring policies:**\r\n\r\n`oneandone.listMonitoringPolicies(function (error, response, body) {//consume the result });`\r\n\r\n**List all usages and alerts of monitoring servers with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```\r\noneandone.listMonitoringPoliciesWithOptions(options, function (error, response, body) {//consume the result });\r\n```\r\n\r\nTo paginate the list of monitoring policies received in the response use `page` and `per_page` parameters. Set `per_page` to the number of monitoring policies that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of monitoring policies sorted in expected order, pass a monitoring policy property (e.g. `\"name\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the monitoring policy instances that contain it.\r\n\r\nTo retrieve a collection of monitoring policies containing only the requested fields, pass a list of comma-separated properties (e.g. `\"id,name,creation_date\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**Retrieve a single monitoring policy:**\r\n\r\n` oneandone.getMonitoringPolicy(policy_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Create a monitoring policy:**\r\n\r\n```\r\nvar policyData = {\r\n    \"name\": \"node monitoring policy\",\r\n    \"description\": \"node monitoring policy description\",\r\n    \"email\": \"\",\r\n    \"agent\": true,\r\n    \"thresholds\": {\r\n        \"cpu\": {\r\n            \"warning\": {\r\n                \"value\": 90,\r\n                \"alert\": false\r\n            },\r\n            \"critical\": {\r\n                \"value\": 95,\r\n                \"alert\": false\r\n            }\r\n        },\r\n        \"ram\": {\r\n            \"warning\": {\r\n                \"value\": 90,\r\n                \"alert\": false\r\n            },\r\n            \"critical\": {\r\n                \"value\": 95,\r\n                \"alert\": false\r\n            }\r\n        },\r\n        \"disk\": {\r\n            \"warning\": {\r\n                \"value\": 80,\r\n                \"alert\": false\r\n            },\r\n            \"critical\": {\r\n                \"value\": 90,\r\n                \"alert\": false\r\n            }\r\n        },\r\n        \"transfer\": {\r\n            \"warning\": {\r\n                \"value\": 1000,\r\n                \"alert\": false\r\n            },\r\n            \"critical\": {\r\n                \"value\": 2000,\r\n                \"alert\": false\r\n            }\r\n        },\r\n        \"internal_ping\": {\r\n            \"warning\": {\r\n                \"value\": 50,\r\n                \"alert\": false\r\n            },\r\n            \"critical\": {\r\n                \"value\": 100,\r\n                \"alert\": false\r\n            }\r\n        }\r\n    },\r\n    \"ports\": [\r\n        {\r\n            \"protocol\": \"TCP\",\r\n            \"port\": \"22\",\r\n            \"alert_if\": \"RESPONDING\",\r\n            \"email_notification\": true\r\n        }\r\n    ],\r\n    \"processes\": [\r\n        {\r\n            \"process\": \"test\",\r\n            \"alert_if\": \"NOT_RUNNING\",\r\n            \"email_notification\": true\r\n        }\r\n    ]\r\n};\r\n```\r\n```\r\noneandone.createMonitoringPolicy(policyData, function (error, response, body) {//consume the result });\r\n```\r\nAll fields, except `Description`, are required. `AlertIf` property accepts values `\"RESPONDING\"`/`\"NOT_RESPONDING\"` for ports, and `\"RUNNING\"`/`\"NOT_RUNNING\"` for processes.\r\n\r\n\r\n**Update a monitoring policy:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"name\": \"node Monitoring Policy reName\",\r\n\t\"description\": \"node Monitoring Policy Description\",\r\n\t\"email\": \"test2@gmail.com\",\r\n\t\"thresholds\": {\r\n\t\t\"cpu\": {\r\n\t\t\t\"warning\": {\r\n\t\t\t\t\"value\": 90,\r\n\t\t\t\t\"alert\": false\r\n\t\t\t},\r\n\t\t\t\"critical\": {\r\n\t\t\t\t\"value\": 95,\r\n\t\t\t\t\"alert\": false\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"ram\": {\r\n\t\t\t\"warning\": {\r\n\t\t\t\t\"value\": 90,\r\n\t\t\t\t\"alert\": false\r\n\t\t\t},\r\n\t\t\t\"critical\": {\r\n\t\t\t\t\"value\": 95,\r\n\t\t\t\t\"alert\": false\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"disk\": {\r\n\t\t\t\"warning\": {\r\n\t\t\t\t\"value\": 80,\r\n\t\t\t\t\"alert\": false\r\n\t\t\t},\r\n\t\t\t\"critical\": {\r\n\t\t\t\t\"value\": 90,\r\n\t\t\t\t\"alert\": false\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"transfer\": {\r\n\t\t\t\"warning\": {\r\n\t\t\t\t\"value\": 1000,\r\n\t\t\t\t\"alert\": false\r\n\t\t\t},\r\n\t\t\t\"critical\": {\r\n\t\t\t\t\"value\": 2000,\r\n\t\t\t\t\"alert\": false\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"internal_ping\": {\r\n\t\t\t\"warning\": {\r\n\t\t\t\t\"value\": 50,\r\n\t\t\t\t\"alert\": false\r\n\t\t\t},\r\n\t\t\t\"critical\": {\r\n\t\t\t\t\"value\": 100,\r\n\t\t\t\t\"alert\": false\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\noneandone.updateMonitoringPolicy(policy_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\nAll fields of the request are optional. When a threshold is specified in the request, the threshold fields are required.\r\n\r\n**Delete a monitoring policy:**\r\n\r\n`oneandone.deleteMonitoringPolicy(policy_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**List all ports of a monitoring policy:**\r\n\r\n`oneandone.listMonitoringPoliciesPorts(policy_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Retrieve information about a port of a monitoring policy:**\r\n\r\n`oneandone.getPortsMonitoringPolicy(policy_id, port_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Add new ports to a monitoring policy:**\r\n\r\n```\r\nvar portsData = {\r\n\t\"ports\": [\r\n\t\t{\r\n\t\t\t\"protocol\": oneandone.ProtocolType.TCP,\r\n\t\t\t\"port\": \"80\",\r\n\t\t\t\"alert_if\": oneandone.AlertIfType.NOT_RESPONDING,\r\n\t\t\t\"email_notification\": false\r\n\t\t}\r\n\t]\r\n};\r\n```\r\n```\r\noneandone.createMonitoringPolicyForPorts(policy_id, portsData, function (error, response, body) {//consume the result });\r\n```\r\n\r\nPort properties are mandatory.\r\n\r\n**Modify a port of a monitoring policy:**\r\n\r\n```\r\nvar updatePortData = {\r\n\t\"ports\": {\r\n\t\t\"protocol\": oneandone.ProtocolType.TCP,\r\n\t\t\"port\": \"80\",\r\n\t\t\"alert_if\": oneandone.AlertIfType.RESPONDING,\r\n\t\t\"email_notification\": false\r\n\t}\r\n};\r\n```\r\n```\r\noneandone.updatePortsMonitoringPolicy(policy_id, port_id, updatePortData, function (error, response, body) {//consume the result });\r\n```\r\n*Note:* `Protocol` and `Port` cannot be changed.\r\n\r\n\r\n**Remove a port from a monitoring policy:**\r\n\r\n`oneandone.deletePortsMonitoringPolicy(policy.id, port.id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**List the processes of a monitoring policy:**\r\n\r\n`oneandone.listMonitoringPoliciesProcesses(policy_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Retrieve information about a process of a monitoring policy:**\r\n\r\n`oneandone.getProcessesMonitoringPolicy(policy_id, process_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n**Add new processes to a monitoring policy:**\r\n\r\n```\r\nvar processesData = {\r\n\t\"processes\": [\r\n\t\t{\r\n\t\t\t\"process\": \"taskmmgr\",\r\n\t\t\t\"alert_if\": oneandone.ProcessAlertType.RUNNING,\r\n\t\t\t\"email_notification\": false\r\n\t\t}\r\n\t]\r\n};\r\n```\r\n```\r\noneandone.createMonitoringPolicyForProcesses(policy_id, processesData, function (error, response, body) {//consume the result });\r\n```\r\n\r\nAll properties of the `MonitoringProcess` instance are required.\r\n\r\n\r\n**Modify a process of a monitoring policy:**\r\n\r\n```\r\nvar updatePortData = {\r\n\t\"processes\": {\r\n\t\t\"process\": \"test\",\r\n\t\t\"alert_if\": oneandone.ProcessAlertType.RUNNING,\r\n\t\t\"email_notification\": false\r\n\t}\r\n};\r\n```\r\n```\r\noneandone.updateProcessesMonitoringPolicy(policy_id, process_id, updatePortData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n*Note:* Process name cannot be changed.\r\n\r\n**Remove a process from a monitoring policy:**\r\n\r\n`oneandone.deleteProcessesMonitoringPolicy(policy_id, process_id, function (error, response, body) {//consume the result });`\r\n\r\n**List all servers attached to a monitoring policy:**\r\n\r\n`oneandone.listMonitoringPoliciesServers(policy_id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a server attached to a monitoring policy:**\r\n\r\n`oneandone.getServersMonitoringPolicy(policy_id, server_id, function (error, response, body) {//consume the result });`\r\n\r\n**Attach servers to a monitoring policy:**\r\n\r\n```\r\nvar serversData = {\r\n\t\"servers\": [\r\n\t\t\"server_id\"\r\n\t]\r\n};\r\n```\r\n```\r\noneandone.createMonitoringPolicyForServers(policy_id, serversData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Remove a server from a monitoring policy:**\r\n\r\n`oneandone.deleteServersMonitoringPolicy(policy_id, server_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n### Logs\r\n\r\n**List all logs:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n\r\n```oneandone.listLogsFixedPeriodWithOptions(oneandone.PeriodType.LAST_7D, options, function (error, response, body) {//consume the result });```\r\n\r\n`period` can be set to `\"LAST_HOUR\"`, `\"LAST_24H\"`, `\"LAST_7D\"`, `\"LAST_30D\"`, `\"LAST_365D\"`.\r\n\r\nAdditional query parameters can be used.\r\n\r\nTo paginate the list of logs received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of logs that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of logs sorted in expected order, pass a logs property (e.g. `\"action\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the logs instances that contain it.\r\n\r\nTo retrieve a collection of logs containing only the requested fields, pass a list of comma-separated properties (e.g. `\"id,action,type\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**List all logs for a custom period:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```oneandone.listLogsCustomPeriodWithOptions(start_date, end_date, options, function (error, response, body) {//consume the result });```\r\n\r\nAdditional query parameters can be used.\r\n\r\nTo paginate the list of logs received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of logs that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of logs sorted in expected order, pass a logs property (e.g. `\"action\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the logs instances that contain it.\r\n\r\nTo retrieve a collection of logs containing only the requested fields, pass a list of comma-separated properties (e.g. `\"id,action,type\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**Retrieve a single log:**\r\n\r\n`oneandone.getLog(log.id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n### Users\r\n\r\n**List all users:**\r\n\r\n`oneandone.listUsers(function (error, response, body) {//consume the result });`\r\n\r\n**List all users with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```\r\noneandone.listUsersWithOptions(options, function (error, response, body) {//consume the result });\r\n```\r\n\r\nTo paginate the list of users received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of users that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of users sorted in expected order, pass a user property (e.g. `\"name\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the user instances that contain it.\r\n\r\nTo retrieve a collection of users containing only the requested fields, pass a list of comma-separated properties (e.g. `\"id,name,creation_date,email\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**Retrieve information about a user:**\r\n\r\n`oneandone.getUser(user_id, function (error, response, body) {//consume the result });`\r\n\r\n**Create a user:**\r\n\r\n```\r\nvar userData = {\r\n    \"name\": \" node user\",\r\n    \"description\": \"User description\",\r\n    \"password\": \"test2015\",\r\n    \"email\": \"test@arsys.es\"\r\n};\r\n```\r\n```\r\noneandone.createUser(userData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n`Name` and `Password` are required parameters. The password must contain at least 8 characters using uppercase letters, numbers and other special symbols.\r\n\r\n**Modify a user:**\r\n\r\n```\r\nvar updateData = {\r\n\t\"name\": \"Manager role\",\r\n\t\"description\": \"Manager role description\",\r\n\t\"state\": \"ACTIVE\"\r\n};\r\n```\r\n```\r\noneandone.updateUser(user_id, updateData, function (error, response, body) {//consume the result });\r\n```\r\n\r\nAll listed fields in the request are optional. `State` can be set to `\"ACTIVE\"` or `\"DISABLED\"`.\r\n\r\n**Delete a user:**\r\n\r\n`oneandone.deleteUser(user_id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a user's API privileges:**\r\n\r\n`oneandone.getUserApiInformation(user_id, function (error, response, body) {//consume the result });\r\n\r\n**Retrieve a user's API key:**\r\n\r\n`oneandone.getUserApiKey(user_id, function (error, response, body) {//consume the result });`\r\n\r\n**List IP's from which API access is allowed for a user:**\r\n\r\n`oneandone.getUserApiAllowedIPs(user_id, function (error, response, body) {//consume the result });`\r\n\r\n**Add new IP's to a user:**\r\n\r\n```\r\nvar ipList = {\r\n\t\"ips\": [\r\n\t\t\"192.168.1.1\"\r\n\t]\r\n};\r\n```\r\n```\r\noneandone.addUserAPIAllowedIPs(user_id, ipList, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Remove an IP and forbid API access from it:**\r\n\r\n`oneandone.deleteUserAPIAllowedIPs(user_id, \"192.168.1.1\", function (error, response, body) {//consume the result });`\r\n\r\n**Modify a user's API privileges:**\r\n\r\n```\r\nvar updateApi = {\r\n\t\"active\": true\r\n};\r\n```\r\n```\r\noneandone.updateUserApiInformation(user.id, updateApi, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Renew a user's API key:**\r\n\r\n`oneandone.updateUserApiKey(user.id, function (error, response, body) {//consume the result });`\r\n\r\n### Roles\r\n\r\n**List all roles:**\r\n\r\n`oneandone.listRoles(function (error, response, body) {//consume the result });`\r\n\r\n**List all roles with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```\r\noneandone.listRolesWithOptions(options, function (error, response, body) {//consume the result });\r\n```\r\n\r\nTo paginate the list of roles received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of roles that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of roles sorted in expected order pass a role property (e.g. `\"name\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the role instances that contain it.\r\n\r\nTo retrieve a collection of roles containing only the requested fields pass a list of comma separated properties (e.g. `\"id,name,creation_date\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n**Retrieve information about a role:**\r\n\r\n`oneandone.getRole(role_id, function (error, response, body) {//consume the result });`\r\n\r\n**Create a role:**\r\n\r\n```\r\nvar roleData = {\r\n\t\"name\": \"node role\"\r\n};\r\n```\r\n```\r\noneandone.createRole(roleData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Clone a role:**\r\n\r\n```\r\nvar cloneRoleData = {\r\n\t\"name\": \"node role\"\r\n};\r\n```\r\n```\r\noneandone.cloneRole(role_id, cloneRoleData, function (error, response, body) {//consume the result });\r\n```\r\n\r\n**Modify a role:**\r\n\r\n```\r\nvar updateRole = {\r\n\t\"name\": \"node Manager role\",\r\n\t\"description\": \"Manager role description\",\r\n\t\"state\": \"ACTIVE\"\r\n};\r\n```\r\n```\r\noneandone.updateRole(role_id, updateRole, function (error, response, body) {//consume the result });\r\n```\r\n\r\n`ACTIVE` and `DISABLE` are valid values for the state.\r\n\r\n**Delete a role:**\r\n\r\n`oneandone.deleteRole(role_id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a role's permissions:**\r\n\r\n`oneandone.getRolePermissions(role_id, function (error, response, body) {//consume the result });`\r\n\r\n**Modify a role's permissions:**\r\n\r\n```\r\nvar updatePermissions = {\r\n\t\"servers\": {\r\n\t\t\"show\": true,\r\n\t\t\"create\": true,\r\n\t\t\"delete\": false,\r\n\t\t\"set_name\": true,\r\n\t\t\"set_description\": true,\r\n\t\t\"start\": true,\r\n\t\t\"restart\": true,\r\n\t\t\"shutdown\": true\r\n\t},\r\n\t\"images\": {\r\n\t\t\"show\": true,\r\n\t\t\"create\": true,\r\n\t\t\"delete\": false,\r\n\t\t\"set_name\": true,\r\n\t\t\"set_description\": true,\r\n\t\t\"disable_automatic_creation\": true\r\n\t}\r\n};\r\n```\r\n```\r\noneandone.updateRolePermissions(role_id, updatePermissions, function (error, response, body) {//consume the result });\r\n```\r\n\r\n\r\n**Assign users to a role:**\r\n\r\n```\r\nvar usersToAdd = {\r\n\t\"users\": [\r\n\t\tuser_id\r\n\t]\r\n};\r\n```\r\n\r\n`usersList` is a String List of user ID's.\r\n\r\n**List a role's users:**\r\n\r\n`oneandone.listRoleUsers(role_id, function (error, response, body) {//consume the result });`\r\n\r\n**Retrieve information about a role's user:**\r\n\r\n`oneandone.getRoleUser(role_id, user_id, function (error, response, body) {//consume the result });`\r\n\r\n**Remove a role's user:**\r\n\r\n`oneandone.removeRoleFromUser(role_id, user_id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n### Usages\r\n\r\n**List your usages with options:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n\r\n```oneandone.listUsagesFixedPeriodWithOptions(oneandone.PeriodType.LAST_30D, options, function (error, response, body) {//consume the result });```\r\n\r\n`period` can be set to `\"LAST_HOUR\"`, `\"LAST_24H\"`, `\"LAST_7D\"`, `\"LAST_30D\"`, `\"LAST_365D\"` .\r\n\r\n**List your usages for a custom period:**\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n\r\n```oneandone.listUsagesCustomPeriodWithOptions(start_date, end_date, null, function (error, response, body) {//consume the result });```\r\n\r\nTo paginate the list of usages received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of usages that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of usages sorted in expected order, pass a usages property (e.g. `\"name\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the usages instances that contain it.\r\n\r\nTo retrieve a collection of usages containing only the requested fields, pass a list of comma-separated properties (e.g. `\"id,name\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request.\r\n\r\n\r\n### Server Appliances\r\n\r\n**List all the appliances that you can use to create a server:**\r\n\r\n`oneandone.listServerAppliances(function (error, response, body) {//consume the result });`\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n\r\n```oneandone.listServerAppliancesWithOptions(options, function (error, response, body) {//consume the result });```\r\n\r\nTo paginate the list of server appliances received in the response use `page` and `per_page` parameters. Set `per_page` to the number of server appliances that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of server appliances sorted in expected order, pass a server appliance property (e.g. `\"os\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the server appliance instances that contain it.\r\n\r\nTo retrieve a collection of server appliances containing only the requested fields, pass a list of comma separated properties (e.g. `\"id,os,architecture\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is blank, it is ignored in the request.\r\n\r\n**Retrieve information about specific appliance:**\r\n\r\n`oneandone.getServerAppliance(appliance.id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n### Recovery Images\r\n\r\n**List all the recovery images that you can use to recovery reboot into a server:**\r\n\r\n`oneandone.listRecoveryImages(function (error, response, body) {//consume the result });`\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n\r\n```oneandone.listRecoveryImagesWithOptions(options, function (error, response, body) {//consume the result });```\r\n\r\nTo paginate the list of server appliances received in the response use `page` and `per_page` parameters. Set `per_page` to the number of server appliances that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of server appliances sorted in expected order, pass a server appliance property (e.g. `\"os\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the server appliance instances that contain it.\r\n\r\nTo retrieve a collection of server appliances containing only the requested fields, pass a list of comma separated properties (e.g. `\"id,os,architecture\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is blank, it is ignored in the request.\r\n\r\n**Retrieve information about specific recovery image:**\r\n\r\n`oneandone.getRecoveryImage(recovery_image.id, function (error, response, body) {//consume the result });`\r\n\r\n\r\n\r\n### DVD ISO\r\n\r\n**List all operative systems and tools that you can load into your virtual DVD unit:**\r\n\r\n`oneandone.listDvdIso(function (error, response, body) {//consume the result });`\r\n\r\n```\r\nvar options = {\r\n\tquery: \"node\",\t\r\n\tpage:1,\r\n\tperPage:1,\r\n\tsort:\"\"\r\n};\r\n```\r\n```\r\noneandone.listDvdIsoWithOptions(options, function (error, response, body) {//consume the result });\r\n```\r\n\r\nTo paginate the list of ISO DVDs received in the response use `page` and `per_page` parameters. Set `per_page` to the number of ISO DVDs that will be shown in each page. `page` indicates the current page. When set to an integer value that is less than or equal to zero, the parameters are ignored by the framework.\r\n\r\nTo receive the list of ISO DVDs sorted in expected order, pass a ISO DVD property (e.g. `\"type\"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order.\r\n\r\nUse `query` parameter to search for a string in the response and return only the ISO DVD instances that contain it.\r\n\r\nTo retrieve a collection of ISO DVDs containing only the requested fields, pass a list of comma-separated properties (e.g. `\"id,name,type\"`) in `fields` parameter.\r\n\r\nIf any of the parameters `sort`, `query` or `fields` is blank, it is ignored in the request.\r\n\r\n**Retrieve a specific ISO image:**\r\n\r\n`oneandone.getDvdIso(dvdIso.id, function (error, response, body) {//consume the result });`\r\n\r\n### Ping\r\n\r\n**Check if 1&amp;1 REST API is running:**\r\n\r\n`oneandone.pingApi(function (error, response, body) {//consume the result });`\r\n\r\nIf the API is running, the response is `PONG`.\r\n\r\n**Validate if 1&amp;1 REST API is running and the authorization token is valid:**\r\n\r\n`oneandone.pingApiAuthentication(function (error, response, body) {//consume the result });`\r\n\r\nThe response is `PONG`. if the API is running and the token is valid.\r\n\r\n\r\n### Pricing\r\n\r\n**Show prices for all available resources in the Cloud Panel:**\r\n\r\n`oneandone.getPricing(function (error, response, body) {//consume the result });`\r\n\r\n\r\n### Data Centers\r\n\r\n**List all 1&amp;1 Cloud Server data centers:**","_attachments":{},"homepage":"https://github.com/temp/temp#readme","license":"BSD"}