Пример #1
0
def describe_network(network_id):
    '''
    https://www.conoha.jp/docs/neutron-get_networks_detail_specified.php
    '''
    headers = {
        'Accept': 'application/json',
        'X-Auth-Token': config.get_token()['id']
    }
    return http.get(f'{endpoint}/networks/{network_id}', headers)
Пример #2
0
def list_security_group_rules():
    '''
    https://www.conoha.jp/docs/neutron-get_rules_on_secgroup.php
    '''
    headers = {
        'Accept': 'application/json',
        'X-Auth-Token': config.get_token()['id']
    }
    return http.get(f'{endpoint}/security-group-rules', headers)
Пример #3
0
def describe_security_group_rule(rule_id):
    '''
    https://www.conoha.jp/docs/neutron-get_rules_detail_specified.php
    '''
    headers = {
        'Accept': 'application/json',
        'X-Auth-Token': config.get_token()['id']
    }
    return http.get(f'{endpoint}/security-group-rules/{rule_id}', headers)
Пример #4
0
def list_subnets():
    '''
    https://www.conoha.jp/docs/neutron-get_subnets_list.php
    '''
    headers = {
        'Accept': 'application/json',
        'X-Auth-Token': config.get_token()['id']
    }
    return http.get(f'{endpoint}/subnets', headers)
Пример #5
0
def describe_server(server_id):
    '''
    https://www.conoha.jp/docs/compute-get_vms_detail_specified.php
    '''
    headers = {
        'Accept': 'application/json',
        'X-Auth-Token': config.get_token()['id']
    }
    return http.get(f'{endpoint}/servers/{server_id}', headers)
Пример #6
0
def list_servers_detail():
    '''
    詳細表示: https://www.conoha.jp/docs/compute-get_vms_detail.php
    '''
    headers = {
        'Accept': 'application/json',
        'X-Auth-Token': config.get_token()['id']
    }
    return http.get(f'{endpoint}/servers/detail', headers)
Пример #7
0
def list_images():
    '''
    https://www.conoha.jp/docs/compute-get_images_list.php
    '''
    headers = {
        'Accept': 'application/json',
        'X-Auth-Token': config.get_token()['id']
    }
    return http.get(f'{endpoint}/images', headers)
Пример #8
0
def list_ports(server_id):
    '''
    https://www.conoha.jp/docs/compute-get_attached_ports_list.php
    '''
    headers = {
        'Accept': 'application/json',
        'X-Auth-Token': config.get_token()['id']
    }
    return http.get(f'{endpoint}/servers/{server_id}/os-interface', headers)