Esempio n. 1
0
import k5lib

# Create a log file
k5lib.create_logfile('connect_network_connector_endpoint.log')

username = env['OS_USERNAME']
password = env['OS_PASSWORD']
domain = env['OS_USER_DOMAIN_NAME']
projectName = env['OS_PROJECT_NAME']
region = env['OS_REGION_NAME']
az = 'fi-1a'

securityGroupId = '91630e71-2555-4dcb-a720-0dd3c643f478'
networkId = '6809bf51-a224-4f16-a77e-754c3033b1b6'

endpointName01 = 'mhaNetworkConnector-ep' + k5lib.gen_passwd(6)
print(endpointName01)

connectorName = 'mhaNetworkConnector-' + k5lib.gen_passwd(6)
print(connectorName)

portName = 'mha-port-' + k5lib.gen_passwd(6)
print(portName)

projectToken = k5lib.get_project_token(username, password, domain, projectName,
                                       region)
projectId = k5lib.get_project_id(username, password, domain, projectName,
                                 region)

print('networkconnector')
# Create new connector
Esempio n. 2
0
from os import environ as env
import sys
import logging
sys.path.append('k5lib')
import k5lib

username = env['OS_USERNAME']
password = env['OS_PASSWORD']
domain = env['OS_USER_DOMAIN_NAME']
region = env['OS_REGION_NAME']
projectName = env['OS_PROJECT_NAME']
securityGroupName = 'foobar-security-group-' + k5lib.gen_passwd(6)
az = 'fi-1a'

# Create a log file
k5lib.create_logfile('create_security_group.log')

project_token = k5lib.get_project_token(username, password, domain, projectName, region)
securityGroupId = k5lib.create_security_group(project_token, region, securityGroupName, 'Testgroup' )
logging.info('Security group ID: ' + securityGroupId)
print('Security group ID: ', securityGroupId)

securityGroupRuleId = k5lib.create_security_group_rule(project_token, region, securityGroupId, 'ingress', 'IPv4', 'tcp', '8080', '8080', '0.0.0.0/0',  None)
logging.info('Security group rule ID: ' + securityGroupRuleId)
print('Security group rule ID: ', securityGroupRuleId)
Esempio n. 3
0
from os import environ as env
import sys
sys.path.append('k5lib')
import k5lib
import json

########################################################################################################################
# Parameters
########################################################################################################################
# Change these according your enviroment
az = 'fi-1a'
server_name = 'Dedicatet_server-' + k5lib.gen_passwd(6)
flavor_name = 'S-2'
keypair_name = 'keypair'
security_group_name = 'default'
image_name = 'Windows Server 2012 R2 SE 64bit (English) 02'
disk_size = '100'
network_name = 'network'
ip = '10.10.10.10'

########################################################################################################################
# Actions ..
########################################################################################################################
# Create a log file
k5lib.create_logfile('create_server.log')

username = env['OS_USERNAME']
password = env['OS_PASSWORD']
domain = env['OS_USER_DOMAIN_NAME']
projectName = env['OS_PROJECT_NAME']
region = env['OS_REGION_NAME']
Esempio n. 4
0
from os import environ as env
import sys
sys.path.append('k5lib')
import k5lib

username = env['OS_USERNAME']
password = env['OS_PASSWORD']
domain = env['OS_USER_DOMAIN_NAME']
region = env['OS_REGION_NAME']
projectName = env['OS_PROJECT_NAME']
networkName = 'foobar-network-' + k5lib.gen_passwd(6)
az = 'fi-1a'

# Create a log file
k5lib.create_logfile('create_network.log')


projectToken = k5lib.get_project_token(username, password, domain, projectName, region)
network = k5lib.create_network(projectToken, region, az, networkName)
print(network)