This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
integrations: | |
agent: | |
enabled: false | |
windows_exporter: | |
enabled: true | |
prometheus_remote_write: | |
- basic_auth: | |
password: GCLOUD_API_KEY | |
username: GCLOUD_PROM_USER_ID | |
url: GCLOUD_PROM_ENDPOINT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
integrations: | |
agent: | |
enabled: false | |
node_exporter: | |
enabled: true | |
prometheus_remote_write: | |
- basic_auth: | |
password: GCLOUD_API_KEY | |
username: GCLOUD_PROM_USER_ID | |
url: GCLOUD_PROM_ENDPOINT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define create_nat_route($route_table_id, $nat_gateway_id, $region) return $response do | |
$response = http_request( | |
host: "ec2."+$region+".amazonaws.com/?Action=CreateRoute&DestinationCidrBlock=0.0.0.0/0&RouteTableId="+$route_table_id+"&NatGatewayId="+$nat_gateway_id+"&Version=2016-11-15", | |
https: true, | |
verb: "post", | |
signature: {"type": "aws"} | |
) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define create_nat_route($route_table_id, $nat_gateway_id, $region) return $response do | |
$response = http_request( | |
host: "ec2."+$region+".amazonaws.com/?Action=CreateRoute&DestinationCidrBlock=0.0.0.0/0&RouteTableId="+$route_table_id+"&NatGatewayId="+$nat_gateway_id+"&Version=2016-11-15", | |
https: true, | |
verb: "post", | |
signature: {"type": "aws"} | |
) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define run_rightscript_by_name(@target, $script_name, $inputs) do | |
@script = rs_cm.right_scripts.index(latest_only: true, filter: [join(["name==", $script_name])]) | |
@task = @target.run_executable(right_script_href: @script.href, inputs: $inputs ) | |
sleep_until(@task.summary =~ "^(Completed|Aborted)") | |
if @task.summary =~ "Aborted" | |
raise "Failed to run " + $script_name | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define base64_encode($string) return $value do | |
$response = http_post( url: join(["https://www.base64encode.org/enc/", $string]) ) | |
$1 = split($response["body"], "Result goes here...\">") | |
$value = split($1[1], "</textarea>") | |
$value = $value[0] | |
end | |
define base64_decode($string) return $value do | |
$response = http_post( url: join(["https://www.base64decode.org/dec/", $string]) ) | |
$1 = split($response["body"], "Result goes here...\">") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Import-ServerTemplate { | |
<# | |
.SYNOPSIS | |
Import ServerTemplate from the RightScale MultiCloud Marketplace | |
.PARAMETER RsEndpoint | |
RightScale API Endpoint. Only valid values are: us-3.rightscale.com OR us-4.rightscale.com | |
.PARAMETER RsAccountNum | |
RightScale Account Number | |
.PARAMETER RsEmail | |
Email address of RightScale user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Import-ServerTemplate { | |
<# | |
.SYNOPSIS | |
Import ServerTemplate from the RightScale MultiCloud Marketplace | |
.PARAMETER RsEndpoint | |
RightScale API Endpoint. Only valid values are: us-3.rightscale.com OR us-4.rightscale.com | |
.PARAMETER RsAccountNum | |
RightScale Account Number | |
.PARAMETER RsEmail | |
Email address of RightScale user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#USAGE: | |
# 1) Execute both functions below in a PowerShell session or ISE session | |
# 2) Execute Copy-ARMImage. Required params: AZURE_DESTINATION_SUBSCRIPTION_ID, AZURE_SOURCE_SUBSCRIPTION_ID, DESTINATION_STORAGE_ACCOUNT, IMAGE_URI, AZURE_USERNAME, AZURE_PASSWORD, LogFile | |
function Write-LogFile { | |
[CmdletBinding()] | |
Param([string]$Message, [string]$MessageType, [string]$LogFile) | |
$source = $((Get-Variable -Scope 1 MyInvocation -ValueOnly).MyCommand.Name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#API Docs: http://reference.rightscale.com/selfservice/manager/index.html#/1.0/controller/V1::Controller::ScheduledAction/create | |
#$name is a human-readable name for the scheduled action. ie "my scheduled action" | |
#$action is one of: "launch","start","stop","terminate","run" | |
#$operation_name is only necessary if $action = "run". it's value is the custom operation name | |
#$recurrence is an RRULE as described by RFC 5545. ie "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR" | |
#$timezone in standardized tzinfo names (http://www.iana.org/time-zones) ie "America/Los_Angeles" or "UTC" | |
#$first_occurrence in ISO-8601 DateTime format. ie "2014-07-24T00:00:00+00:00" | |
#Create RUN scheduled action: | |
rs_ss.scheduled_actions.create( |
NewerOlder