4. Create deployment sites and domains¶
A DeploymentSite
represents a site where sc_pack
has been deployed, and it is the root of the tree to configure everything else.
Example of a setup using two edge servers for redundancy, with a DeploymentSite on each server.
4.1. Create deployments sites and domains¶
To create a
DeploymentSite
you should do aPOST
to the endpoint:
https://accelerator.shimmercat.com/presentation-api/v1/deployment-site/
4.1.1. Example using curl¶
curl -X POST https://accelerator.shimmercat.com/presentation-api/v1/deployment-site/ -H 'Authorization: Token xxx-your-tokenxxx' -H 'Content-type: application/json' -d '{"description": "Deployment site on sever 'test1'"}'
that will print a response like this:
{
"id":13,
"customer": {
"id":2,
"name": "Tests"
},
"is_hosting_pod":false,
"description":"Deployment site on sever test1",
"name16": "d808e46ae28f9543",
"secret16": "b2317efe2a86585d"
}
Hold carefully the id
on this response because you will need it to create the domains that belong to this deployment site.
Although you can in fact GET
the complete list of your DeploymentSites
through: https://accelerator.shimmercat.com/presentation-api/v1/deployment-site/
, but using a GET
request.
Using curl
:
curl -X GET https://accelerator.shimmercat.com/presentation-api/v1/deployment-site/ -H 'Authorization: Token xxx-your-tokenxxx' -H 'Content-type: application/json'
which will print a response like this:
[
{
"id":13,
"customer": {
"id":2,
"name": "Tests"
},
"is_hosting_pod":false,
"description":"Deployment site on sever test1",
"name16": "d808e46ae28f9543",
"secret16": "b2317efe2a86585d"
}
]
The values of name16
and secret16
will be generated automatically. Those values:
name16 = deployment_site_long_name and
secret16 = deployment_site_long_secret
should be placed in the sc_pack.conf.yaml
. You can find more details about this file on the sc_pack_guide.md
Finally create domains and associate them with the Deployment sites. Using
curl
:
curl -X POST https://accelerator.shimmercat.com/presentation-api/v1/domain/ -H 'Authorization: Token xxx-your-tokenxxx' -H 'Content-type: application/json' -d '{"name": "www.accelerator.doc.com", "deployment_site_id": 13}'
your response will be something like:
{
"id": 7,
"name": "www.accelerator.doc.com"
"sub_domains": []
}
Once you have created the domain, you are allowed to add until two sub-domains to it. If you need to have more than 2 sub-domains, please contact our support team.
To add a sub-domain do a PUT
request to https://accelerator.shimmercat.com/presentation-api/v1/domain/<domain_id>/
and with the sub-domain data.
Using curl
and the same example we have been following it would be:
curl -X POST https://accelerator.shimmercat.com/presentation-api/v1/domain/7/ -H 'Authorization: Token xxx-your-tokenxxx' -H 'Content-type: application/json' -d '{"sub_domain": {"name": "api.accelerator.doc.com", "share_views_and_views_dir_with_main_domain": false}}'
your response will be something like:
{
"id": 7,
"name": "www.accelerator.doc.com",
"sub_domains": [
"id": 8,
"name": "api.accelerator.doc.com",
"share_views_and_views_dir_with_main_domain": false
]
}
You should have into account that for the sub-domains we just allow related sub-domains names to the main domain name. So for instance:
media.accelerator.doc.com
is related towww.accelerator.doc.com
, butmedia.acceleratorsss.doc.com
is not.
You can create as much domains as you need by deployment site. And that’s all you need to do through our API to get the accelerator instances ready to link with the sc_pack
.
We have also a more detailed doc for our API services here
that you can check.