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
import requests | |
import xml.dom.minidom | |
restHost = 'https://nsxhost.domain.priv' | |
baseEndpoint = '/api/4.0/firewall/globalroot-0/config/layer3sections' | |
userName = 'nsxuser@domain.priv' | |
userPass = 'nsxpass' | |
sectionName = 'My Section' |
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
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
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
# Possible values are: | |
# 'enable' to ensure HTTPS certificate verification is enabled by default | |
# 'disable' to ensure HTTPS certificate verification is disabled by default | |
# 'platform_default' to delegate the decision to the redistributor providing this particular Python version | |
# For more info refer to https://www.python.org/dev/peps/pep-0493/ | |
[https] | |
verify=disable |
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
<?xml version="1.0"?> | |
<repository-version xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="version_definition.xsd"> | |
<release> | |
<type>STANDARD</type> | |
<stack-id>HDP-2.6</stack-id> | |
<version>2.6.5.0</version> | |
<build>292</build> | |
<compatible-with>2\.[3-6]\.\d+\.\d+</compatible-with> | |
<release-notes>http://example.com</release-notes> | |
<display>HDP-2.6.5.0</display> |
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
{ "VersionDefinition": { "version_url": "http://repo.server.fqdn/HDP-2.6.5.0-292.xml" } } |
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
curl -v -k -u admin:admin -H "X-Requested-By: ambari" -X POST http://ambari.server.fqdn:8080/api/v1/version_definitions -d @version-definitions.json |
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
{ | |
"resources" : [ | |
{ | |
"href" : "http://ambari.server.fqdn/api/v1/version_definitions/1", | |
"VersionDefinition" : { | |
"id" : 1, | |
"stack_name" : "HDP", | |
"stack_version" : "2.6" | |
} | |
} |
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 setVmMemory { | |
Param( | |
[parameter(Mandatory=$true)] | |
[String] | |
$Pattern, | |
[parameter(Mandatory=$true)] | |
[Byte] | |
$MemoryGB | |
) |
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 addUsersToGroup { | |
Param( | |
[parameter(Mandatory=$true)] | |
[String] | |
$InputFile | |
) | |
$a = import-csv -header utente,gruppo -path $InputFile | |
foreach ($row in $a) { | |
Add-ADGroupMember -members $row.utente -identity $row.gruppo |
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
#!/usr/bin/python | |
# | |
# Usage example: | |
# jps|./extractPorts.py|bash | |
# | |
import sys | |
f = sys.stdin | |
# If you need to open a file instead: | |
#f = open('your.file') |
OlderNewer