WebFaction
Community site: login faq

Hi,

I'd like to be able to give new websites a default subdomain (like appname.mydomain.com ) when I create em - domain propagation takes time and I'd like to be able to test things before pulling the trigger with a nameserver switch.

However it doesn't look like I can create subdomains from the API like I can from the website list.

Anyway you guys could expose an update_domain method that would let me quickly create subdomains when I set up a new site.

asked 09 Jan '13, 20:31

Mojowen
516
accept rate: 0%

Sorry, we don't understand the question really, can you clarify?

The API does allow creation of both domains and subdomains, via the create_domain() function. Also, since you're using python, a "default subdomain" just means setting this as a variable in your python code and using it as the default value in your API method calls; i.e.:

domain = 'foo.com'
subdomains = ['www']
do_something_which_may_or_may_not_affect_subdomains_list()
create_domain(session_id, domain, *subdomains)
(10 Jan '13, 01:29) ryans ♦♦

Here's how you do it - and what I was trying to do:

  • First I create a domain ( e.g. maindomain.com ). I can pass subdomains too it when I create it using the create_domain API call.

  • Later on I want to migrate over a new site ( mymigration.com ). So I use create_domain to register mymigration.com with WebFaction, hooray! But I want to set up a subdomain on my maindomain.com to test out the new site - kick the tires, etc.

Here's how you do it: just call create_domain again with the already added domain and the new subdomain. It serves as an update_domain onto the list of already created subdomains - no need to repass them or anything like that.

permanent link

answered 10 Jan '13, 15:36

Mojowen
516
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×75
×37
×30
×17

question asked: 09 Jan '13, 20:31

question was seen: 2,472 times

last updated: 10 Jan '13, 15:36

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM