GET /api/compute_profiles
Llista de tots els perfils computacionals

Examples

GET /api/compute_profiles
200
{
  "total": 4,
  "subtotal": 4,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "created_at": "2019-11-07 09:01:45 UTC",
      "updated_at": "2019-11-07 09:01:45 UTC",
      "id": 980190962,
      "name": "1-Small"
    },
    {
      "created_at": "2019-11-07 09:01:45 UTC",
      "updated_at": "2019-11-07 09:01:45 UTC",
      "id": 298486374,
      "name": "2-Medium"
    },
    {
      "created_at": "2019-11-07 09:01:45 UTC",
      "updated_at": "2019-11-07 09:01:45 UTC",
      "id": 113629430,
      "name": "3-Large"
    },
    {
      "created_at": "2019-11-07 09:01:45 UTC",
      "updated_at": "2019-11-07 09:01:45 UTC",
      "id": 281110143,
      "name": "4-Networking"
    }
  ]
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

search
Optional

filtra els resultats

Validations:

  • Must be a String

order
Optional

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
Optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
Optional

Nombre de resultats per pàgina a retornar

Validations:

  • Must be a number.

Search fields

Field name Tipus Possible values
name string

GET /api/compute_profiles/:id
Mostra un perfil computacional

Examples

GET /api/compute_profiles/980190962-1-Small
200
{
  "created_at": "2019-11-07 09:01:45 UTC",
  "updated_at": "2019-11-07 09:01:45 UTC",
  "id": 980190962,
  "name": "1-Small",
  "compute_attributes": [
    {
      "id": 980190962,
      "name": null,
      "compute_resource_id": 928692541,
      "compute_resource_name": "amazon123",
      "provider_friendly_name": "EC2",
      "compute_profile_id": 980190962,
      "compute_profile_name": "1-Small",
      "vm_attrs": {
        "flavor_id": "m1.small",
        "availability_zone": "eu-west-1a"
      },
      "attributes": {}
    },
    {
      "id": 298486374,
      "name": null,
      "compute_resource_id": 980190962,
      "compute_resource_name": "bigcompute",
      "provider_friendly_name": "Libvirt",
      "compute_profile_id": 980190962,
      "compute_profile_name": "1-Small",
      "vm_attrs": {
        "cpus": 2,
        "memory": 536870912
      },
      "attributes": {
        "cpus": 2,
        "memory": 536870912,
        "image_id": null,
        "image_name": null,
        "volumes_attributes": {},
        "interfaces_attributes": {}
      }
    }
  ]
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
Required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/compute_profiles
Crea un perfil computacional

Examples

POST /api/compute_profiles
{
  "compute_profile": {
    "name": ""
  }
}
422
{
  "error": {
    "id": null,
    "errors": {
      "name": [
        "can't be blank"
      ]
    },
    "full_messages": [
      "Name can't be blank"
    ]
  }
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

compute_profile
Required

Validations:

  • Must be a Hash

compute_profile[name]
Required

Validations:

  • Must be a String


PUT /api/compute_profiles/:id
Actualitza un perfil computacional

Examples

PUT /api/compute_profiles/980190962-1-Small
{
  "compute_profile": {
    "name": ""
  }
}
422
{
  "error": {
    "id": 980190962,
    "errors": {
      "name": [
        "can't be blank"
      ]
    },
    "full_messages": [
      "Name can't be blank"
    ]
  }
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
Required

Validations:

  • Must be a String

compute_profile
Required

Validations:

  • Must be a Hash

compute_profile[name]
Optional

Validations:

  • Must be a String


DELETE /api/compute_profiles/:id
Suprimeix un perfil computacional

Examples

DELETE /api/compute_profiles/113629430-3-Large
{
  "compute_profile": {}
}
200
{
  "id": 113629430,
  "name": "3-Large",
  "created_at": "2019-11-07T09:01:45.681Z",
  "updated_at": "2019-11-07T09:01:45.681Z"
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
Required

Validations:

  • Must be a String