Skip to content

Commit

Permalink
use v1beta
Browse files Browse the repository at this point in the history
Signed-off-by: Ran <[email protected]>
  • Loading branch information
ran-huang committed Aug 3, 2022
1 parent 2025632 commit c6e6778
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/devTier.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const fs = require("fs");

function devTier(json_file) {
const schema = JSON.parse(fs.readFileSync(json_file, 'utf8'));
schema["paths"]["/api/v1/projects/{project_id}/clusters"]["post"]["x-code-samples"][0]["lang"] = "curl for Dedicated Tier";
schema["paths"]["/api/v1/projects/{project_id}/clusters"]["post"]["x-code-samples"].push({"lang": "curl for Developer Tier", "source": "curl --digest \\\n --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n --request POST \\\n --url https://api.tidbcloud.com/api/v1/projects/{project_id}/clusters \\\n --header 'content-type: application/json' \\\n --data '{\"name\":\"Cluster0\",\"cluster_type\":\"SHARED\",\"cloud_provider\":\"AWS\",\"region\":\"us-west-2\",\"config\":{\"root_password\":\"password_example\",\"ip_access_list\":{\"items\":[{\"cidr\":\"8.8.8.8/32\",\"description\":\"My IP Address\"}]}}}'"});
schema["paths"]["/api/v1beta/projects/{project_id}/clusters"]["post"]["x-code-samples"][0]["lang"] = "curl for Dedicated Tier";
schema["paths"]["/api/v1beta/projects/{project_id}/clusters"]["post"]["x-code-samples"].push({"lang": "curl for Developer Tier", "source": "curl --digest \\\n --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n --request POST \\\n --url https://api.tidbcloud.com/api/v1/projects/{project_id}/clusters \\\n --header 'content-type: application/json' \\\n --data '{\"name\":\"Cluster0\",\"cluster_type\":\"SHARED\",\"cloud_provider\":\"AWS\",\"region\":\"us-west-2\",\"config\":{\"root_password\":\"password_example\",\"ip_access_list\":{\"items\":[{\"cidr\":\"8.8.8.8/32\",\"description\":\"My IP Address\"}]}}}'"});
fs.writeFileSync(json_file, JSON.stringify(schema, null, 2));
console.log(`Add dev tier to ${json_file}`);
}
Expand Down

0 comments on commit c6e6778

Please sign in to comment.