Class: Fog::Compute::Packet::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/compute/packet/compute.rb,
lib/fog/compute/packet/requests/get_ip.rb,
lib/fog/compute/packet/requests/get_vpn.rb,
lib/fog/compute/packet/requests/get_user.rb,
lib/fog/compute/packet/requests/list_ips.rb,
lib/fog/compute/packet/requests/assign_ip.rb,
lib/fog/compute/packet/requests/get_batch.rb,
lib/fog/compute/packet/requests/get_email.rb,
lib/fog/compute/packet/requests/bond_ports.rb,
lib/fog/compute/packet/requests/enable_vpn.rb,
lib/fog/compute/packet/requests/get_device.rb,
lib/fog/compute/packet/requests/get_volume.rb,
lib/fog/compute/packet/requests/list_plans.rb,
lib/fog/compute/packet/requests/list_users.rb,
lib/fog/compute/packet/requests/reserve_ip.rb,
lib/fog/compute/packet/requests/assign_port.rb,
lib/fog/compute/packet/requests/disable_vpn.rb,
lib/fog/compute/packet/requests/get_license.rb,
lib/fog/compute/packet/requests/get_project.rb,
lib/fog/compute/packet/requests/get_ssh_key.rb,
lib/fog/compute/packet/requests/list_events.rb,
lib/fog/compute/packet/requests/unassign_ip.rb,
lib/fog/compute/packet/requests/update_user.rb,
lib/fog/compute/packet/requests/create_batch.rb,
lib/fog/compute/packet/requests/create_email.rb,
lib/fog/compute/packet/requests/delete_email.rb,
lib/fog/compute/packet/requests/get_capacity.rb,
lib/fog/compute/packet/requests/list_batches.rb,
lib/fog/compute/packet/requests/list_devices.rb,
lib/fog/compute/packet/requests/list_volumes.rb,
lib/fog/compute/packet/requests/update_email.rb,
lib/fog/compute/packet/requests/verify_email.rb,
lib/fog/compute/packet/requests/attach_volume.rb,
lib/fog/compute/packet/requests/create_device.rb,
lib/fog/compute/packet/requests/create_volume.rb,
lib/fog/compute/packet/requests/delete_device.rb,
lib/fog/compute/packet/requests/delete_volume.rb,
lib/fog/compute/packet/requests/detach_volume.rb,
lib/fog/compute/packet/requests/disbond_ports.rb,
lib/fog/compute/packet/requests/get_bandwidth.rb,
lib/fog/compute/packet/requests/list_licenses.rb,
lib/fog/compute/packet/requests/list_projects.rb,
lib/fog/compute/packet/requests/list_sessions.rb,
lib/fog/compute/packet/requests/list_ssh_keys.rb,
lib/fog/compute/packet/requests/reboot_device.rb,
lib/fog/compute/packet/requests/session_login.rb,
lib/fog/compute/packet/requests/unassign_port.rb,
lib/fog/compute/packet/requests/update_device.rb,
lib/fog/compute/packet/requests/update_volume.rb,
lib/fog/compute/packet/requests/create_license.rb,
lib/fog/compute/packet/requests/create_project.rb,
lib/fog/compute/packet/requests/create_ssh_key.rb,
lib/fog/compute/packet/requests/delete_license.rb,
lib/fog/compute/packet/requests/delete_project.rb,
lib/fog/compute/packet/requests/delete_session.rb,
lib/fog/compute/packet/requests/delete_ssh_key.rb,
lib/fog/compute/packet/requests/get_invitation.rb,
lib/fog/compute/packet/requests/get_membership.rb,
lib/fog/compute/packet/requests/list_snapshots.rb,
lib/fog/compute/packet/requests/poweron_device.rb,
lib/fog/compute/packet/requests/update_license.rb,
lib/fog/compute/packet/requests/update_project.rb,
lib/fog/compute/packet/requests/update_ssh_key.rb,
lib/fog/compute/packet/requests/create_snapshot.rb,
lib/fog/compute/packet/requests/delete_snapshot.rb,
lib/fog/compute/packet/requests/get_bgp_session.rb,
lib/fog/compute/packet/requests/list_facilities.rb,
lib/fog/compute/packet/requests/poweroff_device.rb,
lib/fog/compute/packet/requests/get_notification.rb,
lib/fog/compute/packet/requests/get_organization.rb,
lib/fog/compute/packet/requests/list_invitations.rb,
lib/fog/compute/packet/requests/list_memberships.rb,
lib/fog/compute/packet/requests/transfer_project.rb,
lib/fog/compute/packet/requests/accept_invitation.rb,
lib/fog/compute/packet/requests/delete_membership.rb,
lib/fog/compute/packet/requests/list_bgp_sessions.rb,
lib/fog/compute/packet/requests/update_membership.rb,
lib/fog/compute/packet/requests/validate_capacity.rb,
lib/fog/compute/packet/requests/create_bgp_session.rb,
lib/fog/compute/packet/requests/decline_invitation.rb,
lib/fog/compute/packet/requests/delete_bgp_session.rb,
lib/fog/compute/packet/requests/get_payment_method.rb,
lib/fog/compute/packet/requests/list_notifications.rb,
lib/fog/compute/packet/requests/list_organizations.rb,
lib/fog/compute/packet/requests/create_organization.rb,
lib/fog/compute/packet/requests/delete_organization.rb,
lib/fog/compute/packet/requests/update_notification.rb,
lib/fog/compute/packet/requests/update_organization.rb,
lib/fog/compute/packet/requests/get_transfer_request.rb,
lib/fog/compute/packet/requests/list_payment_methods.rb,
lib/fog/compute/packet/requests/create_payment_method.rb,
lib/fog/compute/packet/requests/delete_payment_method.rb,
lib/fog/compute/packet/requests/list_spotmarketprices.rb,
lib/fog/compute/packet/requests/list_virtual_networks.rb,
lib/fog/compute/packet/requests/update_payment_method.rb,
lib/fog/compute/packet/requests/create_virtual_network.rb,
lib/fog/compute/packet/requests/delete_virtual_network.rb,
lib/fog/compute/packet/requests/enable_two_factor_auth.rb,
lib/fog/compute/packet/requests/list_operating_systems.rb,
lib/fog/compute/packet/requests/list_transfer_requests.rb,
lib/fog/compute/packet/requests/accept_transfer_request.rb,
lib/fog/compute/packet/requests/disable_two_factor_auth.rb,
lib/fog/compute/packet/requests/decline_transfer_request.rb,
lib/fog/compute/packet/requests/get_hardware_reservation.rb,
lib/fog/compute/packet/requests/move_hardware_reservation.rb,
lib/fog/compute/packet/requests/list_hardware_reservations.rb,
lib/fog/compute/packet/requests/request_email_verification.rb,
lib/fog/compute/packet/requests/list_spotmarketprices_history.rb

Overview

Mock

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



299
300
301
302
303
304
305
306
307
# File 'lib/fog/compute/packet/compute.rb', line 299

def initialize(options = {})
  if options[:packet_token]
    @packet_token = options[:packet_token]
  else
    @packet_token = ENV["PACKET_TOKEN"]
  end
  raise "Packet token is not present. Please pass it as an argument or set environment variable 'PACKET_TOKEN'." unless @packet_token
  @base_url = options[:packet_url] ? options[:packet_url] : "https://api.packet.net/"
end

Instance Method Details

#accept_invitation(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/compute/packet/requests/accept_invitation.rb', line 17

def accept_invitation(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "roles" => [
      "owner"
    ],
    "invitee" => "[email protected]",
    "nonce" => "NjxZAa3VYc3qvGhPejakYy4nKkt6S7Ay",
    "created_at" => "2018-04-10T21:13:24Z",
    "updated_at" => "2018-04-10T21:16:10Z",
    "invited_by" => {
      "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
    },
    "invitable" => {
      "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
    },
    "href" => "/invitations/02797cf6-c36c-474b-9558-37463f2aee26"
  }

  response
end

#accept_transfer_request(_id) ⇒ Object



17
18
19
20
21
22
# File 'lib/fog/compute/packet/requests/accept_transfer_request.rb', line 17

def accept_transfer_request(_id)
  response = Excon::Response.new
  response.status = 204

  response
end

#assign_ip(_volume_id, _device_id) ⇒ Object



24
25
26
27
28
# File 'lib/fog/compute/packet/requests/assign_ip.rb', line 24

def assign_ip(_volume_id, _device_id)
  response = Excon::Response.new
  response.status = 201
  response
end

#assign_port(_port_id, _vnid) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/assign_port.rb', line 17

def assign_port(_port_id, _vnid)
  response = Excon::Response.new
  response.status = 200
  response
end

#attach_volume(_volume_id, _device_id) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/fog/compute/packet/requests/attach_volume.rb', line 22

def attach_volume(_volume_id, _device_id)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "8e4bd895-fba3-4a59-b9f8-dd20fc6568d0",
    "created_at" => "2018-03-08T13:56:20Z",
    "volume" => {
      "href" => "/storage/3d1edaf3-2315-44ae-9591-6edcbbd0f731"
    },
    "device" => {
      "href" => "/devices/0877721e-d48b-418b-bab7-62e67de452c7"
    },
    "href" => "/storage/attachments/8e4bd895-fba3-4a59-b9f8-dd20fc6568d0"
  }
  response
end

#bond_ports(_port_id, _bulk_enable) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/bond_ports.rb', line 17

def bond_ports(_port_id, _bulk_enable)
  response = Excon::Response.new
  response.status = 200
  response
end

#create_batch(_project_id, _options) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/compute/packet/requests/create_batch.rb', line 18

def create_batch(_project_id, _options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "batches" => [
      {
        "id" => "54f09319-ce00-4715-8916-77faa64d4574",
        "quantity" => 1,
        "state" => "completed",
        "created_at" => "2018-04-03T11:47:52Z",
        "updated_at" => "2018-04-03T11:47:55Z",
        "devices" => [],
        "project" => {
          "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
        },
        "error_messages" => []
      }
    ]
  }

  response
end

#create_bgp_session(device_id, address_family) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fog/compute/packet/requests/create_bgp_session.rb', line 17

def create_bgp_session(device_id, address_family)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "ae312253-bae6-4de3-b522-411c2372e29e",
    "status" => "unknown",
    "learned_routes" => [],
    "switch_name" => "esr1.d12.ewr1.packet.net",
    "created_at" => "2018-04-05T21:06:08Z",
    "device" => {
      "href" => "/devices/" + device_id
    },
    "address_family" => address_family,
    "href" => "/bgp/sessions/ae312253-bae6-4de3-b522-411c2372e29e"
  }
  response
end

#create_device(_project_id, _options) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/fog/compute/packet/requests/create_device.rb', line 40

def create_device(_project_id, _options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "8f65b7eb-80a5-4df0-a87d-030d1b0d3b77",
    "short_id" => "8f65b7eb",
    "hostname" => "test01",
    "description" => nil,
    "state" => "provisioning",
    "tags" => [],
    "image_url" => nil,
    "billing_cycle" => "hourly",
    "user" => "core",
    "iqn" => "iqn.2018-03.net.packet:device.8f65b7eb",
    "locked" => false,
    "bonding_mode" => 5,
    "created_at" => "2018-03-07T14:13:27Z",
    "updated_at" => "2018-03-07T14:13:29.697Z",
    "ipxe_script_url" => nil,
    "always_pxe" => false,
    "storage" => nil,
    "provisioning_percentage" => 0.0,
    "operating_system" => {
      "id" => "d61c3912-8422-4daf-835e-854efa0062e4",
      "slug" => "coreos_stable",
      "name" => "Container Linux (CoreOS) - Stable",
      "distro" => "coreos",
      "version" => "stable",
      "provisionable_on" => [
        "m2.xlarge.x86"
      ],
      "default_cidr_size" => 31
    },
    "facility" => {
      "id" => "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
      "name" => "Parsippany, NJ",
      "code" => "ewr1",
      "features" =>
              [
                "baremetal"
              ],
      "address" => nil,
      "ip_ranges" => [
        "2604:1380::/36"
      ]
    },
    "project" =>
          {
            "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
          },
    "ssh_keys" => [
      {
        "href" => "/ssh-keys/38f2f61a-e0d7-4753-bebb-b580da2d43ac"
      },
      {
        "href" => "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
      },
      {
        "href" => "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
      },
      {
        "href" => "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
      },
      {
        "href" => "/ssh-keys/61905e3c-aa23-4ad3-922d-63cbd29060f9"
      },
      {
        "href" => "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
      }
    ],
    "project_lite" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "volumes" => [],
    "ip_addresses" => [],
    "plan" => {
      "id" => "e69c0169-4726-46ea-98f1-939c9e8a3607",
      "slug" => "baremetal_0",
      "name" => "Type 0",
      "description" => 'Our Type 0 configuration is a general use "cloud killer" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.',
      "line" => "baremetal",
      "specs" => {
        "cpus" => [
          {
            "count" => 1,
            "type" => "Intel Atom C2550 @ 2.4Ghz"
          }
        ],
        "memory" => {
          "total" => "8GB"
        },
        "drives" => [
          {
            "count" => 1,
            "size" => "80GB",
            "type" => "SSD"
          }
        ],
        "nics" => [
          {
            "count" => 2,
            "type" => "1Gbps"
          }
        ],
        "features" => {
          "raid" => false,
          "txt" => true
        }
      },
      "available_in" => [
        {
          "href" => "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
        },
        {
          "href" => "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
        },
        { "href" => "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975" },
        {
          "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
        }
      ], "pricing" => {
        "hour" => 0.07
      }
    },
    "userdata" => "",
    "switch_uuid" => "6ce8785a",
    "provisioning_events" => [
      {
        "id" => nil,
        "type" => "provisioning.101",
        "body" => "Provisioning started",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Provisioning started"
      },
      {
        "id" => nil,
        "type" => "provisioning.102",
        "body" => "Network configured",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Network configured"
      },
      "network_ports" => [
        {
          "id" => "8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e",
          "type" => "NetworkBondPort",
          "name" => "bond0",
          "data" => {
            "bonded" => true
          },
          "hardware" => {
            "href" => "/hardware/da6b785b-1b7d-4ed5-b61b-e09ec1bac16d"
          },
          "virtual_networks" => [],
          "connected_port" => nil,
          "href" => "/ports/8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e"
        }
      ], "href" => "/devices/8f65b7eb-80a5-4df0-a87d-030d1b0d3b77"
    ]
  }
  response
end

#create_email(options) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fog/compute/packet/requests/create_email.rb', line 23

def create_email(options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "1de4d14d-1c3e-4f33-b39a-2551af108f7e",
    "address" => options[:address],
    "default" => false,
    "href" => "/emails/1de4d14d-1c3e-4f33-b39a-2551af108f7e"
  }

  response
end

#create_license(_project_id, options) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/fog/compute/packet/requests/create_license.rb', line 25

def create_license(_project_id, options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "fd8c403f-c81d-4de7-ba5e-91362fc2d71c",
    "description" => options[:description],
    "license_key" => "2018-04-09T17:51:18Z",
    "licensee_product" => {
      "href" => "/"
    },
    "size" => options[:size],
    "project" => {
      "href" => "/"
    }
  }

  response
end

#create_organization(_options) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/fog/compute/packet/requests/create_organization.rb', line 29

def create_organization(_options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "a24136c3-38e8-46a9-b541-219b4d31bfb1",
    "name" => "test_org",
    "description" => "test organization",
    "website" => nil,
    "twitter" => nil,
    "created_at" => "2018-04-25T10:01:21Z",
    "updated_at" => "2018-04-25T10:01:21.134Z",
    "tax_id" => nil,
    "main_phone" => nil,
    "billing_phone" => nil,
    "credit_amount" => 0.0,
    "personal" => true,
    "customdata" => {},
    "address" => nil,
    "members" => [
      {
        "href" => "#2dce124f-3220-495c-907e-5bbbd4dda77c"
      }
    ],
    "owners" => [
      {
        "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
      }
    ],
    "memberships" => [
      {
        "href" => "/memberships/95780e18-ad65-4f0a-8895-0da65c371406"
      }
    ],
    "primary_owner" => {
      "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
    },
    "inbound_transfers" => [],
    "payment_methods" => [],
    "default_payment_method" => nil,
    "account_manager" => nil,
    "logo" => nil,
    "logo_thumb" => nil,
    "projects" => [],
    "plan" => "Bronze",
    "monthly_spend" => 0.0,
    "current_user_abilities" => {
      "admin" => true,
      "billing" => true,
      "collaborator" => true,
      "owner" => true
    },
    "href" => "/organizations/a24136c3-38e8-46a9-b541-219b4d31bfb1"
  }
  response
end

#create_payment_method(_org_id, _options) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/fog/compute/packet/requests/create_payment_method.rb', line 24

def create_payment_method(_org_id, _options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "7605f76e-17d4-4356-833c-91a273aba7f0",
    "name" => "John Doe",
    "type" => "credit_card",
    "default" => true,
    "created_at" => "2018-02-20T03:59:06Z",
    "updated_at" => "2018-02-20T03:59:13Z",
    "created_by_user" => {
      "href" => "/users/8f23cd1f-09e0-4539-9524-6387e4f8d44d"
    },
    "projects" => [
      {
        "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
      }
    ],
    "organization" => {
      "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
    },
    "card_type" => "American Express",
    "expiration_month" => "10",
    "expiration_year" => "2020",
    "last_4" => "1234",
    "cardholder_name" => "John Doe",
    "billing_address" => {
      "street_address" => nil,
      "postal_code" => "12345",
      "country_code_alpha2" => "US"
    },
    "href" => "/payment-methods/7605f76e-17d4-4356-833c-91a273aba7f0"
  }

  response
end

#create_project(options) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/fog/compute/packet/requests/create_project.rb', line 23

def create_project(options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "1140617d-262d-4502-a3d6-771d83c930da",
    "name" => options[:name],
    "created_at" => "2018-02-28T20:29:17Z",
    "updated_at" => "2018-03-06T11:19:30Z",
    "network_status" => {
      "sjc1" => "provisioned"
    },
    "max_devices" => {
      "baremetal_0" => 9999,
      "baremetal_1" => 9999
    },
    "organization" => {
      "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
    },
    "members" => [
      {
        "href" => "/users/1140617d-262d-4502-a3d6-771d83c930da"
      },
      {
        "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
      },
      {
        "href" => "/users/8f23cd1f-09e0-4539-9524-6387e4f8d44d"
      },
      {
        "href" => "/users/9532399b-4461-4c78-bbd9-d6250e2dc723"
      }
    ],
    "memberships" => [],
    "invitations" => [],
    "devices" => [],
    "ssh_keys" => [
      {
        "href" => "/ssh-keys/c2d63645-6051-4d19-92ab-0af335d3a1d5"
      }
    ],
    "transfers" => [],
    "volumes" => [],
    "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
  }
  response
end

#create_snapshot(_storage_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/create_snapshot.rb', line 17

def create_snapshot(_storage_id)
  response = Excon::Response.new
  response.status = 202
  response
end

#create_ssh_key(_options) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/fog/compute/packet/requests/create_ssh_key.rb', line 23

def create_ssh_key(_options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "7722a922-d66e-4afa-bf5e-a7aec8955016",
    "label" => "test",
    "key" => "ssh-rsa AAAAB3Nz",
    "fingerprint" => "0c:a9:79:a9:d7:29:49:5d:0e:43:41:bc:dc:4d:ac:78",
    "created_at" => "2018-03-27T10:46:33Z",
    "updated_at" => "2018-03-27T10:46:33Z",
    "owner" => {
      "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
    },
    "href" => "/ssh-keys/7722a922-d66e-4afa-bf5e-a7aec8955016"
  }

  response
end

#create_virtual_network(options) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fog/compute/packet/requests/create_virtual_network.rb', line 26

def create_virtual_network(options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "fce3b27f-dc07-4eb6-9aeb-de4381f045ae",
    "description" => options[:description],
    "vxlan" => 1026,
    "created_at" => "2018-03-12T21:49:27Z",
    "internet_gateway" => nil,
    "facility" => { "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09" },
    "instances" => [],
    "assigned_to" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "facility_code" => "ewr1",
    "href" => "/virtual-networks/fce3b27f-dc07-4eb6-9aeb-de4381f045ae"
  }

  response
end

#create_volume(_project_id, _options) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/fog/compute/packet/requests/create_volume.rb', line 28

def create_volume(_project_id, _options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "870f9650-19ea-48bd-84c5-ddf97471c1c1",
    "name" => "volume-870f9650",
    "description" => "test description",
    "size" => 20,
    "locked" => false,
    "billing_cycle" => "hourly",
    "state" => "active",
    "created_at" => "2018-03-08T12:49:30Z",
    "updated_at" => "2018-03-08T12:49:30.682Z",
    "access" => {},
    "project" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "facility" => {
      "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
    },
    "snapshot_policies" => [],
    "attachments" => [],
    "snapshots" => [],
    "plan" => {
      "id" => "87728148-3155-4992-a730-8d1e6aca8a32",
      "slug" => "storage_1",
      "name" => "Standard",
      "description" => "TBD",
      "line" => "storage",
      "specs" => {},
      "available_in" => [],
      "pricing" => {
        "hour" => 0.000104
      }
    },
    "href" => "/storage/870f9650-19ea-48bd-84c5-ddf97471c1c1"
  }
  response
end

#dataObject



309
310
311
# File 'lib/fog/compute/packet/compute.rb', line 309

def data
  self.class.data[@packet_token]
end

#decline_invitation(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/compute/packet/requests/decline_invitation.rb', line 17

def decline_invitation(id)
  response = Excon::Response.new
  response.status = 204
  response.body = {
    "id" => id,
    "roles" => [
      "owner"
    ],
    "invitee" => "[email protected]",
    "nonce" => "NjxZAa3VYc3qvGhPejakYy4nKkt6S7Ay",
    "created_at" => "2018-04-10T21:13:24Z",
    "updated_at" => "2018-04-10T21:16:10Z",
    "invited_by" => {
      "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
    },
    "invitable" => {
      "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
    },
    "href" => "/invitations/02797cf6-c36c-474b-9558-37463f2aee26"
  }

  response
end

#decline_transfer_request(_id) ⇒ Object



17
18
19
20
21
22
# File 'lib/fog/compute/packet/requests/decline_transfer_request.rb', line 17

def decline_transfer_request(_id)
  response = Excon::Response.new
  response.status = 204

  response
end

#delete_bgp_session(_session_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_bgp_session.rb', line 17

def delete_bgp_session(_session_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_device(_device_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_device.rb', line 17

def delete_device(_device_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_email(_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_email.rb', line 17

def delete_email(_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_license(_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_license.rb', line 17

def delete_license(_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_membership(_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_membership.rb', line 17

def delete_membership(_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_organization(_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_organization.rb', line 17

def delete_organization(_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_payment_method(_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_payment_method.rb', line 17

def delete_payment_method(_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_project(_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_project.rb', line 17

def delete_project(_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_session(_session_id = "") ⇒ Object



19
20
21
22
23
# File 'lib/fog/compute/packet/requests/delete_session.rb', line 19

def delete_session(_session_id = "")
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_snapshot(_storage_id, _snapshot_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_snapshot.rb', line 17

def delete_snapshot(_storage_id, _snapshot_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_ssh_key(_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_ssh_key.rb', line 17

def delete_ssh_key(_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_virtual_network(_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_virtual_network.rb', line 17

def delete_virtual_network(_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#delete_volume(_id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/delete_volume.rb', line 17

def delete_volume(_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#detach_volume(attachment_id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fog/compute/packet/requests/detach_volume.rb', line 17

def detach_volume(attachment_id)
  response = Excon::Response.new
  response.status = 204
  response.body = {
    "id" => attachment_id,
    "created_at" => "2018-03-08T13:56:20Z",
    "volume" => {
      "href" => "/storage/3d1edaf3-2315-44ae-9591-6edcbbd0f731"
    },
    "device" => {
      "href" => "/devices/0877721e-d48b-418b-bab7-62e67de452c7"
    },
    "href" => "/storage/attachments/8e4bd895-fba3-4a59-b9f8-dd20fc6568d0"
  }
  response
end

#disable_two_factor_auth(_type) ⇒ Object



19
20
21
22
23
# File 'lib/fog/compute/packet/requests/disable_two_factor_auth.rb', line 19

def disable_two_factor_auth(_type)
  response = Excon::Response.new
  response.status = 204
  response
end

#disable_vpnObject



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/disable_vpn.rb', line 17

def disable_vpn
  response = Excon::Response.new
  response.status = 204
  response
end

#disbond_ports(_port_id, _bulk_disable) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/disbond_ports.rb', line 17

def disbond_ports(_port_id, _bulk_disable)
  response = Excon::Response.new
  response.status = 200
  response
end

#enable_two_factor_auth(_type) ⇒ Object



18
19
20
21
22
# File 'lib/fog/compute/packet/requests/enable_two_factor_auth.rb', line 18

def enable_two_factor_auth(_type)
  response = Excon::Response.new
  response.status = 200
  response
end

#enable_vpnObject



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/enable_vpn.rb', line 17

def enable_vpn
  response = Excon::Response.new
  response.status = 201
  response
end

#get_bandwidth(_device_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/fog/compute/packet/requests/get_bandwidth.rb', line 18

def get_bandwidth(_device_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "bandwidth" => [{
      "datapoints" => []
    }]
  }
  response
end

#get_batch(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fog/compute/packet/requests/get_batch.rb', line 17

def get_batch(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "error_messages" => [],
    "quantity" => 1,
    "state" => "completed",
    "created_at" => "2018-04-03T11:47:52Z",
    "updated_at" => "2018-04-03T11:47:55Z",
    "devices" => [],
    "project" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    }
  }

  response
end

#get_bgp_session(session_id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fog/compute/packet/requests/get_bgp_session.rb', line 17

def get_bgp_session(session_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => session_id,
    "status" => "unknown",
    "learned_routes" => [],
    "switch_name" => "esr1.d12.ewr1.packet.net",
    "created_at" => "2018-04-05T21:06:08Z",
    "device" => {
      "href" => "/devices/"
    },
    "address_family" => "ipv4",
    "href" => "/bgp/sessions/ae312253-bae6-4de3-b522-411c2372e29e"
  }
  response
end

#get_capacityObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/fog/compute/packet/requests/get_capacity.rb', line 17

def get_capacity
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "capacity" => {
      "ams1" => {
        "baremetal_2a" => {
          "level" => "unavailable"
        },
        "baremetal_2a2" => {
          "level" => "unavailable"
        },
        "baremetal_1" => {
          "level" => "unavailable"
        },
        "baremetal_3" => {
          "level" => "limited"
        },
        "baremetal_2" => {
          "level" => "limited"
        },
        "baremetal_0" => {
          "level" => "normal"
        }
      },
      "atl1" => {
        "baremetal_1e" => {
          "level" => "normal"
        }
      },
      "dfw1" => {
        "baremetal_1e" => {
          "level" => "limited"
        }
      },
      "ewr1" => {
        "baremetal_2a" => {
          "level" => "limited"
        },
        "baremetal_2a2" => {
          "level" => "limited"
        },
        "baremetal_1" => {
          "level" => "normal"
        },
        "baremetal_3" => {
          "level" => "limited"
        },
        "baremetal_2" => {
          "level" => "limited"
        },
        "baremetal_s" => {
          "level" => "normal"
        },
        "baremetal_0" => {
          "level" => "normal"
        }
      },
      "fra1" => {
        "baremetal_1e" => {
          "level" => "limited"
        }
      },
      "hkg1" => {
        "baremetal_1e" => {
          "level" => "normal"
        }
      },
      "iad1" => {
        "baremetal_1e" => {
          "level" => "limited"
        }
      },
      "lax1" => {
        "baremetal_1e" => {
          "level" => "limited"
        }
      },
      "nrt1" => {
        "baremetal_2a" => {
          "level" => "limited"
        },
        "baremetal_2a2" => {
          "level" => "unavailable"
        },
        "baremetal_1" => {
          "level" => "limited"
        },
        "baremetal_2" => {
          "level" => "limited"
        },
        "baremetal_0" => {
          "level" => "normal"
        }
      },
      "ord1" => {
        "baremetal_1e" => {
          "level" => "normal"
        }
      },
      "sea1" => {
        "baremetal_1e" => {
          "level" => "normal"
        }
      },
      "sin1" => {
        "baremetal_1e" => {
          "level" => "limited"
        }
      },
      "sjc1" => {
        "baremetal_2a" => {
          "level" => "limited"
        },
        "baremetal_2a2" => {
          "level" => "unavailable"
        },
        "baremetal_1" => {
          "level" => "normal"
        },
        "baremetal_3" => {
          "level" => "limited"
        },
        "baremetal_2" => {
          "level" => "limited"
        },
        "baremetal_0" => {
          "level" => "normal"
        }
      },
      "syd1" => {
        "baremetal_1e" => {
          "level" => "limited"
        }
      },
      "yyz1" => {
        "baremetal_1e" => {
          "level" => "limited"
        }
      }
    }
  }

  response
end

#get_device(device_id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/fog/compute/packet/requests/get_device.rb', line 17

def get_device(device_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => device_id,
    "short_id" => "8f65b7eb",
    "hostname" => "test01",
    "description" => nil,
    "state" => "active",
    "tags" => [],
    "image_url" => nil,
    "billing_cycle" => "hourly",
    "user" => "core",
    "iqn" => "iqn.2018-03.net.packet:device.8f65b7eb",
    "locked" => false,
    "bonding_mode" => 5,
    "created_at" => "2018-03-07T14:13:27Z",
    "updated_at" => "2018-03-07T14:13:29.697Z",
    "ipxe_script_url" => nil,
    "always_pxe" => false,
    "storage" => nil,
    "provisioning_percentage" => 0.0,
    "operating_system" => {
      "id" => "d61c3912-8422-4daf-835e-854efa0062e4",
      "slug" => "coreos_stable",
      "name" => "Container Linux (CoreOS) - Stable",
      "distro" => "coreos",
      "version" => "stable",
      "provisionable_on" => [
        "m2.xlarge.x86"
      ],
      "default_cidr_size" => 31
    },
    "facility" => {
      "id" => "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
      "name" => "Parsippany, NJ",
      "code" => "ewr1",
      "features" =>
              [
                "baremetal"
              ],
      "address" => nil,
      "ip_ranges" => [
        "2604:1380::/36"
      ]
    },
    "project" =>
          {
            "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
          },
    "ssh_keys" => [
      {
        "href" => "/ssh-keys/38f2f61a-e0d7-4753-bebb-b580da2d43ac"
      },
      {
        "href" => "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
      },
      {
        "href" => "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
      },
      {
        "href" => "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
      },
      {
        "href" => "/ssh-keys/61905e3c-aa23-4ad3-922d-63cbd29060f9"
      },
      {
        "href" => "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
      }
    ],
    "project_lite" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "volumes" => [],
    "ip_addresses" => [],
    "plan" => {
      "id" => "e69c0169-4726-46ea-98f1-939c9e8a3607",
      "slug" => "baremetal_0",
      "name" => "Type 0",
      "description" => 'Our Type 0 configuration is a general use "cloud killer" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.',
      "line" => "baremetal",
      "specs" => {
        "cpus" => [
          {
            "count" => 1,
            "type" => "Intel Atom C2550 @ 2.4Ghz"
          }
        ],
        "memory" => {
          "total" => "8GB"
        },
        "drives" => [
          {
            "count" => 1,
            "size" => "80GB",
            "type" => "SSD"
          }
        ],
        "nics" => [
          {
            "count" => 2,
            "type" => "1Gbps"
          }
        ],
        "features" => {
          "raid" => false,
          "txt" => true
        }
      },
      "available_in" => [
        {
          "href" => "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
        },
        {
          "href" => "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
        },
        { "href" => "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975" },
        {
          "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
        }
      ], "pricing" => {
        "hour" => 0.07
      }
    },
    "userdata" => "",
    "switch_uuid" => "6ce8785a",
    "provisioning_events" => [
      {
        "id" => nil,
        "type" => "provisioning.101",
        "body" => "Provisioning started",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Provisioning started"
      },
      {
        "id" => nil,
        "type" => "provisioning.102",
        "body" => "Network configured",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Network configured"
      },
      "network_ports" => [
        {
          "id" => "8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e",
          "type" => "NetworkBondPort",
          "name" => "eth1",
          "data" => {
            "bonded" => true
          },
          "hardware" => {
            "href" => "/hardware/da6b785b-1b7d-4ed5-b61b-e09ec1bac16d"
          },
          "virtual_networks" => [],
          "connected_port" => nil,
          "href" => "/ports/8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e"
        }
      ], "href" => "/devices/8f65b7eb-80a5-4df0-a87d-030d1b0d3b77"
    ]
  }
  response
end

#get_email(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fog/compute/packet/requests/get_email.rb', line 17

def get_email(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "address" => "[email protected]",
    "default" => false,
    "href" => "/emails/1de4d14d-1c3e-4f33-b39a-2551af108f7e"
  }

  response
end

#get_hardware_reservation(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/fog/compute/packet/requests/get_hardware_reservation.rb', line 17

def get_hardware_reservation(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "short_id" => "string",
    "facility" => {
      "id" => "string",
      "name" => "string",
      "code" => "string",
      "features" => [
        "string"
      ],
      "address" => {
        "$ref" => "#\/definitions\/Address"
      }
    },
    "plan" => {
      "id" => "string",
      "slug" => "string",
      "name" => "string",
      "description" => "string",
      "line" => "string",
      "specs" => "object",
      "pricing" => "object",
      "legacy" => "boolean",
      "class" => "string",
      "available_in" => [
        {
          "href" => "string"
        }
      ]
    },
    "href" => "string",
    "project" => {
      "id" => "string",
      "name" => "string",
      "created_at" => "string",
      "updated_at" => "string",
      "max_devices" => "object",
      "members" => [
        {
          "href" => "string"
        }
      ],
      "memberships" => [
        {
          "href" => "string"
        }
      ],
      "network_status" => "object",
      "invitations" => [
        {
          "href" => "string"
        }
      ],
      "payment_method" => {
        "$ref" => "#\/definitions\/Href"
      },
      "devices" => [
        {
          "href" => "string"
        }
      ],
      "ssh_keys" => [
        {
          "href" => "string"
        }
      ],
      "volumes" => [
        {
          "href" => "string"
        }
      ],
      "bgp_config" => {
        "$ref" => "#\/definitions\/Href"
      },
      "customdata" => "string"
    },
    "device" => {
      "id" => "string",
      "short_id" => "string",
      "hostname" => "string",
      "description" => "string",
      "state" => "string",
      "tags" => [
        "string"
      ],
      "image_url" => "string",
      "billing_cycle" => "string",
      "user" => "string",
      "iqn" => "string",
      "locked" => "boolean",
      "bonding_mode" => "integer",
      "created_at" => "string",
      "updated_at" => "string",
      "spot_instance" => "boolean",
      "spot_price_max" => "number",
      "termination_time" => "string",
      "customdata" => "string",
      "provisioning_percentage" => "number",
      "operating_system" => {
        "$ref" => "#\/definitions\/OperatingSystem"
      },
      "always_pxe" => "boolean",
      "ipxe_script_url" => "string",
      "location" => {
        "$ref" => "#\/definitions\/HardwareLocation"
      },
      "facility" => {
        "$ref" => "#\/definitions\/Facility"
      },
      "plan" => {
        "$ref" => "#\/definitions\/Plan"
      },
      "userdata" => "string",
      "root_password" => "string",
      "href" => "string",
      "project" => {
        "$ref" => "#\/definitions\/Href",
        "description" => "Full version of project object when included"
      },
      "project_lite" => {
        "$ref" => "#\/definitions\/Href",
        "description" => "Lite version of project object when included"
      },
      "volumes" => [
        {
          "href" => "string"
        }
      ],
      "hardware_reservation" => {
        "$ref" => "#\/definitions\/Href"
      },
      "ssh_keys" => [
        {
          "href" => "string"
        }
      ],
      "ip_addresses" => [
        {
          "id" => "string",
          "address_family" => "integer",
          "netmask" => "string",
          "public" => "boolean",
          "enabled" => "boolean",
          "cidr" => "integer",
          "management" => "boolean",
          "manageable" => "boolean",
          "network" => "string",
          "address" => "string",
          "gateway" => "string",
          "href" => "string",
          "created_at" => "string"
        }
      ],
      "provisioning_events" => [
        {
          "id" => "string",
          "state" => "string",
          "type" => "string",
          "body" => "string",
          "relationships" => "array",
          "interpolated" => "string",
          "created_at" => "string",
          "href" => "string"
        }
      ]
    },
    "created_at" => "string"
  }
  response
end

#get_invitation(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/compute/packet/requests/get_invitation.rb', line 17

def get_invitation(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "roles" => [
      "owner"
    ],
    "invitee" => "[email protected]",
    "nonce" => "NjxZAa3VYc3qvGhPejakYy4nKkt6S7Ay",
    "created_at" => "2018-04-10T21:13:24Z",
    "updated_at" => "2018-04-10T21:16:10Z",
    "invited_by" => {
      "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
    },
    "invitable" => {
      "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
    },
    "href" => "/invitations/02797cf6-c36c-474b-9558-37463f2aee26"
  }

  response
end

#get_ip(ip_id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/fog/compute/packet/requests/get_ip.rb', line 17

def get_ip(ip_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => ip_id,
    "address_family" => 6,
    "netmask" => "ffff:ffff:ffff:ff00:0000:0000:0000:0000",
    "created_at" => "2018-03-06T12:36:06Z",
    "public" => true,
    "cidr" => 56,
    "management" => false,
    "manageable" => true,
    "enabled" => true,
    "addon" => false,
    "bill" => false,
    "project" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "project_lite" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "assignments" => [],
    "facility" => {
      "id" => "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
      "name" => "Parsippany, NJ",
      "code" => "ewr1",
      "features" => %w[baremetal storage backend_transfers layer_2],
      "address" => nil,
      "ip_ranges" => [
        "2604:1380::/36"
      ]
    },
    "network" => "2604:1380:0:8900::",
    "address" => "2604:1380:0:8900::2",
    "gateway" => "2604:1380:0:8900::1",
    "available" => "/ips/11efb411-c76b-47d8-ba75-20a51c6b0505/available",
    "href" => "/ips/11efb411-c76b-47d8-ba75-20a51c6b0505"
  }
  response
end

#get_license(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fog/compute/packet/requests/get_license.rb', line 17

def get_license(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "description" => "thVsYD9FceLTdJdsrfjtLZGZPckx9Enh",
    "license_key" => "2018-04-09T17:51:18Z",
    "licensee_product" => {
      "href" => "/"
    },
    "size" => "2018-04-06T17:51:18Z",
    "project" => {
      "href" => "/"
    }
  }
  response
end

#get_membership(_id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fog/compute/packet/requests/get_membership.rb', line 17

def get_membership(_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => "string",
    "roles" => [
      "string"
    ],
    "created_at" => "string",
    "updated_at" => "string",
    "project" => {
      "href" => "string"
    },
    "user" => {
      "href" => "string"
    },
    "href" => "string"
  }
  response
end

#get_notification(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fog/compute/packet/requests/get_notification.rb', line 17

def get_notification(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "type" => "string",
    "body" => "string",
    "severity" => "string",
    "read" => false,
    "context" => "string",
    "created_at" => "string",
    "updated_at" => "string",
    "user" => {
      "href" => "string"
    },
    "href" => "string"
  }

  response
end

#get_organization(id, _include = "") ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/fog/compute/packet/requests/get_organization.rb', line 18

def get_organization(id, _include = "")
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "name" => "Packet Integration Testing",
    "description" => nil,
    "website" => nil,
    "twitter" => nil,
    "created_at" => "2018-02-20T03:56:01Z",
    "updated_at" => "2018-04-24T10:46:37Z",
    "tax_id" => nil,
    "main_phone" => nil,
    "billing_phone" => nil,
    "credit_amount" => 0,
    "personal" => true,
    "customdata" => {},
    "address" => nil,
    "account_manager" => {
      "href" => "/users/8f23cd1f-09e0-4539-9524-6387e4f8d44d"
    },
    "logo" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1/logos/original?1519098961",
    "logo_thumb" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1/logos/thumb?1519098961",
    "projects" => [
      {
        "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
      }
    ],
    "plan" => "Staff",
    "monthly_spend" => 0,
    "current_user_abilities" => {
      "admin" => true,
      "billing" => true,
      "collaborator" => true,
      "owner" => false
    },
    "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
  }
  response
end

#get_payment_method(id, _include = "") ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fog/compute/packet/requests/get_payment_method.rb', line 18

def get_payment_method(id, _include = "")
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "name" => "John Doe",
    "type" => "credit_card",
    "default" => true,
    "created_at" => "2018-02-20T03:59:06Z",
    "updated_at" => "2018-02-20T03:59:13Z",
    "created_by_user" => {
      "href" => "/users/8f23cd1f-09e0-4539-9524-6387e4f8d44d"
    },
    "projects" => [
      {
        "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
      }
    ],
    "organization" => {
      "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
    },
    "card_type" => "American Express",
    "expiration_month" => "10",
    "expiration_year" => "2020",
    "last_4" => "1234",
    "cardholder_name" => "John Doe",
    "billing_address" => {
      "street_address" => nil,
      "postal_code" => "12345",
      "country_code_alpha2" => "US"
    },
    "href" => "/payment-methods/7605f76e-17d4-4356-833c-91a273aba7f0"
  }
  response
end

#get_project(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/fog/compute/packet/requests/get_project.rb', line 17

def get_project(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "name" => "spc-fran-test",
    "created_at" => "2018-02-28T20:29:17Z",
    "updated_at" => "2018-03-06T11:19:30Z",
    "network_status" => {
      "sjc1" => "provisioned"
    },
    "max_devices" => {
      "baremetal_0" => 9999,
      "baremetal_1" => 9999
    },
    "organization" => {
      "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
    },
    "members" => [
      {
        "href" => "/users/1140617d-262d-4502-a3d6-771d83c930da"
      },
      {
        "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
      },
      {
        "href" => "/users/8f23cd1f-09e0-4539-9524-6387e4f8d44d"
      },
      {
        "href" => "/users/9532399b-4461-4c78-bbd9-d6250e2dc723"
      }
    ],
    "memberships" => [],
    "invitations" => [],
    "devices" => [],
    "ssh_keys" => [
      {
        "href" => "/ssh-keys/c2d63645-6051-4d19-92ab-0af335d3a1d5"
      }
    ],
    "transfers" => [],
    "volumes" => [],
    "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
  }

  response
end

#get_ssh_key(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fog/compute/packet/requests/get_ssh_key.rb', line 17

def get_ssh_key(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "label" => "test_jg",
    "key" => "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDgnV5MOhBqpQLt66KGlMKi",
    "fingerprint" => "0c:a9:79:a9:d7:29:49:5d:0e:43:41:bc:dc:4d:ac:78",
    "created_at" => "2018-03-27T10:46:33Z",
    "updated_at" => "2018-03-27T10:46:33Z",
    "owner" => {
      "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
    },
    "href" => "/ssh-keys/7722a922-d66e-4afa-bf5e-a7aec8955016"
  }

  response
end

#get_transfer_request(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fog/compute/packet/requests/get_transfer_request.rb', line 17

def get_transfer_request(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "created_at" => "string",
    "updated_at" => "string",
    "target_organization" => {
      "href" => "string"
    },
    "project" => {
      "href" => "string"
    },
    "href" => "string"
  }

  response
end

#get_user(_id = "") ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fog/compute/packet/requests/get_user.rb', line 17

def get_user(_id = "")
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => "2dce124f-3220-495c-907e-5bbbd4dda77c",
    "short_id" => "2dce124f",
    "first_name" => "Jane",
    "last_name" => "Doe",
    "full_name" => "Jane Doe",
    "email" => "[email protected]",
    "social_accounts" => {
      "linkedin" => "https://example.net"
    },
    "created_at" => "2018-02-20T19:55:57Z",
    "updated_at" => "2018-03-28T11:32:25Z",
    "default_organization_id" => "602c17ec-f996-4d94-a6a8-20d6356e6c2a",
    "avatar_url" => "https://www.gravatar.com/avatar/0bf989eabc6c8c214e11072b7500e4b2?d=mm",
    "avatar_thumb_url" => "https://www.gravatar.com/avatar/0bf989eabc6c8c214e11072b7500e4b2?d=mm",
    "timezone" => "America/New_York",
    "verification_stage" => "verified",
    "two_factor_auth" => "",
    "max_projects" => 2,
    "vpn" => false,
    "last_login_at" => "2018-03-28T11:36:34Z",
    "emails" => [
      {
        "href" => "/emails/973a189d-5dda-4b69-a038-526472a1b6d4"
      }
    ],
    "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c",
    "phone_number" => "+123456789012",
    "restricted" => false
  }

  response
end

#get_volume(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/fog/compute/packet/requests/get_volume.rb', line 17

def get_volume(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "name" => "volume-870f9650",
    "description" => "test description",
    "size" => 20,
    "locked" => false,
    "billing_cycle" => "hourly",
    "state" => "active",
    "created_at" => "2018-03-08T12:49:30Z",
    "updated_at" => "2018-03-08T12:49:30.682Z",
    "access" => {},
    "project" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "facility" => {
      "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
    },
    "snapshot_policies" => [],
    "attachments" => [],
    "snapshots" => [],
    "plan" => {
      "id" => "87728148-3155-4992-a730-8d1e6aca8a32",
      "slug" => "storage_1",
      "name" => "Standard",
      "description" => "TBD",
      "line" => "storage",
      "specs" => {},
      "available_in" => [],
      "pricing" => {
        "hour" => 0.000104
      }
    },
    "href" => "/storage/870f9650-19ea-48bd-84c5-ddf97471c1c1"
  }

  response
end

#get_vpn(_id) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/fog/compute/packet/requests/get_vpn.rb', line 17

def get_vpn(_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "config" => "client\nserver-poll-timeout"
  }

  response
end

#list_batches(_project_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fog/compute/packet/requests/list_batches.rb', line 18

def list_batches(_project_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "batches" => [
      {
      }
    ]
  }

  response
end

#list_bgp_sessions(_device_id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fog/compute/packet/requests/list_bgp_sessions.rb', line 17

def list_bgp_sessions(_device_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "bgp_sessions" => [
      {
      }
    ]
  }

  response
end

#list_devices(_project_id, params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fog/compute/packet/requests/list_devices.rb', line 18

def list_devices(_project_id, params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "devices" => [
      {
      }
    ]
  }

  response
end

#list_events(_device_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fog/compute/packet/requests/list_events.rb', line 18

def list_events(_device_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "events" => [
      {
      }
    ]
  }

  response
end

#list_facilitiesObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fog/compute/packet/requests/list_facilities.rb', line 25

def list_facilities
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "facilities" => [
      {
        "id" => "fd8c403f-c81d-4de7-ba5e-91362fc2d71c",
        "name" => "Singapore",
        "code" => "sin1",
        "features" => %w[baremetal layer_2],
        "address" => {
          "href" => "#75006fc8-b6f4-4dd5-a89f-262b9a18e6cd"
        },
        "ip_ranges" => []
      }, {
        "id" => "14a4cad8-6f81-41b6-8cba-aaf8322910af",
        "name" => "Atlanta, GA",
        "code" => "atl1",
        "features" => %w[baremetal layer_2],
        "address" => {
          "href" => "#efe47e28-626d-4fa6-b8be-786d16e91b59"
        },
        "ip_ranges" => []
      }
    ]
  }

  response
end

#list_hardware_reservations(_project_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/fog/compute/packet/requests/list_hardware_reservations.rb', line 18

def list_hardware_reservations(_project_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "hardware_reservations" => [
      {
        "id" => "string",
        "short_id" => "string",
        "facility" => {
          "id" => "string",
          "name" => "string",
          "code" => "string",
          "features" => [
            "string"
          ],
          "address" => {
            "$ref" => "#\/definitions\/Address"
          }
        },
        "plan" => {
          "id" => "string",
          "slug" => "string",
          "name" => "string",
          "description" => "string",
          "line" => "string",
          "specs" => "object",
          "pricing" => "object",
          "legacy" => "boolean",
          "class" => "string",
          "available_in" => [
            {
              "href" => "string"
            }
          ]
        },
        "href" => "string",
        "project" => {
          "id" => "string",
          "name" => "string",
          "created_at" => "string",
          "updated_at" => "string",
          "max_devices" => "object",
          "members" => [
            {
              "href" => "string"
            }
          ],
          "memberships" => [
            {
              "href" => "string"
            }
          ],
          "network_status" => "object",
          "invitations" => [
            {
              "href" => "string"
            }
          ],
          "payment_method" => {
            "$ref" => "#\/definitions\/Href"
          },
          "devices" => [
            {
              "href" => "string"
            }
          ],
          "ssh_keys" => [
            {
              "href" => "string"
            }
          ],
          "volumes" => [
            {
              "href" => "string"
            }
          ],
          "bgp_config" => {
            "$ref" => "#\/definitions\/Href"
          },
          "customdata" => "string"
        },
        "device" => {
          "id" => "string",
          "short_id" => "string",
          "hostname" => "string",
          "description" => "string",
          "state" => "string",
          "tags" => [
            "string"
          ],
          "image_url" => "string",
          "billing_cycle" => "string",
          "user" => "string",
          "iqn" => "string",
          "locked" => "boolean",
          "bonding_mode" => "integer",
          "created_at" => "string",
          "updated_at" => "string",
          "spot_instance" => "boolean",
          "spot_price_max" => "number",
          "termination_time" => "string",
          "customdata" => "string",
          "provisioning_percentage" => "number",
          "operating_system" => {
            "$ref" => "#\/definitions\/OperatingSystem"
          },
          "always_pxe" => "boolean",
          "ipxe_script_url" => "string",
          "location" => {
            "$ref" => "#\/definitions\/HardwareLocation"
          },
          "facility" => {
            "$ref" => "#\/definitions\/Facility"
          },
          "plan" => {
            "$ref" => "#\/definitions\/Plan"
          },
          "userdata" => "string",
          "root_password" => "string",
          "href" => "string",
          "project" => {
            "$ref" => "#\/definitions\/Href",
            "description" => "Full version of project object when included"
          },
          "project_lite" => {
            "$ref" => "#\/definitions\/Href",
            "description" => "Lite version of project object when included"
          },
          "volumes" => [
            {
              "href" => "string"
            }
          ],
          "hardware_reservation" => {
            "$ref" => "#\/definitions\/Href"
          },
          "ssh_keys" => [
            {
              "href" => "string"
            }
          ],
          "ip_addresses" => [
            {
              "id" => "string",
              "address_family" => "integer",
              "netmask" => "string",
              "public" => "boolean",
              "enabled" => "boolean",
              "cidr" => "integer",
              "management" => "boolean",
              "manageable" => "boolean",
              "network" => "string",
              "address" => "string",
              "gateway" => "string",
              "href" => "string",
              "created_at" => "string"
            }
          ],
          "provisioning_events" => [
            {
              "id" => "string",
              "state" => "string",
              "type" => "string",
              "body" => "string",
              "relationships" => "array",
              "interpolated" => "string",
              "created_at" => "string",
              "href" => "string"
            }
          ]
        },
        "created_at" => "string"
      }
    ],
    "meta" => {
      "first" => {
        "href" => "string"
      },
      "previous" => {
        "href" => "string"
      },
      "self" => {
        "href" => "string"
      },
      "next" => {
        "href" => "string"
      },
      "last" => {
        "href" => "string"
      },
      "total" => "integer"
    }
  }
  response
end

#list_invitations(_device_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/fog/compute/packet/requests/list_invitations.rb', line 18

def list_invitations(_device_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "invitations" => [
      {
        "id" => "02797cf6-c36c-474b-9558-37463f2aee26",
        "roles" => [
          "owner"
        ],
        "invitee" => "[email protected]",
        "nonce" => "NjxZAa3VYc3qvGhPejakYy4nKkt6S7Ay",
        "created_at" => "2018-04-10T21:13:24Z",
        "updated_at" => "2018-04-10T21:16:10Z",
        "invited_by" => {
          "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
        },
        "invitable" => {
          "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
        },
        "href" => "/invitations/02797cf6-c36c-474b-9558-37463f2aee26"
      }
    ]
  }

  response
end

#list_ips(_project_id, _include = "") ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/fog/compute/packet/requests/list_ips.rb', line 18

def list_ips(_project_id, _include = "")
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "ip_addresses" => [
      {
        "id" => "11efb411-c76b-47d8-ba75-20a51c6b0505",
        "address_family" => 6,
        "netmask" => "ffff:ffff:ffff:ff00:0000:0000:0000:0000",
        "created_at" => "2018-03-06T12:36:06Z",
        "public" => true,
        "cidr" => 56,
        "management" => false,
        "manageable" => true,
        "enabled" => true,
        "addon" => false,
        "bill" => false,
        "project" => {
          "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
        },
        "project_lite" => {
          "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
        },
        "assignments" => [],
        "facility" => {
          "id" => "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
          "name" => "Parsippany, NJ",
          "code" => "ewr1",
          "features" => %w[baremetal storage backend_transfers layer_2],
          "address" => nil,
          "ip_ranges" => [
            "2604:1380::/36"
          ]
        },
        "network" => "2604:1380:0:8900::",
        "address" => "2604:1380:0:8900::2",
        "gateway" => "2604:1380:0:8900::1",
        "available" => "/ips/11efb411-c76b-47d8-ba75-20a51c6b0505/available",
        "href" => "/ips/11efb411-c76b-47d8-ba75-20a51c6b0505"
      }
    ]
  }
  response
end

#list_licenses(_project_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fog/compute/packet/requests/list_licenses.rb', line 18

def list_licenses(_project_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "licenses" => [
      {
        "id" => "fd8c403f-c81d-4de7-ba5e-91362fc2d71c",
        "description" => "thVsYD9FceLTdJdsrfjtLZGZPckx9Enh",
        "license_key" => "2018-04-09T17:51:18Z",
        "licensee_product" => {
          "href" => "/"
        },
        "size" => "2018-04-06T17:51:18Z",
        "project" => {
          "href" => "/"
        }
      }
    ]
  }
  response
end

#list_memberships(_project_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/fog/compute/packet/requests/list_memberships.rb', line 18

def list_memberships(_project_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "memberships" => [
      {
        "id" => "string",
        "roles" => [
          "string"
        ],
        "created_at" => "string",
        "updated_at" => "string",
        "project" => {
          "href" => "string"
        },
        "user" => {
          "href" => "string"
        },
        "href" => "string"
      }
    ]
  }
  response
end

#list_notifications(_params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/fog/compute/packet/requests/list_notifications.rb', line 18

def list_notifications(_params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "notifications" => [
      {
        "id" => "string",
        "type" => "string",
        "body" => "string",
        "severity" => "string",
        "read" => "boolean",
        "context" => "string",
        "created_at" => "string",
        "updated_at" => "string",
        "user" => {
          "href" => "string"
        },
        "href" => "string"
      }
    ]
  }

  response
end

#list_operating_systemsObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/fog/compute/packet/requests/list_operating_systems.rb', line 17

def list_operating_systems
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "operating_systems" => [
      {
        "id" => "06e21644-a769-11e6-80f5-76304dec7eb7",
        "slug" => "alpine_3",
        "name" => "Alpine 3",
        "distro" => "alpine",
        "version" => "3",
        "provisionable_on" => [],
        "default_cidr_size" => 31
      },
      {
        "id" => "06e21978-a769-11e6-80f5-76304dec7eb7",
        "slug" => "centos_6",
        "name" => "CentOS 6",
        "distro" => "centos",
        "version" => "6",
        "provisionable_on" => [],
        "default_cidr_size" => 31
      },
      {
        "id" => "68bad60d-f5a7-45c2-ad09-573edaad3a3c",
        "slug" => "centos_7",
        "name" => "CentOS 7",
        "distro" => "centos",
        "version" => "7",
        "provisionable_on" => [
          "c2.medium.x86",
          "m2.xlarge.x86",
          "baremetal_0",
          "baremetal_1",
          "baremetal_1e",
          "baremetal_2",
          "baremetal_2a",
          "baremetal_3",
          "baremetal_s"
        ],
        "default_cidr_size" => 31
      }
    ]
  }
  response
end

#list_organizations(_params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/fog/compute/packet/requests/list_organizations.rb', line 18

def list_organizations(_params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "organizations" => [
      {
        "id" => "6c17df6c-8769-4d98-b01f-f2848b6489a1",
        "name" => "Packet Integration Testing",
        "description" => nil,
        "website" => nil,
        "twitter" => nil,
        "created_at" => "2018-02-20T03:56:01Z",
        "updated_at" => "2018-04-24T10:46:37Z",
        "tax_id" => nil,
        "main_phone" => nil,
        "billing_phone" => nil,
        "credit_amount" => 0,
        "personal" => true,
        "customdata" => {},
        "address" => nil,
        "account_manager" => {
          "href" => "/users/8f23cd1f-09e0-4539-9524-6387e4f8d44d"
        },
        "logo" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1/logos/original?1519098961",
        "logo_thumb" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1/logos/thumb?1519098961",
        "projects" => [
          {
            "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
          }
        ],
        "plan" => "Staff",
        "monthly_spend" => 0,
        "current_user_abilities" => {
          "admin" => true,
          "billing" => true,
          "collaborator" => true,
          "owner" => false
        },
        "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
      }
    ],
    "meta" => {
      "first" => {
        "href" => "/projects?page=1"
      },
      "previous" => nil,
      "self" => {
        "href" => "/projects?page=1"
      },
      "next" => nil,
      "last" => {
        "href" => "/projects?page=1"
      },
      "current_page" => 1,
      "last_page" => 1,
      "total" => 1
    }
  }
  response
end

#list_payment_methods(_org_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/fog/compute/packet/requests/list_payment_methods.rb', line 18

def list_payment_methods(_org_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "payment_methods" => [
      {
        "id" => "7605f76e-17d4-4356-833c-91a273aba7f0",
        "name" => "John Doe",
        "type" => "credit_card",
        "default" => true,
        "created_at" => "2018-02-20T03:59:06Z",
        "updated_at" => "2018-02-20T03:59:13Z",
        "created_by_user" => {
          "href" => "/users/8f23cd1f-09e0-4539-9524-6387e4f8d44d"
        },
        "projects" => [
          {
            "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
          }
        ],
        "organization" => {
          "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
        },
        "card_type" => "American Express",
        "expiration_month" => "10",
        "expiration_year" => "2020",
        "last_4" => "1234",
        "cardholder_name" => "John Doe",
        "billing_address" => {
          "street_address" => nil,
          "postal_code" => "12345",
          "country_code_alpha2" => "US"
        },
        "href" => "/payment-methods/7605f76e-17d4-4356-833c-91a273aba7f0"
      }
    ],
    "meta" => {
      "first" => {
        "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1/payment-methods?page=1"
      },
      "previous" => nil,
      "self" => {
        "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1/payment-methods?page=1"
      },
      "next" => nil,
      "last" => {
        "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1/payment-methods?page=1"
      },
      "current_page" => 1,
      "last_page" => 1,
      "total" => 1
    }
  }
  response
end

#list_plans(_params = {}) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/fog/compute/packet/requests/list_plans.rb', line 26

def list_plans(_params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "plans" => [
      {
        "id" => "e69c0169-4726-46ea-98f1-939c9e8a3607",
        "slug" => "baremetal_0",
        "name" => "Type 0",
        "description" => 'Our Type 0 configuration is a general use "cloud killer" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.',
        "line" => "baremetal",
        "specs" => {
          "cpus" => [
            {
              "count" => 1,
              "type" => "Intel Atom C2550 @ 2.4Ghz"
            }
          ],
          "memory" => {
            "total" => "8GB"
          },
          "drives" => [
            {
              "count" => 1,
              "size" => "80GB",
              "type" => "SSD"
            }
          ],
          "nics" => [
            {
              "count" => 2,
              "type" => "1Gbps"
            }
          ],
          "features" =>
                    {
                      "raid" => false,
                      "txt" => true
                    }
        },
        "available_in" => [
          {
            "href" => "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
          },
          {
            "href" => "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
          },
          {
            "href" => "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975"
          },
          {
            "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
          }
        ],
        "pricing" => {
          "hour" => 0.07
        }
      }
    ]
  }

  response
end

#list_projects(_params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/fog/compute/packet/requests/list_projects.rb', line 18

def list_projects(_params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "projects" => [
      {
        "id" => "1140617d-262d-4502-a3d6-771d83c930da",
        "name" => "spc-fran-test",
        "created_at" => "2018-02-28T20:29:17Z",
        "updated_at" => "2018-03-06T11:19:30Z",
        "network_status" => {
          "sjc1" => "provisioned"
        },
        "max_devices" => {
          "baremetal_0" => 9999,
          "baremetal_1" => 9999
        },
        "organization" => {
          "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
        },
        "members" => [
          {
            "href" => "/users/1140617d-262d-4502-a3d6-771d83c930da"
          },
          {
            "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
          },
          {
            "href" => "/users/8f23cd1f-09e0-4539-9524-6387e4f8d44d"
          },
          {
            "href" => "/users/9532399b-4461-4c78-bbd9-d6250e2dc723"
          }
        ],
        "memberships" => [],
        "invitations" => [],
        "devices" => [],
        "ssh_keys" => [
          {
            "href" => "/ssh-keys/c2d63645-6051-4d19-92ab-0af335d3a1d5"
          }
        ],
        "transfers" => [],
        "volumes" => [],
        "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
      }
    ],
    "meta" => {
      "first" => {
        "href" => "/projects?page=1"
      },
      "previous" => nil,
      "self" => {
        "href" => "/projects?page=1"
      },
      "next" => nil,
      "last" => {
        "href" => "/projects?page=1"
      },
      "current_page" => 1,
      "last_page" => 1,
      "total" => 1
    }
  }
  response
end

#list_sessions(_params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fog/compute/packet/requests/list_sessions.rb', line 18

def list_sessions(_params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "sessions" => [
      {
        "id" => "fd8c403f-c81d-4de7-ba5e-91362fc2d71c",
        "token" => "thVsYD9FceLTdJdsrfjtLZGZPckx9Enh",
        "expires_at" => "2018-04-09T17:51:18Z",
        "created_at" => "2018-04-02T20:36:23Z",
        "updated_at" => "2018-04-06T17:51:18Z",
        "user" => {
          "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
        }
      }
    ]
  }
  response
end

#list_snapshots(_volume_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fog/compute/packet/requests/list_snapshots.rb', line 18

def list_snapshots(_volume_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "snapshots" => [
      {
        "id" => "39eaca27-3c42-4a98-acbd-0341503294f2",
        "status" => "available",
        "timestamp" => "1520630798.001449414",
        "created_at" => "2018-03-09T21:26:38.001Z",
        "volume" => {
          "href" => "/storage/64ad028f-ad75-4092-b974-531a80d7860d"
        }
      }
    ]
  }

  response
end

#list_spotmarketpricesObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/fog/compute/packet/requests/list_spotmarketprices.rb', line 17

def list_spotmarketprices
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "spot_market_prices" => {
      "ams1" => {
        "baremetal_0" => {
          "price" => 0.07
        },
        "baremetal_1" => {
          "price" => 4.01
        },
        "baremetal_2" => {
          "price" => 0.34
        },
        "baremetal_2a" => {
          "price" => 0.12
        },
        "baremetal_2a2" => {
          "price" => 5.01
        },
        "baremetal_3" => {
          "price" => 0.35
        }
      },
      "atl1" => {
        "baremetal_1e" => {
          "price" => 0.08
        }
      },
      "dfw1" => {
        "baremetal_1e" => {
          "price" => 0.08
        }
      }, "ewr1" => {
        "baremetal_0" => {
          "price" => 0.01
        },
        "baremetal_1" => {
          "price" => 0.4
        },
        "baremetal_2" => {
          "price" => 0.34
        },
        "baremetal_2a" => {
          "price" => 0.2
        },
        "baremetal_2a2" => {
          "price" => 0.1
        },
        "baremetal_3" => {
          "price" => 0.35
        },
        "baremetal_s" => {
          "price" => 0.3
        },
        "c2.medium.x86" => {
          "price" => 0.2
        },
        "m2.xlarge.x86" => {
          "price" => 20.01
        }
      },
      "fra1" => {
        "baremetal_1e" => {
          "price" => 4.01
        }
      },
      "hkg1" => {
        "baremetal_1e" => { "price" => 0.08 }
      },
      "iad1" => {
        "baremetal_1e" => {
          "price" => 0.08
        }
      },
      "lax1" => {
        "baremetal_1e" => {
          "price" => 0.08
        }
      }, "nrt1" => {
        "baremetal_0" => {
          "price" => 0.07
        },
        "baremetal_1" => {
          "price" => 0.08
        },
        "baremetal_2" => {
          "price" => 0.34
        },
        "baremetal_2a" => {
          "price" => 0.1
        },
        "baremetal_2a2" => {
          "price" => 5.01
        }
      },
      "ord1" => {
        "baremetal_1e" => {
          "price" => 0.08
        }
      },
      "sea1" => {
        "baremetal_1e" => {
          "price" => 0.09
        }
      },
      "sin1" => {
        "baremetal_1e" => {
          "price" => 0.08
        }
      },
      "sjc1" => {
        "baremetal_0" => {
          "price" => 0.07
        },
        "baremetal_1" => {
          "price" => 0.15
        },
        "baremetal_2" => {
          "price" => 0.34
        },
        "baremetal_2a" => {
          "price" => 0.1
        },
        "baremetal_2a2" => {
          "price" => 5.01
        },
        "baremetal_3" => {
          "price" => 0.35
        },
        "c2.medium.x86" => {
          "price" => 0.2
        },
        "m2.xlarge.x86" => {
          "price" => 0.4
        }
      },
      "syd1" => {
        "baremetal_1e" => {
          "price" => 0.08
        }
      },
      "yyz1" => {
        "baremetal_1e" => {
          "price" => 0.08
        }
      }
    }
  }

  response
end

#list_spotmarketprices_history(_facility, _plan) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fog/compute/packet/requests/list_spotmarketprices_history.rb', line 17

def list_spotmarketprices_history(_facility, _plan)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "prices_history" => [
      {
        "datapoints" => [
          [0.20134615384615362, 1_515_134_400],
          [0.3715384615384616, 1_515_165_600],
          [0.4628846153846158, 1_515_196_800],
          [0.06865384615384605, 1_515_228_000]
        ],
        "target" => "api_metrics.spot_market_price.ewr1.baremetal_0",
        "tags" => {
          "name" => "api_metrics.spot_market_price.ewr1.baremetal_0"
        }
      }
    ]
  }

  response
end

#list_ssh_keys(_project_id = "", _params = {}) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fog/compute/packet/requests/list_ssh_keys.rb', line 26

def list_ssh_keys(_project_id = "", _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "ssh_keys" =>
        [
          { "id" => "7722a922-d66e-4afa-bf5e-a7aec8955016",
            "label" => "test_jg",
            "key" => "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDgnV5MOhBqpQLt66KGlMKi",
            "fingerprint" => "0c:a9:79:a9:d7:29:49:5d:0e:43:41:bc:dc:4d:ac:78",
            "created_at" => "2018-03-27T10:46:33Z",
            "updated_at" => "2018-03-27T10:46:33Z",
            "owner" => {
              "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
            },
            "href" => "/ssh-keys/7722a922-d66e-4afa-bf5e-a7aec8955016" }
        ]
  }

  response
end

#list_transfer_requests(_organization_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/compute/packet/requests/list_transfer_requests.rb', line 18

def list_transfer_requests(_organization_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "transfers" => [
      {
        "id" => "string",
        "created_at" => "string",
        "updated_at" => "string",
        "target_organization" => {
          "href" => "string"
        },
        "project" => {
          "href" => "string"
        },
        "href" => "string"
      }
    ]
  }

  response
end

#list_users(_params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/fog/compute/packet/requests/list_users.rb', line 18

def list_users(_params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "users" => [
      {
        "id" => "2dce124f-3220-495c-907e-5bbbd4dda77c",
        "short_id" => "2dce124f",
        "first_name" => "Jane",
        "last_name" => "Doe",
        "full_name" => "Jane Doe",
        "email" => "[email protected]",
        "social_accounts" => {
          "linkedin" => "https://example.net"
        },
        "created_at" => "2018-02-20T19:55:57Z",
        "updated_at" => "2018-03-28T11:32:25Z",
        "default_organization_id" => "602c17ec-f996-4d94-a6a8-20d6356e6c2a",
        "avatar_url" => "https://www.gravatar.com/avatar/0bf989eabc6c8c214e11072b7500e4b2?d=mm",
        "avatar_thumb_url" => "https://www.gravatar.com/avatar/0bf989eabc6c8c214e11072b7500e4b2?d=mm",
        "timezone" => "America/New_York",
        "verification_stage" => "verified",
        "two_factor_auth" => "",
        "max_projects" => 2,
        "vpn" => false,
        "last_login_at" => "2018-03-28T11:36:34Z",
        "emails" => [
          {
            "href" => "/emails/973a189d-5dda-4b69-a038-526472a1b6d4"
          }
        ],
        "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c",
        "phone_number" => "+123456789012",
        "restricted" => false
      }
    ]
  }

  response
end

#list_virtual_networks(_project_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/fog/compute/packet/requests/list_virtual_networks.rb', line 18

def list_virtual_networks(_project_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "virtual_networks" => [
      {
        "id" => "699c3c36-0cf6-4552-ad43-a1845c04a838",
        "description" => "test",
        "vxlan" => 1022,
        "created_at" => "2018-03-12T22:16:39Z",
        "internet_gateway" => nil,
        "facility" => {
          "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
        },
        "instances" => [],
        "assigned_to" => {
          "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
        },
        "facility_code" => "ewr1", "href" => "/virtual-networks/699c3c36-0cf6-4552-ad43-a1845c04a838"
      }, {
        "id" => "ee424aad-539d-4a4a-877e-fbbd1417e235",
        "description" => "test",
        "vxlan" => 1026,
        "created_at" => "2018-03-12T22:29:56Z",
        "internet_gateway" => nil,
        "facility" =>
            {
              "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
            },
        "instances" => [],
        "assigned_to" => {
          "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
        },
        "facility_code" => "ewr1",
        "href" => "/virtual-networks/ee424aad-539d-4a4a-877e-fbbd1417e235"
      }
    ]
  }

  response
end

#list_volumes(_project_id, _params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/fog/compute/packet/requests/list_volumes.rb', line 18

def list_volumes(_project_id, _params = {})
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "volumes" => [
      {
        "id" => "87728148-3155-4992-a730-8d1e6aca8a32",
        "name" => "volume-870f9650",
        "description" => "test description",
        "size" => 20,
        "locked" => false,
        "billing_cycle" => "hourly",
        "state" => "active",
        "created_at" => "2018-03-08T12:49:30Z",
        "updated_at" => "2018-03-08T12:49:30.682Z",
        "access" => {},
        "project" => {
          "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
        },
        "facility" => {
          "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
        },
        "snapshot_policies" => [],
        "attachments" => [],
        "snapshots" => [],
        "plan" => {
          "id" => "87728148-3155-4992-a730-8d1e6aca8a32",
          "slug" => "storage_1",
          "name" => "Standard",
          "description" => "TBD",
          "line" => "storage",
          "specs" => {},
          "available_in" => [],
          "pricing" => {
            "hour" => 0.000104
          }
        },
        "href" => "/storage/870f9650-19ea-48bd-84c5-ddf97471c1c1"
      }
    ]
  }

  response
end

#move_hardware_reservation(_reservation_id, _project_id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/compute/packet/requests/move_hardware_reservation.rb', line 17

def move_hardware_reservation(_reservation_id, _project_id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => "string",
    "roles" => [
      "owner"
    ],
    "invitee" => "[email protected]",
    "nonce" => "NjxZAa3VYc3qvGhPejakYy4nKkt6S7Ay",
    "created_at" => "2018-04-10T21:13:24Z",
    "updated_at" => "2018-04-10T21:16:10Z",
    "invited_by" => {
      "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
    },
    "invitable" => {
      "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
    },
    "href" => "/invitations/02797cf6-c36c-474b-9558-37463f2aee26"
  }

  response
end

#poweroff_device(device_id) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/fog/compute/packet/requests/poweroff_device.rb', line 22

def poweroff_device(device_id)
  response = Excon::Response.new
  response.status = 202
  response.body = {
    "id" => device_id,
    "short_id" => "8f65b7eb",
    "hostname" => "test01",
    "description" => nil,
    "state" => "active",
    "tags" => [],
    "image_url" => nil,
    "billing_cycle" => "hourly",
    "user" => "core",
    "iqn" => "iqn.2018-03.net.packet:device.8f65b7eb",
    "locked" => false,
    "bonding_mode" => 5,
    "created_at" => "2018-03-07T14:13:27Z",
    "updated_at" => "2018-03-07T14:13:29.697Z",
    "ipxe_script_url" => nil,
    "always_pxe" => false,
    "storage" => nil,
    "provisioning_percentage" => 0.0,
    "operating_system" => {
      "id" => "d61c3912-8422-4daf-835e-854efa0062e4",
      "slug" => "coreos_stable",
      "name" => "Container Linux (CoreOS) - Stable",
      "distro" => "coreos",
      "version" => "stable",
      "provisionable_on" => [
        "m2.xlarge.x86"
      ],
      "default_cidr_size" => 31
    },
    "facility" => {
      "id" => "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
      "name" => "Parsippany, NJ",
      "code" => "ewr1",
      "features" =>
              [
                "baremetal"
              ],
      "address" => nil,
      "ip_ranges" => [
        "2604:1380::/36"
      ]
    },
    "project" =>
          {
            "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
          },
    "ssh_keys" => [
      {
        "href" => "/ssh-keys/38f2f61a-e0d7-4753-bebb-b580da2d43ac"
      },
      {
        "href" => "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
      },
      {
        "href" => "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
      },
      {
        "href" => "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
      },
      {
        "href" => "/ssh-keys/61905e3c-aa23-4ad3-922d-63cbd29060f9"
      },
      {
        "href" => "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
      }
    ],
    "project_lite" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "volumes" => [],
    "ip_addresses" => [],
    "plan" => {
      "id" => "e69c0169-4726-46ea-98f1-939c9e8a3607",
      "slug" => "baremetal_0",
      "name" => "Type 0",
      "description" => 'Our Type 0 configuration is a general use "cloud killer" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.',
      "line" => "baremetal",
      "specs" => {
        "cpus" => [
          {
            "count" => 1,
            "type" => "Intel Atom C2550 @ 2.4Ghz"
          }
        ],
        "memory" => {
          "total" => "8GB"
        },
        "drives" => [
          {
            "count" => 1,
            "size" => "80GB",
            "type" => "SSD"
          }
        ],
        "nics" => [
          {
            "count" => 2,
            "type" => "1Gbps"
          }
        ],
        "features" => {
          "raid" => false,
          "txt" => true
        }
      },
      "available_in" => [
        {
          "href" => "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
        },
        {
          "href" => "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
        },
        { "href" => "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975" },
        {
          "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
        }
      ], "pricing" => {
        "hour" => 0.07
      }
    },
    "userdata" => "",
    "switch_uuid" => "6ce8785a",
    "provisioning_events" => [
      {
        "id" => nil,
        "type" => "provisioning.101",
        "body" => "Provisioning started",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Provisioning started"
      },
      {
        "id" => nil,
        "type" => "provisioning.102",
        "body" => "Network configured",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Network configured"
      },
      "network_ports" => [
        {
          "id" => "8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e",
          "type" => "NetworkBondPort",
          "name" => "bond0",
          "data" => {
            "bonded" => true
          },
          "hardware" => {
            "href" => "/hardware/da6b785b-1b7d-4ed5-b61b-e09ec1bac16d"
          },
          "virtual_networks" => [],
          "connected_port" => nil,
          "href" => "/ports/8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e"
        }
      ], "href" => "/devices/8f65b7eb-80a5-4df0-a87d-030d1b0d3b77"
    ]
  }
  response
end

#poweron_device(device_id) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/fog/compute/packet/requests/poweron_device.rb', line 22

def poweron_device(device_id)
  response = Excon::Response.new
  response.status = 202
  response.body = {
    "id" => device_id,
    "short_id" => "8f65b7eb",
    "hostname" => "test01",
    "description" => nil,
    "state" => "active",
    "tags" => [],
    "image_url" => nil,
    "billing_cycle" => "hourly",
    "user" => "core",
    "iqn" => "iqn.2018-03.net.packet:device.8f65b7eb",
    "locked" => false,
    "bonding_mode" => 5,
    "created_at" => "2018-03-07T14:13:27Z",
    "updated_at" => "2018-03-07T14:13:29.697Z",
    "ipxe_script_url" => nil,
    "always_pxe" => false,
    "storage" => nil,
    "provisioning_percentage" => 0.0,
    "operating_system" => {
      "id" => "d61c3912-8422-4daf-835e-854efa0062e4",
      "slug" => "coreos_stable",
      "name" => "Container Linux (CoreOS) - Stable",
      "distro" => "coreos",
      "version" => "stable",
      "provisionable_on" => [
        "m2.xlarge.x86"
      ],
      "default_cidr_size" => 31
    },
    "facility" => {
      "id" => "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
      "name" => "Parsippany, NJ",
      "code" => "ewr1",
      "features" =>
              [
                "baremetal"
              ],
      "address" => nil,
      "ip_ranges" => [
        "2604:1380::/36"
      ]
    },
    "project" =>
          {
            "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
          },
    "ssh_keys" => [
      {
        "href" => "/ssh-keys/38f2f61a-e0d7-4753-bebb-b580da2d43ac"
      },
      {
        "href" => "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
      },
      {
        "href" => "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
      },
      {
        "href" => "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
      },
      {
        "href" => "/ssh-keys/61905e3c-aa23-4ad3-922d-63cbd29060f9"
      },
      {
        "href" => "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
      }
    ],
    "project_lite" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "volumes" => [],
    "ip_addresses" => [],
    "plan" => {
      "id" => "e69c0169-4726-46ea-98f1-939c9e8a3607",
      "slug" => "baremetal_0",
      "name" => "Type 0",
      "description" => 'Our Type 0 configuration is a general use "cloud killer" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.',
      "line" => "baremetal",
      "specs" => {
        "cpus" => [
          {
            "count" => 1,
            "type" => "Intel Atom C2550 @ 2.4Ghz"
          }
        ],
        "memory" => {
          "total" => "8GB"
        },
        "drives" => [
          {
            "count" => 1,
            "size" => "80GB",
            "type" => "SSD"
          }
        ],
        "nics" => [
          {
            "count" => 2,
            "type" => "1Gbps"
          }
        ],
        "features" => {
          "raid" => false,
          "txt" => true
        }
      },
      "available_in" => [
        {
          "href" => "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
        },
        {
          "href" => "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
        },
        { "href" => "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975" },
        {
          "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
        }
      ], "pricing" => {
        "hour" => 0.07
      }
    },
    "userdata" => "",
    "switch_uuid" => "6ce8785a",
    "provisioning_events" => [
      {
        "id" => nil,
        "type" => "provisioning.101",
        "body" => "Provisioning started",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Provisioning started"
      },
      {
        "id" => nil,
        "type" => "provisioning.102",
        "body" => "Network configured",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Network configured"
      },
      "network_ports" => [
        {
          "id" => "8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e",
          "type" => "NetworkBondPort",
          "name" => "bond0",
          "data" => {
            "bonded" => true
          },
          "hardware" => {
            "href" => "/hardware/da6b785b-1b7d-4ed5-b61b-e09ec1bac16d"
          },
          "virtual_networks" => [],
          "connected_port" => nil,
          "href" => "/ports/8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e"
        }
      ], "href" => "/devices/8f65b7eb-80a5-4df0-a87d-030d1b0d3b77"
    ]
  }
  response
end

#reboot_device(device_id) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/fog/compute/packet/requests/reboot_device.rb', line 22

def reboot_device(device_id)
  response = Excon::Response.new
  response.status = 202
  response.body = {
    "id" => device_id,
    "short_id" => "8f65b7eb",
    "hostname" => "test01",
    "description" => nil,
    "state" => "active",
    "tags" => [],
    "image_url" => nil,
    "billing_cycle" => "hourly",
    "user" => "core",
    "iqn" => "iqn.2018-03.net.packet:device.8f65b7eb",
    "locked" => false,
    "bonding_mode" => 5,
    "created_at" => "2018-03-07T14:13:27Z",
    "updated_at" => "2018-03-07T14:13:29.697Z",
    "ipxe_script_url" => nil,
    "always_pxe" => false,
    "storage" => nil,
    "provisioning_percentage" => 0.0,
    "operating_system" => {
      "id" => "d61c3912-8422-4daf-835e-854efa0062e4",
      "slug" => "coreos_stable",
      "name" => "Container Linux (CoreOS) - Stable",
      "distro" => "coreos",
      "version" => "stable",
      "provisionable_on" => [
        "m2.xlarge.x86"
      ],
      "default_cidr_size" => 31
    },
    "facility" => {
      "id" => "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
      "name" => "Parsippany, NJ",
      "code" => "ewr1",
      "features" =>
              [
                "baremetal"
              ],
      "address" => nil,
      "ip_ranges" => [
        "2604:1380::/36"
      ]
    },
    "project" =>
          {
            "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
          },
    "ssh_keys" => [
      {
        "href" => "/ssh-keys/38f2f61a-e0d7-4753-bebb-b580da2d43ac"
      },
      {
        "href" => "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
      },
      {
        "href" => "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
      },
      {
        "href" => "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
      },
      {
        "href" => "/ssh-keys/61905e3c-aa23-4ad3-922d-63cbd29060f9"
      },
      {
        "href" => "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
      }
    ],
    "project_lite" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "volumes" => [],
    "ip_addresses" => [],
    "plan" => {
      "id" => "e69c0169-4726-46ea-98f1-939c9e8a3607",
      "slug" => "baremetal_0",
      "name" => "Type 0",
      "description" => 'Our Type 0 configuration is a general use "cloud killer" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.',
      "line" => "baremetal",
      "specs" => {
        "cpus" => [
          {
            "count" => 1,
            "type" => "Intel Atom C2550 @ 2.4Ghz"
          }
        ],
        "memory" => {
          "total" => "8GB"
        },
        "drives" => [
          {
            "count" => 1,
            "size" => "80GB",
            "type" => "SSD"
          }
        ],
        "nics" => [
          {
            "count" => 2,
            "type" => "1Gbps"
          }
        ],
        "features" => {
          "raid" => false,
          "txt" => true
        }
      },
      "available_in" => [
        {
          "href" => "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
        },
        {
          "href" => "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
        },
        { "href" => "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975" },
        {
          "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
        }
      ], "pricing" => {
        "hour" => 0.07
      }
    },
    "userdata" => "",
    "switch_uuid" => "6ce8785a",
    "provisioning_events" => [
      {
        "id" => nil,
        "type" => "provisioning.101",
        "body" => "Provisioning started",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Provisioning started"
      },
      {
        "id" => nil,
        "type" => "provisioning.102",
        "body" => "Network configured",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Network configured"
      },
      "network_ports" => [
        {
          "id" => "8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e",
          "type" => "NetworkBondPort",
          "name" => "bond0",
          "data" => {
            "bonded" => true
          },
          "hardware" => {
            "href" => "/hardware/da6b785b-1b7d-4ed5-b61b-e09ec1bac16d"
          },
          "virtual_networks" => [],
          "connected_port" => nil,
          "href" => "/ports/8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e"
        }
      ], "href" => "/devices/8f65b7eb-80a5-4df0-a87d-030d1b0d3b77"
    ]
  }
  response
end

#request_email_verification(_email) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/request_email_verification.rb', line 17

def request_email_verification()
  response = Excon::Response.new
  response.status = 201
  response
end

#reserve_ip(_project_id, _options) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/compute/packet/requests/reserve_ip.rb', line 26

def reserve_ip(_project_id, _options)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "8f65b7eb-80a5-4df0-a87d-030d1b0d3b77"
  }
  response
end

#session_login(_login_params) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/session_login.rb', line 17

def ()
  response = Excon::Response.new
  response.status = 201
  response
end

#transfer_project(_project_id, _organization_id) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/compute/packet/requests/transfer_project.rb', line 22

def transfer_project(_project_id, _organization_id)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "id" => "string",
    "created_at" => "string",
    "updated_at" => "string",
    "target_organization" => {
      "href" => "string"
    },
    "project" => {
      "href" => "string"
    },
    "href" => "string"
  }

  response
end

#unassign_ip(_ip_id) ⇒ Object



16
17
18
19
20
# File 'lib/fog/compute/packet/requests/unassign_ip.rb', line 16

def unassign_ip(_ip_id)
  response = Excon::Response.new
  response.status = 204
  response
end

#unassign_port(_port_id, _vnid) ⇒ Object



17
18
19
20
21
# File 'lib/fog/compute/packet/requests/unassign_port.rb', line 17

def unassign_port(_port_id, _vnid)
  response = Excon::Response.new
  response.status = 200
  response
end

#update_device(device_id, _options) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/fog/compute/packet/requests/update_device.rb', line 29

def update_device(device_id, _options)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => device_id,
    "short_id" => "8f65b7eb",
    "hostname" => "test02",
    "description" => nil,
    "state" => "active",
    "tags" => [],
    "image_url" => nil,
    "billing_cycle" => "hourly",
    "user" => "core",
    "iqn" => "iqn.2018-03.net.packet:device.8f65b7eb",
    "locked" => false,
    "bonding_mode" => 5,
    "created_at" => "2018-03-07T14:13:27Z",
    "updated_at" => "2018-03-07T14:13:29.697Z",
    "ipxe_script_url" => nil,
    "always_pxe" => false,
    "storage" => nil,
    "provisioning_percentage" => 0.0,
    "operating_system" => {
      "id" => "d61c3912-8422-4daf-835e-854efa0062e4",
      "slug" => "coreos_stable",
      "name" => "Container Linux (CoreOS) - Stable",
      "distro" => "coreos",
      "version" => "stable",
      "provisionable_on" => [
        "m2.xlarge.x86"
      ],
      "default_cidr_size" => 31
    },
    "facility" => {
      "id" => "e1e9c52e-a0bc-4117-b996-0fc94843ea09",
      "name" => "Parsippany, NJ",
      "code" => "ewr1",
      "features" =>
              [
                "baremetal"
              ],
      "address" => nil,
      "ip_ranges" => [
        "2604:1380::/36"
      ]
    },
    "project" =>
          {
            "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
          },
    "ssh_keys" => [
      {
        "href" => "/ssh-keys/38f2f61a-e0d7-4753-bebb-b580da2d43ac"
      },
      {
        "href" => "/ssh-keys/084a5dec-30be-415a-8937-9c615932e459"
      },
      {
        "href" => "/ssh-keys/a8d6cc17-7d9d-4fb9-8190-afdb301b67df"
      },
      {
        "href" => "/ssh-keys/eacfb002-45e1-4047-a0d5-cd9d8bab19ed"
      },
      {
        "href" => "/ssh-keys/61905e3c-aa23-4ad3-922d-63cbd29060f9"
      },
      {
        "href" => "/ssh-keys/a3d8bebe-574f-427d-80ee-bc2ba17f7074"
      }
    ],
    "project_lite" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "volumes" => [],
    "ip_addresses" => [],
    "plan" => {
      "id" => "e69c0169-4726-46ea-98f1-939c9e8a3607",
      "slug" => "baremetal_0",
      "name" => "Type 0",
      "description" => 'Our Type 0 configuration is a general use "cloud killer" server, with a Intel Atom 2.4Ghz processor and 8GB of RAM.',
      "line" => "baremetal",
      "specs" => {
        "cpus" => [
          {
            "count" => 1,
            "type" => "Intel Atom C2550 @ 2.4Ghz"
          }
        ],
        "memory" => {
          "total" => "8GB"
        },
        "drives" => [
          {
            "count" => 1,
            "size" => "80GB",
            "type" => "SSD"
          }
        ],
        "nics" => [
          {
            "count" => 2,
            "type" => "1Gbps"
          }
        ],
        "features" => {
          "raid" => false,
          "txt" => true
        }
      },
      "available_in" => [
        {
          "href" => "/facilities/8ea03255-89f9-4e62-9d3f-8817db82ceed"
        },
        {
          "href" => "/facilities/2b70eb8f-fa18-47c0-aba7-222a842362fd"
        },
        { "href" => "/facilities/8e6470b3-b75e-47d1-bb93-45b225750975" },
        {
          "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
        }
      ], "pricing" => {
        "hour" => 0.07
      }
    },
    "userdata" => "",
    "switch_uuid" => "6ce8785a",
    "provisioning_events" => [
      {
        "id" => nil,
        "type" => "provisioning.101",
        "body" => "Provisioning started",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Provisioning started"
      },
      {
        "id" => nil,
        "type" => "provisioning.102",
        "body" => "Network configured",
        "state" => nil,
        "created_at" => nil,
        "relationships" => [],
        "ip" => nil,
        "modified_by" => nil,
        "interpolated" => "Network configured"
      },
      "network_ports" => [
        {
          "id" => "8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e",
          "type" => "NetworkBondPort",
          "name" => "bond0",
          "data" => {
            "bonded" => true
          },
          "hardware" => {
            "href" => "/hardware/da6b785b-1b7d-4ed5-b61b-e09ec1bac16d"
          },
          "virtual_networks" => [],
          "connected_port" => nil,
          "href" => "/ports/8eb55ecb-73ed-4ff7-b933-3f7fe2ae1a4e"
        }
      ], "href" => "/devices/8f65b7eb-80a5-4df0-a87d-030d1b0d3b77"
    ]
  }
  response
end

#update_email(_email_id, _options) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fog/compute/packet/requests/update_email.rb', line 22

def update_email(, _options)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => "1de4d14d-1c3e-4f33-b39a-2551af108f7e",
    "address" => "[email protected]",
    "default" => false,
    "href" => "/emails/1de4d14d-1c3e-4f33-b39a-2551af108f7e"
  }

  response
end

#update_license(id, options) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fog/compute/packet/requests/update_license.rb', line 22

def update_license(id, options)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "description" => options[:description],
    "license_key" => "2018-04-09T17:51:18Z",
    "licensee_product" => {
      "href" => "/"
    },
    "size" => options[:size],
    "project" => {
      "href" => "/"
    }
  }
  response
end

#update_membership(_id, _options) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/compute/packet/requests/update_membership.rb', line 20

def update_membership(_id, _options)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => "string",
    "roles" => [
      "string"
    ],
    "created_at" => "string",
    "updated_at" => "string",
    "project" => {
      "href" => "string"
    },
    "user" => {
      "href" => "string"
    },
    "href" => "string"
  }
  response
end

#update_notification(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fog/compute/packet/requests/update_notification.rb', line 17

def update_notification(id)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "type" => "string",
    "body" => "string",
    "severity" => "string",
    "read" => true,
    "context" => "string",
    "created_at" => "string",
    "updated_at" => "string",
    "user" => {
      "href" => "string"
    },
    "href" => "string"
  }

  response
end

#update_organization(id, options) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/fog/compute/packet/requests/update_organization.rb', line 27

def update_organization(id, options)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "name" => options[:name],
    "description" => options[:description],
    "website" => nil,
    "twitter" => nil,
    "created_at" => "2018-04-25T10:01:21Z",
    "updated_at" => "2018-04-25T10:01:21.134Z",
    "tax_id" => nil,
    "main_phone" => nil,
    "billing_phone" => nil,
    "credit_amount" => 0.0,
    "personal" => true,
    "customdata" => {},
    "address" => nil,
    "members" => [
      {
        "href" => "#2dce124f-3220-495c-907e-5bbbd4dda77c"
      }
    ],
    "owners" => [
      {
        "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
      }
    ],
    "memberships" => [
      {
        "href" => "/memberships/95780e18-ad65-4f0a-8895-0da65c371406"
      }
    ],
    "primary_owner" => {
      "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
    },
    "inbound_transfers" => [],
    "payment_methods" => [],
    "default_payment_method" => nil,
    "account_manager" => nil,
    "logo" => nil,
    "logo_thumb" => nil,
    "projects" => [],
    "plan" => "Bronze",
    "monthly_spend" => 0.0,
    "current_user_abilities" => {
      "admin" => true,
      "billing" => true,
      "collaborator" => true,
      "owner" => true
    },
    "href" => "/organizations/a24136c3-38e8-46a9-b541-219b4d31bfb1"
  }
  response
end

#update_payment_method(id, options) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/fog/compute/packet/requests/update_payment_method.rb', line 24

def update_payment_method(id, options)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "name" => options[:name],
    "type" => "credit_card",
    "default" => true,
    "created_at" => "2018-02-20T03:59:06Z",
    "updated_at" => "2018-02-20T03:59:13Z",
    "created_by_user" => {
      "href" => "/users/8f23cd1f-09e0-4539-9524-6387e4f8d44d"
    },
    "projects" => [
      {
        "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
      }
    ],
    "organization" => {
      "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
    },
    "card_type" => "American Express",
    "expiration_month" => options[:expiration_month],
    "expiration_year" => options[:expiration_year],
    "last_4" => "5045",
    "cardholder_name" => options["cardholder_name"],
    "billing_address" => {
      "street_address" => nil,
      "postal_code" => "10007",
      "country_code_alpha2" => "US"
    },
    "href" => "/payment-methods/7605f76e-17d4-4356-833c-91a273aba7f0"
  }

  response
end

#update_project(project_id, _options) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/fog/compute/packet/requests/update_project.rb', line 22

def update_project(project_id, _options)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => project_id,
    "name" => "spc-fran-test",
    "created_at" => "2018-02-28T20:29:17Z",
    "updated_at" => "2018-03-06T11:19:30Z",
    "network_status" => {
      "sjc1" => "provisioned"
    },
    "max_devices" => {
      "baremetal_0" => 9999,
      "baremetal_1" => 9999
    },
    "organization" => {
      "href" => "/organizations/6c17df6c-8769-4d98-b01f-f2848b6489a1"
    },
    "members" => [
      {
        "href" => "/users/1140617d-262d-4502-a3d6-771d83c930da"
      },
      {
        "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
      },
      {
        "href" => "/users/8f23cd1f-09e0-4539-9524-6387e4f8d44d"
      },
      {
        "href" => "/users/9532399b-4461-4c78-bbd9-d6250e2dc723"
      }
    ],
    "memberships" => [],
    "invitations" => [],
    "devices" => [],
    "ssh_keys" => [
      {
        "href" => "/ssh-keys/c2d63645-6051-4d19-92ab-0af335d3a1d5"
      }
    ],
    "transfers" => [],
    "volumes" => [],
    "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
  }
  response
end

#update_ssh_key(id, options) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/compute/packet/requests/update_ssh_key.rb', line 23

def update_ssh_key(id, options)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => id,
    "label" => options[:label],
    "key" => options[:key],
    "fingerprint" => "0c:a9:79:a9:d7:29:49:5d:0e:43:41:bc:dc:4d:ac:78",
    "created_at" => "2018-03-27T10:46:33Z",
    "updated_at" => "2018-03-27T10:46:33Z",
    "owner" => {
      "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c"
    },
    "href" => "/ssh-keys/7722a922-d66e-4afa-bf5e-a7aec8955016"
  }
  response
end

#update_user(_user_id, _options) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/fog/compute/packet/requests/update_user.rb', line 26

def update_user(_user_id, _options)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => "2dce124f-3220-495c-907e-5bbbd4dda77c",
    "short_id" => "2dce124f",
    "first_name" => "Jane",
    "last_name" => "Doe",
    "full_name" => "Jane Doe",
    "email" => "[email protected]",
    "social_accounts" => {
      "linkedin" => "https://example.net"
    },
    "created_at" => "2018-02-20T19:55:57Z",
    "updated_at" => "2018-03-28T11:32:25Z",
    "default_organization_id" => "602c17ec-f996-4d94-a6a8-20d6356e6c2a",
    "avatar_url" => "https://www.gravatar.com/avatar/0bf989eabc6c8c214e11072b7500e4b2?d=mm",
    "avatar_thumb_url" => "https://www.gravatar.com/avatar/0bf989eabc6c8c214e11072b7500e4b2?d=mm",
    "timezone" => "America/New_York",
    "verification_stage" => "verified",
    "two_factor_auth" => "",
    "max_projects" => 2,
    "vpn" => false,
    "last_login_at" => "2018-03-28T11:36:34Z",
    "emails" => [
      {
        "href" => "/emails/973a189d-5dda-4b69-a038-526472a1b6d4"
      }
    ],
    "href" => "/users/2dce124f-3220-495c-907e-5bbbd4dda77c",
    "phone_number" => "+123456789012",
    "restricted" => false
  }

  response
end

#update_volume(volume_id, options) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/fog/compute/packet/requests/update_volume.rb', line 24

def update_volume(volume_id, options)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => volume_id,
    "name" => "volume-870f9650",
    "description" => "test description",
    "size" => options[:size],
    "locked" => false,
    "billing_cycle" => "hourly",
    "state" => "active",
    "created_at" => "2018-03-08T12:49:30Z",
    "updated_at" => "2018-03-08T12:49:30.682Z",
    "access" => {},
    "project" => {
      "href" => "/projects/93125c2a-8b78-4d4f-a3c4-7367d6b7cca8"
    },
    "facility" => {
      "href" => "/facilities/e1e9c52e-a0bc-4117-b996-0fc94843ea09"
    },
    "snapshot_policies" => [],
    "attachments" => [],
    "snapshots" => [],
    "plan" => {
      "id" => "87728148-3155-4992-a730-8d1e6aca8a32",
      "slug" => "storage_1",
      "name" => "Standard",
      "description" => "TBD",
      "line" => "storage",
      "specs" => {},
      "available_in" => [],
      "pricing" => {
        "hour" => 0.000104
      }
    },
    "href" => "/storage/870f9650-19ea-48bd-84c5-ddf97471c1c1"
  }
  response
end

#validate_capacity(_options) ⇒ Object



30
31
32
33
34
# File 'lib/fog/compute/packet/requests/validate_capacity.rb', line 30

def validate_capacity(_options)
  response = Excon::Response.new
  response.status = 204
  response
end

#verify_email(_token) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fog/compute/packet/requests/verify_email.rb', line 17

def verify_email(_token)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "id" => "25a602c3-76b9-4de7-8b06-10d277f2a03b",
    "token" => "aE5Ye1evHw5ds8CrFB9mYf7qS3JZQ6my",
    "expires_at" => "2018-04-13T10:50:26Z",
    "created_at" => "2018-04-12T10:50:26Z",
    "updated_at" => "2018-04-12T10:50:26Z",
    "user" => {
      "href" => "/users/dbb25187-2f7e-4d53-a6de-d7b3e2b6d2ba"
    },
    "read_only" => false
  }
  response
end