Skip to content

Commit

Permalink
feat: generate sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacio Anaya committed Jun 14, 2022
1 parent e81f64c commit 15c1ab2
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 54 deletions.
2 changes: 1 addition & 1 deletion provider/cmd/pulumi-resource-checkly/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"attribution": "This Pulumi package is based on the [`checkly` Terraform Provider](https://github.com/checkly/terraform-provider-checkly).",
"repository": "https://github.com/checkly/pulumi-checkly",
"logoUrl": "https://raw.githubusercontent.com/checkly/pulumi-checkly/main/assets/checkly.svg",
"pluginDownloadURL": "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
"pluginDownloadURL": "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
"publisher": "checkly",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/AlertChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Check.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/CheckGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Dashboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/EnvironmentVariable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/MaintenanceWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Snippet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/TriggerCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/TriggerCheckGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static InvokeOptions WithDefaults(this InvokeOptions? src)
{
InvokeOptions dst = src ?? new InvokeOptions{};
dst.Version = src?.Version ?? Version;
dst.PluginDownloadURL = src?.PluginDownloadURL ?? "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}";
dst.PluginDownloadURL = src?.PluginDownloadURL ?? "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}";
return dst;
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/pulumi-plugin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"resource": true,
"name": "checkly",
"server": "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}"
"server": "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}"
}
2 changes: 1 addition & 1 deletion sdk/dotnet/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1-alpha.10+dirty
0.0.1+dirty
2 changes: 1 addition & 1 deletion sdk/go/checkly/pulumi-plugin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"resource": true,
"name": "checkly",
"server": "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}"
"server": "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}"
}
4 changes: 2 additions & 2 deletions sdk/go/checkly/pulumiUtilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ func isZero(v interface{}) bool {

// pkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource.
func pkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption {
defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}")}
defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}")}

return append(defaults, opts...)
}

// pkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke.
func pkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption {
defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}")}
defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}")}

return append(defaults, opts...)
}
56 changes: 27 additions & 29 deletions sdk/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
{
"name": "@checkly/pulumi",
"version": "v0.0.2-alpha.1655174643.dirty",
"description": "A Pulumi package for creating and managing Checkly monitoring resources.",
"keywords": [
"pulumi",
"checkly",
"category/monitoring"
],
"homepage": "https://www.pulumi.com/registry/packages/checkly",
"repository": "https://github.com/checkly/pulumi-checkly",
"license": "MIT",
"scripts": {
"build": "tsc",
"install": "node scripts/install-pulumi-plugin.js resource checkly v0.0.2-alpha.1655174643.dirty"
},
"dependencies": {
"@pulumi/pulumi": "^3.0.0"
},
"devDependencies": {
"@types/mime": "^2.0.0",
"@types/node": "^10.0.0",
"typescript": "^4.3.5"
},
"pulumi": {
"resource": true,
"pluginDownloadURL": "https://github.com/checkly/pulumi-checkly/releases/download/vv0.0.2-alpha.1655174643.dirty"
},
"main": "./bin/index.js",
"types": "./bin/index.d.ts"
"name": "@checkly/pulumi",
"version": "${VERSION}",
"description": "A Pulumi package for creating and managing Checkly monitoring resources.",
"keywords": [
"pulumi",
"checkly",
"category/monitoring"
],
"homepage": "https://www.pulumi.com/registry/packages/checkly",
"repository": "https://github.com/checkly/pulumi-checkly",
"license": "MIT",
"scripts": {
"build": "tsc",
"install": "node scripts/install-pulumi-plugin.js resource checkly ${VERSION}"
},
"dependencies": {
"@pulumi/pulumi": "^3.0.0"
},
"devDependencies": {
"@types/mime": "^2.0.0",
"@types/node": "^10.0.0",
"typescript": "^4.3.5"
},
"pulumi": {
"resource": true,
"pluginDownloadURL": "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}"
}
}
2 changes: 1 addition & 1 deletion sdk/nodejs/scripts/install-pulumi-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (args.indexOf("${VERSION}") !== -1) {
process.exit(0);
}

var res = childProcess.spawnSync("pulumi", ["plugin", "install", "--server", "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}"].concat(args), {
var res = childProcess.spawnSync("pulumi", ["plugin", "install", "--server", "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}"].concat(args), {
stdio: ["ignore", "inherit", "inherit"]
});

Expand Down
2 changes: 1 addition & 1 deletion sdk/nodejs/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ export function getVersion(): string {

/** @internal */
export function resourceOptsDefaults(): any {
return { version: getVersion(), pluginDownloadURL: "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}" };
return { version: getVersion(), pluginDownloadURL: "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}" };
}
11 changes: 8 additions & 3 deletions sdk/python/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Checkly Pulumi Provider
<p>
<img height="128" src="https://www.checklyhq.com/images/footer-logo.svg" align="right" />
<h1>Checkly Pulumi Provider</h1>
</p>

![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)

The Checkly Pulumi provider enables you to create and configure Checkly resources using your favourite programming language.
Note that this project is in its early stages and breaking changes could happen.
Expand All @@ -25,7 +30,7 @@ yarn add @checkly/pulumi
Install the provider binary plugin. This is only needed due to an outstanding bug in with Pulumi registry

```bash
pulumi plugin install resource checkly v0.0.1-alpha.5 --server https://github.com/checkly/pulumi-checkly/releases/download/v0.0.1-alpha.5
pulumi plugin install resource checkly v0.0.1-alpha.9 --server https://github.com/checkly/pulumi-checkly/releases/download/v0.0.1-alpha.9
```

### Python, Go & .NET
Expand Down Expand Up @@ -102,7 +107,7 @@ async function run () {
const response = await page.goto('https://google.com')
if (response.status() > 399) {
throw new Error('Failed with response code ${response.status()}')
throw new Error('Failed with response code \${response.status()}')
}
await page.screenshot({ path: 'screenshot.jpg' })
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/pulumi_checkly/_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,4 @@ def lifted_func(*args, opts=None, **kwargs):
return (lambda _: lifted_func)

def get_plugin_download_url():
return "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}"
return "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}"
2 changes: 1 addition & 1 deletion sdk/python/pulumi_checkly/pulumi-plugin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"resource": true,
"name": "checkly",
"server": "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}"
"server": "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}"
}
2 changes: 1 addition & 1 deletion sdk/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class InstallPluginCommand(install):
def run(self):
install.run(self)
try:
check_call(['pulumi', 'plugin', 'install', 'resource', 'checkly', PLUGIN_VERSION, '--server', 'https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}'])
check_call(['pulumi', 'plugin', 'install', 'resource', 'checkly', PLUGIN_VERSION, '--server', 'https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}'])
except OSError as error:
if error.errno == errno.ENOENT:
print(f"""
Expand Down

0 comments on commit 15c1ab2

Please sign in to comment.