a year ago
I'm using the graphql api to deploy a new service but I haven't figured out a way to set the region for the service (and the edge). No matter what I've tried it sets the region to "US West, Oregon". Any tips?
11 Replies
a year ago
Hey, I'm guessing you're talking about the GraphQL API instead of the railway.json config file, you'll need to call serviceInstanceUpdate with multiRegionConfig as variables:
mutation ($input: ServiceInstanceUpdateInput!) {
serviceInstanceUpdate(
input: $input
serviceId: ""
)
}then as variables:
{
"input": {
"multiRegionConfig": {
"us-east4-eqdc4a":null,
"us-west2": {
"numReplicas":1
}
}
}
}regions IDs can be obtainable by calling the following query:
query GetRegions {
regions {
name
}
}a year ago
To set a default region across all services, you can use a simpler method by navigating to the dashboard, pressing CTRL + K, typing "update preferred region," and then selecting your desired default region.
a year ago
From now on, all services will be created in that region, including those created by the API.
and is there a way to get the new instances to use Metal edge by default as well?
a year ago
afaik no
I've now done both.. set the default region and updated the code to follow the multiRegionConfig.. it's still creating everything in US West, Oregon. I'm stumped.
ok, it looks like it sets the region correctly initially but changes it to the US West legacy when we attach a volume to it. Does that make any sense? I've set the default region to US East virginia metal a well
ok in the end the culprit was that we sent another serviceInstanceUpdate in the script later to set other paramenters, which didn't have the region set and that caused it to reset it.
a year ago
!s
Status changed to Solved brody • about 1 year ago