POST /api/smart_proxies/:id/import_puppetclasses
Import puppet classes from puppet proxy

POST /api/smart_proxies/:smart_proxy_id/environments/:id/import_puppetclasses
Import puppet classes from puppet proxy for an environment

POST /api/environments/:environment_id/smart_proxies/:id/import_puppetclasses
Import puppet classes from puppet proxy for an environment

Examples

POST /api/smart_proxies/182953976/import_puppetclasses
{
  "smart_proxy": {}
}
200
{
  "message": "Successfully updated environment and puppetclasses from the on-disk puppet installation",
  "environments_with_new_puppetclasses": 0,
  "environments_updated_puppetclasses": 2,
  "environments_obsolete": 2,
  "environments_ignored": 0,
  "results": [
    {
      "name": "env1",
      "actions": [
        "updated",
        "obsolete"
      ],
      "updated_puppetclasses": [
        "a"
      ],
      "obsolete_puppetclasses": [
        "b",
        "c"
      ]
    },
    {
      "name": "env2",
      "actions": [
        "updated",
        "obsolete"
      ],
      "updated_puppetclasses": [
        "a"
      ],
      "obsolete_puppetclasses": [
        "b",
        "c"
      ]
    }
  ]
}

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.

smart_proxy_id
optional

Validations:

  • Must be a String

environment_id
optional

Validations:

  • Must be a String

dryrun
optional

Validations:

  • Must be one of: true, false, 1, 0.

except
optional

Optional comma-delimited string containing either ‘new’, ‘updated’, or ‘obsolete’ that is used to limit the imported Puppet classes

Validations:

  • Must be a String


GET /api/smart_proxies
List all smart proxies

Examples

GET /api/smart_proxies
200
{
  "total": 8,
  "subtotal": 8,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "created_at": "2020-05-20 13:22:29 UTC",
      "updated_at": "2020-05-20 13:22:29 UTC",
      "name": "A proxy with Logs feature",
      "id": 814728799,
      "url": "http://else.where:45674",
      "features": [
        {
          "capabilities": [],
          "name": "DHCP",
          "id": 219245707
        },
        {
          "capabilities": [],
          "name": "DNS",
          "id": 49142851
        },
        {
          "capabilities": [],
          "name": "Puppet",
          "id": 1006510553
        },
        {
          "capabilities": [],
          "name": "Logs",
          "id": 814728799
        }
      ]
    },
    {
      "created_at": "2020-05-20 13:22:29 UTC",
      "updated_at": "2020-05-20 13:22:29 UTC",
      "name": "BMC proxy",
      "id": 821748566,
      "url": "http://else.where:45673",
      "features": [
        {
          "capabilities": [],
          "name": "BMC",
          "id": 821748566
        }
      ]
    },
    {
      "created_at": "2020-05-20 13:22:29 UTC",
      "updated_at": "2020-05-20 13:22:29 UTC",
      "name": "DHCP Proxy",
      "id": 980190962,
      "url": "https://somewhere.net:8443",
      "features": [
        {
          "capabilities": [],
          "name": "DHCP",
          "id": 219245707
        }
      ]
    },
    {
      "created_at": "2020-05-20 13:22:29 UTC",
      "updated_at": "2020-05-20 13:22:29 UTC",
      "name": "DNS Proxy",
      "id": 113629430,
      "url": "http://else.where:45671",
      "features": [
        {
          "capabilities": [],
          "name": "DNS",
          "id": 49142851
        }
      ]
    },
    {
      "created_at": "2020-05-20 13:22:29 UTC",
      "updated_at": "2020-05-20 13:22:29 UTC",
      "name": "Puppetmaster Proxy",
      "id": 182953976,
      "url": "http://else.where:4567",
      "features": [
        {
          "capabilities": [],
          "name": "Puppet",
          "id": 1006510553
        },
        {
          "capabilities": [],
          "name": "Puppet CA",
          "id": 783807086
        }
      ]
    },
    {
      "created_at": "2020-05-20 13:22:29 UTC",
      "updated_at": "2020-05-20 13:22:29 UTC",
      "name": "Realm Proxy",
      "id": 982965213,
      "url": "http://else.where:1337",
      "features": [
        {
          "capabilities": [],
          "name": "Realm",
          "id": 982965213
        }
      ]
    },
    {
      "created_at": "2020-05-20 13:22:29 UTC",
      "updated_at": "2020-05-20 13:22:29 UTC",
      "name": "TFTP Proxy",
      "id": 298486374,
      "url": "http://somewhere.else",
      "features": [
        {
          "capabilities": [],
          "name": "TFTP",
          "id": 303403661
        }
      ]
    },
    {
      "created_at": "2020-05-20 13:22:29 UTC",
      "updated_at": "2020-05-20 13:22:29 UTC",
      "name": "Unused Proxy",
      "id": 281110143,
      "url": "http://else.where:45672",
      "features": []
    }
  ]
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

search
optional

filter results

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

Number of results per page to return, ‘all’ to return all results

Validations:

  • Must match regular expression /\A([1-9]\d|all)\Z$/.

Search fields

Field name Type Possible values
feature string
location string
location_id integer
name string
organization string
organization_id integer
url string

GET /api/smart_proxies/:id
Show a smart proxy

Examples

GET /api/smart_proxies/980190962-DHCP%20Proxy
200
{
  "created_at": "2020-05-20 13:22:29 UTC",
  "updated_at": "2020-05-20 13:22:29 UTC",
  "name": "DHCP Proxy",
  "id": 980190962,
  "url": "https://somewhere.net:8443",
  "features": [
    {
      "capabilities": [],
      "name": "DHCP",
      "id": 219245707
    }
  ],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

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/smart_proxies
Create a smart proxy

Examples

POST /api/smart_proxies
{
  "smart_proxy": {
    "name": "master02",
    "url": "http://server:8443"
  }
}
201
{
  "created_at": "2020-05-20 13:22:32 UTC",
  "updated_at": "2020-05-20 13:22:32 UTC",
  "name": "master02",
  "id": 982965214,
  "url": "http://server:8443",
  "features": [
    {
      "capabilities": [],
      "name": "DNS",
      "id": 49142851
    },
    {
      "capabilities": [],
      "name": "TFTP",
      "id": 303403661
    },
    {
      "capabilities": [],
      "name": "DHCP",
      "id": 219245707
    },
    {
      "capabilities": [],
      "name": "Puppet CA",
      "id": 783807086
    },
    {
      "capabilities": [],
      "name": "Puppet",
      "id": 1006510553
    },
    {
      "capabilities": [],
      "name": "BMC",
      "id": 821748566
    },
    {
      "capabilities": [],
      "name": "Chef Proxy",
      "id": 848995175
    },
    {
      "capabilities": [],
      "name": "Realm",
      "id": 982965213
    },
    {
      "capabilities": [],
      "name": "Logs",
      "id": 814728799
    }
  ],
  "locations": [],
  "organizations": []
}

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

smart_proxy
required

Validations:

  • Must be a Hash

smart_proxy[name]
required

Validations:

  • Must be a String

smart_proxy[url]
required

Validations:

  • Must be a String

smart_proxy[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

smart_proxy[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


PUT /api/smart_proxies/:id
Update a smart proxy

Examples

PUT /api/smart_proxies/980190962-DHCP%20Proxy
{
  "smart_proxy": {
    "name": "new_smart_proxy"
  }
}
200
{
  "created_at": "2020-05-20 13:22:29 UTC",
  "updated_at": "2020-05-20 13:22:30 UTC",
  "name": "new_smart_proxy",
  "id": 980190962,
  "url": "https://somewhere.net:8443",
  "features": [
    {
      "capabilities": [],
      "name": "DHCP",
      "id": 219245707
    },
    {
      "capabilities": [],
      "name": "DNS",
      "id": 49142851
    },
    {
      "capabilities": [],
      "name": "TFTP",
      "id": 303403661
    },
    {
      "capabilities": [],
      "name": "DHCP",
      "id": 219245707
    },
    {
      "capabilities": [],
      "name": "Puppet CA",
      "id": 783807086
    },
    {
      "capabilities": [],
      "name": "Puppet",
      "id": 1006510553
    },
    {
      "capabilities": [],
      "name": "BMC",
      "id": 821748566
    },
    {
      "capabilities": [],
      "name": "Chef Proxy",
      "id": 848995175
    },
    {
      "capabilities": [],
      "name": "Realm",
      "id": 982965213
    },
    {
      "capabilities": [],
      "name": "Logs",
      "id": 814728799
    }
  ],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

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

smart_proxy
required

Validations:

  • Must be a Hash

smart_proxy[name]
optional

Validations:

  • Must be a String

smart_proxy[url]
optional

Validations:

  • Must be a String

smart_proxy[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

smart_proxy[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


DELETE /api/smart_proxies/:id
Delete a smart proxy

Examples

DELETE /api/smart_proxies/281110143-Unused%20Proxy
{
  "smart_proxy": {}
}
200
{
  "id": 281110143,
  "name": "Unused Proxy",
  "url": "http://else.where:45672",
  "created_at": "2020-05-20T13:22:29.658Z",
  "updated_at": "2020-05-20T13:22:29.658Z",
  "expired_logs": "0"
}

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


PUT /api/smart_proxies/:id/refresh
Refresh smart proxy features

Examples

POST /api/smart_proxies/980190962-DHCP%20Proxy/refresh
{
  "smart_proxy": {}
}
201
{
  "created_at": "2020-05-20 13:22:29 UTC",
  "updated_at": "2020-05-20 13:22:29 UTC",
  "name": "DHCP Proxy",
  "id": 980190962,
  "url": "https://somewhere.net:8443",
  "features": [
    {
      "capabilities": [],
      "name": "DHCP",
      "id": 219245707
    },
    {
      "capabilities": [],
      "name": "DNS",
      "id": 49142851
    },
    {
      "capabilities": [],
      "name": "TFTP",
      "id": 303403661
    },
    {
      "capabilities": [],
      "name": "Puppet CA",
      "id": 783807086
    },
    {
      "capabilities": [],
      "name": "Puppet",
      "id": 1006510553
    },
    {
      "capabilities": [],
      "name": "BMC",
      "id": 821748566
    },
    {
      "capabilities": [],
      "name": "Chef Proxy",
      "id": 848995175
    },
    {
      "capabilities": [],
      "name": "Realm",
      "id": 982965213
    },
    {
      "capabilities": [],
      "name": "Logs",
      "id": 814728799
    }
  ],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

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