Skip to content

Instantly share code, notes, and snippets.

View prydin's full-sized avatar

Pontus Rydin prydin

View GitHub Profile
@prydin
prydin / vrohelper.py
Created June 14, 2023 19:00
Simplified vRO API
from functools import lru_cache
import requests
import time
class AutomationClient:
"""
Low level Aria Automation/Orchestration client.
"""
@prydin
prydin / FeatureDetector.java
Created January 29, 2022 15:21
Minecraft 1.18.1 tree detector
package nu.rydin.enchante.utils;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.Property;
import javax.annotation.Nullable;
import java.util.Collection;
@prydin
prydin / prevent_powerdown.py
Last active January 6, 2022 15:16
Prevent power down on change
import json
def handler(context, inputs):
# We only care about updates
if inputs["eventType"] != "UPDATE_DEPLOYMENT":
return inputs
result = context.request("/blueprint/api/blueprint-requests/%s/resources-plan?expand=true" % inputs["id"], "GET", "")
if result["status"] != 200:
raise Exception(result["content"])
envelope = json.loads(result["content"])
@prydin
prydin / gist:0ce7afd7b5ee36af845ccad8555c4d87
Created December 15, 2021 20:59
Enable ABX custom resources
import json
def handler(context, inputs):
payload = {
"key": "enable.custom.resource.user-defined-schema",
"value": "true"
}
print(context.request("/provisioning/config/toggles", "POST", json.dumps(payload)))
@prydin
prydin / metrics.json
Created March 26, 2021 00:01
Sample VM metric dump
{
"resources": [
{
"metrics": [
{
"name": "virtualDisk:scsi0:1|totalReadLatency_average",
"samples": [
{
"t": 1616713319999,
"v": 0.7333333492279053
@prydin
prydin / mvn.log
Created September 30, 2020 12:22
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for io.jenkins.plugins:vrealize-automation-8:hpi:1.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.jenkinsci.plugins:pipeline-model-definition:jar -> duplicate declaration of version ${pipeline-model-definition-plugin.version} @ line 154, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
<settings>
<pluginGroups>
<pluginGroup>org.jenkins-ci.tools</pluginGroup>
</pluginGroups>
<profiles>
<!-- Give access to Jenkins plugins -->
<profile>
<id>jenkins</id>
<activation>
@prydin
prydin / vra-terraform.log
Created August 21, 2020 15:36
vra-terraform.log
2020-08-21T11:09:58.029-04:00 vra7_client.go:56 DoRequest ▶ INFO 001 Check the status of the request https://vra7-01.pontus.lab/identity/api/tokens
The response is: 200
2020-08-21T11:09:58.045-04:00 resource_vra7_deployment.go:389 resourceVra7DeploymentRead ▶ INFO 002 Reading the resource vra7_deployment with request id 2ae51624-30c4-48a5-a85e-f697c0b995b1
2020-08-21T11:09:58.139-04:00 vra7_client.go:56 DoRequest ▶ INFO 003 Check the status of the request https://vra7-01.pontus.lab/identity/api/tokens
The response is: 200
2020-08-21T11:09:58.647-04:00 vra7_client.go:56 DoRequest ▶ INFO 004 Check the status of the request https://vra7-01.pontus.lab/catalog-service/api/consumer/requests/2ae51624-30c4-48a5-a85e-f697c0b995b1/resourceViews
The response is: 200
2020-08-21T11:09:58.657-04:00 resource_vra7_deployment.go:487 resourceVra7DeploymentRead ▶ INFO 005 Finished reading the resource vra7_deployment with request id 2ae51624-30c4-48a5-a85e-f697c0b995b1. Resources found: 1
2020-08-21T11:09:58.885-04:00
@prydin
prydin / correct-terraform.tfstat
Created August 21, 2020 15:07
Correct output
{
"version": 4,
"terraform_version": "0.12.24",
"serial": 4,
"lineage": "9edec340-c628-cc69-9151-74d3434fc461",
"outputs": {
"test3": {
"value": {
"ip": "192.168.1.9"
},
@prydin
prydin / incorrect-terraform.tfstate
Created August 21, 2020 14:44
Terraform state missing resource information
{
"version": 4,
"terraform_version": "0.12.24",
"serial": 4,
"lineage": "bd18c211-d319-82a0-4c37-92cd785fe908",
"outputs": {
"test3": {
"value": {},
"type": [
"object",