partition
stringclasses 3
values | func_name
stringlengths 1
134
| docstring
stringlengths 1
46.9k
| path
stringlengths 4
223
| original_string
stringlengths 75
104k
| code
stringlengths 75
104k
| docstring_tokens
listlengths 1
1.97k
| repo
stringlengths 7
55
| language
stringclasses 1
value | url
stringlengths 87
315
| code_tokens
listlengths 19
28.4k
| sha
stringlengths 40
40
|
|---|---|---|---|---|---|---|---|---|---|---|---|
test
|
_ServiceBusManagementXmlSerializer.xml_to_namespace
|
Converts xml response to service bus namespace
The xml format for namespace:
<entry>
<id>uuid:00000000-0000-0000-0000-000000000000;id=0000000</id>
<title type="text">myunittests</title>
<updated>2012-08-22T16:48:10Z</updated>
<content type="application/xml">
<NamespaceDescription
xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>myunittests</Name>
<Region>West US</Region>
<DefaultKey>0000000000000000000000000000000000000000000=</DefaultKey>
<Status>Active</Status>
<CreatedAt>2012-08-22T16:48:10.217Z</CreatedAt>
<AcsManagementEndpoint>https://myunittests-sb.accesscontrol.windows.net/</AcsManagementEndpoint>
<ServiceBusEndpoint>https://myunittests.servicebus.windows.net/</ServiceBusEndpoint>
<ConnectionString>Endpoint=sb://myunittests.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=0000000000000000000000000000000000000000000=</ConnectionString>
<SubscriptionId>00000000000000000000000000000000</SubscriptionId>
<Enabled>true</Enabled>
</NamespaceDescription>
</content>
</entry>
|
azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py
|
def xml_to_namespace(xmlstr):
'''Converts xml response to service bus namespace
The xml format for namespace:
<entry>
<id>uuid:00000000-0000-0000-0000-000000000000;id=0000000</id>
<title type="text">myunittests</title>
<updated>2012-08-22T16:48:10Z</updated>
<content type="application/xml">
<NamespaceDescription
xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>myunittests</Name>
<Region>West US</Region>
<DefaultKey>0000000000000000000000000000000000000000000=</DefaultKey>
<Status>Active</Status>
<CreatedAt>2012-08-22T16:48:10.217Z</CreatedAt>
<AcsManagementEndpoint>https://myunittests-sb.accesscontrol.windows.net/</AcsManagementEndpoint>
<ServiceBusEndpoint>https://myunittests.servicebus.windows.net/</ServiceBusEndpoint>
<ConnectionString>Endpoint=sb://myunittests.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=0000000000000000000000000000000000000000000=</ConnectionString>
<SubscriptionId>00000000000000000000000000000000</SubscriptionId>
<Enabled>true</Enabled>
</NamespaceDescription>
</content>
</entry>
'''
xmldoc = minidom.parseString(xmlstr)
namespace = ServiceBusNamespace()
mappings = (
('Name', 'name', None),
('Region', 'region', None),
('DefaultKey', 'default_key', None),
('Status', 'status', None),
('CreatedAt', 'created_at', None),
('AcsManagementEndpoint', 'acs_management_endpoint', None),
('ServiceBusEndpoint', 'servicebus_endpoint', None),
('ConnectionString', 'connection_string', None),
('SubscriptionId', 'subscription_id', None),
('Enabled', 'enabled', _parse_bool),
)
for desc in _MinidomXmlToObject.get_children_from_path(
xmldoc,
'entry',
'content',
'NamespaceDescription'):
for xml_name, field_name, conversion_func in mappings:
node_value = _MinidomXmlToObject.get_first_child_node_value(desc, xml_name)
if node_value is not None:
if conversion_func is not None:
node_value = conversion_func(node_value)
setattr(namespace, field_name, node_value)
return namespace
|
def xml_to_namespace(xmlstr):
'''Converts xml response to service bus namespace
The xml format for namespace:
<entry>
<id>uuid:00000000-0000-0000-0000-000000000000;id=0000000</id>
<title type="text">myunittests</title>
<updated>2012-08-22T16:48:10Z</updated>
<content type="application/xml">
<NamespaceDescription
xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>myunittests</Name>
<Region>West US</Region>
<DefaultKey>0000000000000000000000000000000000000000000=</DefaultKey>
<Status>Active</Status>
<CreatedAt>2012-08-22T16:48:10.217Z</CreatedAt>
<AcsManagementEndpoint>https://myunittests-sb.accesscontrol.windows.net/</AcsManagementEndpoint>
<ServiceBusEndpoint>https://myunittests.servicebus.windows.net/</ServiceBusEndpoint>
<ConnectionString>Endpoint=sb://myunittests.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=0000000000000000000000000000000000000000000=</ConnectionString>
<SubscriptionId>00000000000000000000000000000000</SubscriptionId>
<Enabled>true</Enabled>
</NamespaceDescription>
</content>
</entry>
'''
xmldoc = minidom.parseString(xmlstr)
namespace = ServiceBusNamespace()
mappings = (
('Name', 'name', None),
('Region', 'region', None),
('DefaultKey', 'default_key', None),
('Status', 'status', None),
('CreatedAt', 'created_at', None),
('AcsManagementEndpoint', 'acs_management_endpoint', None),
('ServiceBusEndpoint', 'servicebus_endpoint', None),
('ConnectionString', 'connection_string', None),
('SubscriptionId', 'subscription_id', None),
('Enabled', 'enabled', _parse_bool),
)
for desc in _MinidomXmlToObject.get_children_from_path(
xmldoc,
'entry',
'content',
'NamespaceDescription'):
for xml_name, field_name, conversion_func in mappings:
node_value = _MinidomXmlToObject.get_first_child_node_value(desc, xml_name)
if node_value is not None:
if conversion_func is not None:
node_value = conversion_func(node_value)
setattr(namespace, field_name, node_value)
return namespace
|
[
"Converts",
"xml",
"response",
"to",
"service",
"bus",
"namespace"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py#L1439-L1493
|
[
"def",
"xml_to_namespace",
"(",
"xmlstr",
")",
":",
"xmldoc",
"=",
"minidom",
".",
"parseString",
"(",
"xmlstr",
")",
"namespace",
"=",
"ServiceBusNamespace",
"(",
")",
"mappings",
"=",
"(",
"(",
"'Name'",
",",
"'name'",
",",
"None",
")",
",",
"(",
"'Region'",
",",
"'region'",
",",
"None",
")",
",",
"(",
"'DefaultKey'",
",",
"'default_key'",
",",
"None",
")",
",",
"(",
"'Status'",
",",
"'status'",
",",
"None",
")",
",",
"(",
"'CreatedAt'",
",",
"'created_at'",
",",
"None",
")",
",",
"(",
"'AcsManagementEndpoint'",
",",
"'acs_management_endpoint'",
",",
"None",
")",
",",
"(",
"'ServiceBusEndpoint'",
",",
"'servicebus_endpoint'",
",",
"None",
")",
",",
"(",
"'ConnectionString'",
",",
"'connection_string'",
",",
"None",
")",
",",
"(",
"'SubscriptionId'",
",",
"'subscription_id'",
",",
"None",
")",
",",
"(",
"'Enabled'",
",",
"'enabled'",
",",
"_parse_bool",
")",
",",
")",
"for",
"desc",
"in",
"_MinidomXmlToObject",
".",
"get_children_from_path",
"(",
"xmldoc",
",",
"'entry'",
",",
"'content'",
",",
"'NamespaceDescription'",
")",
":",
"for",
"xml_name",
",",
"field_name",
",",
"conversion_func",
"in",
"mappings",
":",
"node_value",
"=",
"_MinidomXmlToObject",
".",
"get_first_child_node_value",
"(",
"desc",
",",
"xml_name",
")",
"if",
"node_value",
"is",
"not",
"None",
":",
"if",
"conversion_func",
"is",
"not",
"None",
":",
"node_value",
"=",
"conversion_func",
"(",
"node_value",
")",
"setattr",
"(",
"namespace",
",",
"field_name",
",",
"node_value",
")",
"return",
"namespace"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
_ServiceBusManagementXmlSerializer.xml_to_region
|
Converts xml response to service bus region
The xml format for region:
<entry>
<id>uuid:157c311f-081f-4b4a-a0ba-a8f990ffd2a3;id=1756759</id>
<title type="text"></title>
<updated>2013-04-10T18:25:29Z</updated>
<content type="application/xml">
<RegionCodeDescription
xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>East Asia</Code>
<FullName>East Asia</FullName>
</RegionCodeDescription>
</content>
</entry>
|
azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py
|
def xml_to_region(xmlstr):
'''Converts xml response to service bus region
The xml format for region:
<entry>
<id>uuid:157c311f-081f-4b4a-a0ba-a8f990ffd2a3;id=1756759</id>
<title type="text"></title>
<updated>2013-04-10T18:25:29Z</updated>
<content type="application/xml">
<RegionCodeDescription
xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>East Asia</Code>
<FullName>East Asia</FullName>
</RegionCodeDescription>
</content>
</entry>
'''
xmldoc = minidom.parseString(xmlstr)
region = ServiceBusRegion()
for desc in _MinidomXmlToObject.get_children_from_path(xmldoc, 'entry', 'content',
'RegionCodeDescription'):
node_value = _MinidomXmlToObject.get_first_child_node_value(desc, 'Code')
if node_value is not None:
region.code = node_value
node_value = _MinidomXmlToObject.get_first_child_node_value(desc, 'FullName')
if node_value is not None:
region.fullname = node_value
return region
|
def xml_to_region(xmlstr):
'''Converts xml response to service bus region
The xml format for region:
<entry>
<id>uuid:157c311f-081f-4b4a-a0ba-a8f990ffd2a3;id=1756759</id>
<title type="text"></title>
<updated>2013-04-10T18:25:29Z</updated>
<content type="application/xml">
<RegionCodeDescription
xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>East Asia</Code>
<FullName>East Asia</FullName>
</RegionCodeDescription>
</content>
</entry>
'''
xmldoc = minidom.parseString(xmlstr)
region = ServiceBusRegion()
for desc in _MinidomXmlToObject.get_children_from_path(xmldoc, 'entry', 'content',
'RegionCodeDescription'):
node_value = _MinidomXmlToObject.get_first_child_node_value(desc, 'Code')
if node_value is not None:
region.code = node_value
node_value = _MinidomXmlToObject.get_first_child_node_value(desc, 'FullName')
if node_value is not None:
region.fullname = node_value
return region
|
[
"Converts",
"xml",
"response",
"to",
"service",
"bus",
"region"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py#L1496-L1526
|
[
"def",
"xml_to_region",
"(",
"xmlstr",
")",
":",
"xmldoc",
"=",
"minidom",
".",
"parseString",
"(",
"xmlstr",
")",
"region",
"=",
"ServiceBusRegion",
"(",
")",
"for",
"desc",
"in",
"_MinidomXmlToObject",
".",
"get_children_from_path",
"(",
"xmldoc",
",",
"'entry'",
",",
"'content'",
",",
"'RegionCodeDescription'",
")",
":",
"node_value",
"=",
"_MinidomXmlToObject",
".",
"get_first_child_node_value",
"(",
"desc",
",",
"'Code'",
")",
"if",
"node_value",
"is",
"not",
"None",
":",
"region",
".",
"code",
"=",
"node_value",
"node_value",
"=",
"_MinidomXmlToObject",
".",
"get_first_child_node_value",
"(",
"desc",
",",
"'FullName'",
")",
"if",
"node_value",
"is",
"not",
"None",
":",
"region",
".",
"fullname",
"=",
"node_value",
"return",
"region"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
_ServiceBusManagementXmlSerializer.xml_to_namespace_availability
|
Converts xml response to service bus namespace availability
The xml format:
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<id>uuid:9fc7c652-1856-47ab-8d74-cd31502ea8e6;id=3683292</id>
<title type="text"></title>
<updated>2013-04-16T03:03:37Z</updated>
<content type="application/xml">
<NamespaceAvailability
xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Result>false</Result>
</NamespaceAvailability>
</content>
</entry>
|
azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py
|
def xml_to_namespace_availability(xmlstr):
'''Converts xml response to service bus namespace availability
The xml format:
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<id>uuid:9fc7c652-1856-47ab-8d74-cd31502ea8e6;id=3683292</id>
<title type="text"></title>
<updated>2013-04-16T03:03:37Z</updated>
<content type="application/xml">
<NamespaceAvailability
xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Result>false</Result>
</NamespaceAvailability>
</content>
</entry>
'''
xmldoc = minidom.parseString(xmlstr)
availability = AvailabilityResponse()
for desc in _MinidomXmlToObject.get_children_from_path(xmldoc, 'entry', 'content',
'NamespaceAvailability'):
node_value = _MinidomXmlToObject.get_first_child_node_value(desc, 'Result')
if node_value is not None:
availability.result = _parse_bool(node_value)
return availability
|
def xml_to_namespace_availability(xmlstr):
'''Converts xml response to service bus namespace availability
The xml format:
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<id>uuid:9fc7c652-1856-47ab-8d74-cd31502ea8e6;id=3683292</id>
<title type="text"></title>
<updated>2013-04-16T03:03:37Z</updated>
<content type="application/xml">
<NamespaceAvailability
xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Result>false</Result>
</NamespaceAvailability>
</content>
</entry>
'''
xmldoc = minidom.parseString(xmlstr)
availability = AvailabilityResponse()
for desc in _MinidomXmlToObject.get_children_from_path(xmldoc, 'entry', 'content',
'NamespaceAvailability'):
node_value = _MinidomXmlToObject.get_first_child_node_value(desc, 'Result')
if node_value is not None:
availability.result = _parse_bool(node_value)
return availability
|
[
"Converts",
"xml",
"response",
"to",
"service",
"bus",
"namespace",
"availability"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py#L1529-L1556
|
[
"def",
"xml_to_namespace_availability",
"(",
"xmlstr",
")",
":",
"xmldoc",
"=",
"minidom",
".",
"parseString",
"(",
"xmlstr",
")",
"availability",
"=",
"AvailabilityResponse",
"(",
")",
"for",
"desc",
"in",
"_MinidomXmlToObject",
".",
"get_children_from_path",
"(",
"xmldoc",
",",
"'entry'",
",",
"'content'",
",",
"'NamespaceAvailability'",
")",
":",
"node_value",
"=",
"_MinidomXmlToObject",
".",
"get_first_child_node_value",
"(",
"desc",
",",
"'Result'",
")",
"if",
"node_value",
"is",
"not",
"None",
":",
"availability",
".",
"result",
"=",
"_parse_bool",
"(",
"node_value",
")",
"return",
"availability"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
_ServiceBusManagementXmlSerializer.odata_converter
|
Convert odata type
http://www.odata.org/documentation/odata-version-2-0/overview#AbstractTypeSystem
To be completed
|
azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py
|
def odata_converter(data, str_type):
''' Convert odata type
http://www.odata.org/documentation/odata-version-2-0/overview#AbstractTypeSystem
To be completed
'''
if not str_type:
return _str(data)
if str_type in ["Edm.Single", "Edm.Double"]:
return float(data)
elif "Edm.Int" in str_type:
return int(data)
else:
return _str(data)
|
def odata_converter(data, str_type):
''' Convert odata type
http://www.odata.org/documentation/odata-version-2-0/overview#AbstractTypeSystem
To be completed
'''
if not str_type:
return _str(data)
if str_type in ["Edm.Single", "Edm.Double"]:
return float(data)
elif "Edm.Int" in str_type:
return int(data)
else:
return _str(data)
|
[
"Convert",
"odata",
"type",
"http",
":",
"//",
"www",
".",
"odata",
".",
"org",
"/",
"documentation",
"/",
"odata",
"-",
"version",
"-",
"2",
"-",
"0",
"/",
"overview#AbstractTypeSystem",
"To",
"be",
"completed"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py#L1559-L1571
|
[
"def",
"odata_converter",
"(",
"data",
",",
"str_type",
")",
":",
"if",
"not",
"str_type",
":",
"return",
"_str",
"(",
"data",
")",
"if",
"str_type",
"in",
"[",
"\"Edm.Single\"",
",",
"\"Edm.Double\"",
"]",
":",
"return",
"float",
"(",
"data",
")",
"elif",
"\"Edm.Int\"",
"in",
"str_type",
":",
"return",
"int",
"(",
"data",
")",
"else",
":",
"return",
"_str",
"(",
"data",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
_ServiceBusManagementXmlSerializer.xml_to_metrics
|
Converts xml response to service bus metrics objects
The xml format for MetricProperties
<entry>
<id>https://sbgm.windows.net/Metrics(\'listeners.active\')</id>
<title/>
<updated>2014-10-09T11:56:50Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:Name>listeners.active</d:Name>
<d:PrimaryAggregation>Average</d:PrimaryAggregation>
<d:Unit>Count</d:Unit>
<d:DisplayName>Active listeners</d:DisplayName>
</m:properties>
</content>
</entry>
The xml format for MetricValues
<entry>
<id>https://sbgm.windows.net/MetricValues(datetime\'2014-10-02T00:00:00Z\')</id>
<title/>
<updated>2014-10-09T18:38:28Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:Timestamp m:type="Edm.DateTime">2014-10-02T00:00:00Z</d:Timestamp>
<d:Min m:type="Edm.Int64">-118</d:Min>
<d:Max m:type="Edm.Int64">15</d:Max>
<d:Average m:type="Edm.Single">-78.44444</d:Average>
<d:Total m:type="Edm.Int64">0</d:Total>
</m:properties>
</content>
</entry>
|
azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py
|
def xml_to_metrics(xmlstr, object_type):
'''Converts xml response to service bus metrics objects
The xml format for MetricProperties
<entry>
<id>https://sbgm.windows.net/Metrics(\'listeners.active\')</id>
<title/>
<updated>2014-10-09T11:56:50Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:Name>listeners.active</d:Name>
<d:PrimaryAggregation>Average</d:PrimaryAggregation>
<d:Unit>Count</d:Unit>
<d:DisplayName>Active listeners</d:DisplayName>
</m:properties>
</content>
</entry>
The xml format for MetricValues
<entry>
<id>https://sbgm.windows.net/MetricValues(datetime\'2014-10-02T00:00:00Z\')</id>
<title/>
<updated>2014-10-09T18:38:28Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:Timestamp m:type="Edm.DateTime">2014-10-02T00:00:00Z</d:Timestamp>
<d:Min m:type="Edm.Int64">-118</d:Min>
<d:Max m:type="Edm.Int64">15</d:Max>
<d:Average m:type="Edm.Single">-78.44444</d:Average>
<d:Total m:type="Edm.Int64">0</d:Total>
</m:properties>
</content>
</entry>
'''
xmldoc = minidom.parseString(xmlstr)
return_obj = object_type()
members = dict(vars(return_obj))
# Only one entry here
for xml_entry in _MinidomXmlToObject.get_children_from_path(xmldoc,
'entry'):
for node in _MinidomXmlToObject.get_children_from_path(xml_entry,
'content',
'properties'):
for name in members:
xml_name = _get_serialization_name(name)
children = _MinidomXmlToObject.get_child_nodes(node, xml_name)
if not children:
continue
child = children[0]
node_type = child.getAttributeNS("http://schemas.microsoft.com/ado/2007/08/dataservices/metadata", 'type')
node_value = _ServiceBusManagementXmlSerializer.odata_converter(child.firstChild.nodeValue, node_type)
setattr(return_obj, name, node_value)
for name, value in _MinidomXmlToObject.get_entry_properties_from_node(
xml_entry,
include_id=True,
use_title_as_id=False).items():
if name in members:
continue # Do not override if already members
setattr(return_obj, name, value)
return return_obj
|
def xml_to_metrics(xmlstr, object_type):
'''Converts xml response to service bus metrics objects
The xml format for MetricProperties
<entry>
<id>https://sbgm.windows.net/Metrics(\'listeners.active\')</id>
<title/>
<updated>2014-10-09T11:56:50Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:Name>listeners.active</d:Name>
<d:PrimaryAggregation>Average</d:PrimaryAggregation>
<d:Unit>Count</d:Unit>
<d:DisplayName>Active listeners</d:DisplayName>
</m:properties>
</content>
</entry>
The xml format for MetricValues
<entry>
<id>https://sbgm.windows.net/MetricValues(datetime\'2014-10-02T00:00:00Z\')</id>
<title/>
<updated>2014-10-09T18:38:28Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:Timestamp m:type="Edm.DateTime">2014-10-02T00:00:00Z</d:Timestamp>
<d:Min m:type="Edm.Int64">-118</d:Min>
<d:Max m:type="Edm.Int64">15</d:Max>
<d:Average m:type="Edm.Single">-78.44444</d:Average>
<d:Total m:type="Edm.Int64">0</d:Total>
</m:properties>
</content>
</entry>
'''
xmldoc = minidom.parseString(xmlstr)
return_obj = object_type()
members = dict(vars(return_obj))
# Only one entry here
for xml_entry in _MinidomXmlToObject.get_children_from_path(xmldoc,
'entry'):
for node in _MinidomXmlToObject.get_children_from_path(xml_entry,
'content',
'properties'):
for name in members:
xml_name = _get_serialization_name(name)
children = _MinidomXmlToObject.get_child_nodes(node, xml_name)
if not children:
continue
child = children[0]
node_type = child.getAttributeNS("http://schemas.microsoft.com/ado/2007/08/dataservices/metadata", 'type')
node_value = _ServiceBusManagementXmlSerializer.odata_converter(child.firstChild.nodeValue, node_type)
setattr(return_obj, name, node_value)
for name, value in _MinidomXmlToObject.get_entry_properties_from_node(
xml_entry,
include_id=True,
use_title_as_id=False).items():
if name in members:
continue # Do not override if already members
setattr(return_obj, name, value)
return return_obj
|
[
"Converts",
"xml",
"response",
"to",
"service",
"bus",
"metrics",
"objects"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py#L1574-L1642
|
[
"def",
"xml_to_metrics",
"(",
"xmlstr",
",",
"object_type",
")",
":",
"xmldoc",
"=",
"minidom",
".",
"parseString",
"(",
"xmlstr",
")",
"return_obj",
"=",
"object_type",
"(",
")",
"members",
"=",
"dict",
"(",
"vars",
"(",
"return_obj",
")",
")",
"# Only one entry here",
"for",
"xml_entry",
"in",
"_MinidomXmlToObject",
".",
"get_children_from_path",
"(",
"xmldoc",
",",
"'entry'",
")",
":",
"for",
"node",
"in",
"_MinidomXmlToObject",
".",
"get_children_from_path",
"(",
"xml_entry",
",",
"'content'",
",",
"'properties'",
")",
":",
"for",
"name",
"in",
"members",
":",
"xml_name",
"=",
"_get_serialization_name",
"(",
"name",
")",
"children",
"=",
"_MinidomXmlToObject",
".",
"get_child_nodes",
"(",
"node",
",",
"xml_name",
")",
"if",
"not",
"children",
":",
"continue",
"child",
"=",
"children",
"[",
"0",
"]",
"node_type",
"=",
"child",
".",
"getAttributeNS",
"(",
"\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\"",
",",
"'type'",
")",
"node_value",
"=",
"_ServiceBusManagementXmlSerializer",
".",
"odata_converter",
"(",
"child",
".",
"firstChild",
".",
"nodeValue",
",",
"node_type",
")",
"setattr",
"(",
"return_obj",
",",
"name",
",",
"node_value",
")",
"for",
"name",
",",
"value",
"in",
"_MinidomXmlToObject",
".",
"get_entry_properties_from_node",
"(",
"xml_entry",
",",
"include_id",
"=",
"True",
",",
"use_title_as_id",
"=",
"False",
")",
".",
"items",
"(",
")",
":",
"if",
"name",
"in",
"members",
":",
"continue",
"# Do not override if already members",
"setattr",
"(",
"return_obj",
",",
"name",
",",
"value",
")",
"return",
"return_obj"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
_SchedulerManagementXmlSerializer.create_cloud_service_to_xml
|
<CloudService xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">
<Label>MyApp3</Label>
<Description>My Cloud Service for app3</Description>
<GeoRegion>South Central US</GeoRegion>
</CloudService>
|
azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py
|
def create_cloud_service_to_xml(label, description, geo_region):
'''
<CloudService xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">
<Label>MyApp3</Label>
<Description>My Cloud Service for app3</Description>
<GeoRegion>South Central US</GeoRegion>
</CloudService>
'''
body = '<CloudService xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">'
body += ''.join(['<Label>', label, '</Label>'])
body += ''.join(['<Description>', description, '</Description>'])
body += ''.join(['<GeoRegion>', geo_region, '</GeoRegion>'])
body += '</CloudService>'
return body
|
def create_cloud_service_to_xml(label, description, geo_region):
'''
<CloudService xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">
<Label>MyApp3</Label>
<Description>My Cloud Service for app3</Description>
<GeoRegion>South Central US</GeoRegion>
</CloudService>
'''
body = '<CloudService xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">'
body += ''.join(['<Label>', label, '</Label>'])
body += ''.join(['<Description>', description, '</Description>'])
body += ''.join(['<GeoRegion>', geo_region, '</GeoRegion>'])
body += '</CloudService>'
return body
|
[
"<CloudService",
"xmlns",
":",
"i",
"=",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"2001",
"/",
"XMLSchema",
"-",
"instance",
"xmlns",
"=",
"http",
":",
"//",
"schemas",
".",
"microsoft",
".",
"com",
"/",
"windowsazure",
">",
"<Label",
">",
"MyApp3<",
"/",
"Label",
">",
"<Description",
">",
"My",
"Cloud",
"Service",
"for",
"app3<",
"/",
"Description",
">",
"<GeoRegion",
">",
"South",
"Central",
"US<",
"/",
"GeoRegion",
">",
"<",
"/",
"CloudService",
">"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py#L1648-L1662
|
[
"def",
"create_cloud_service_to_xml",
"(",
"label",
",",
"description",
",",
"geo_region",
")",
":",
"body",
"=",
"'<CloudService xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.microsoft.com/windowsazure\">'",
"body",
"+=",
"''",
".",
"join",
"(",
"[",
"'<Label>'",
",",
"label",
",",
"'</Label>'",
"]",
")",
"body",
"+=",
"''",
".",
"join",
"(",
"[",
"'<Description>'",
",",
"description",
",",
"'</Description>'",
"]",
")",
"body",
"+=",
"''",
".",
"join",
"(",
"[",
"'<GeoRegion>'",
",",
"geo_region",
",",
"'</GeoRegion>'",
"]",
")",
"body",
"+=",
"'</CloudService>'",
"return",
"body"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
_SchedulerManagementXmlSerializer.create_job_collection_to_xml
|
<Resource xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">
<IntrinsicSettings>
<Plan>Standard</Plan>
<Quota>
<MaxJobCount>10</MaxJobCount>
<MaxRecurrence>
<Frequency>Second</Frequency>
<Interval>1</Interval>
</MaxRecurrence>
</Quota>
</IntrinsicSettings>
</Resource>
|
azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py
|
def create_job_collection_to_xml(plan):
'''
<Resource xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">
<IntrinsicSettings>
<Plan>Standard</Plan>
<Quota>
<MaxJobCount>10</MaxJobCount>
<MaxRecurrence>
<Frequency>Second</Frequency>
<Interval>1</Interval>
</MaxRecurrence>
</Quota>
</IntrinsicSettings>
</Resource>
'''
if plan not in ["Free", "Standard"]:
raise ValueError("Plan: Invalid option must be 'Standard' or 'Free'")
body = '<Resource xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure"><IntrinsicSettings>'
body += ''.join(['<plan>', plan, '</plan>'])
body += '</IntrinsicSettings></Resource>'
return body
|
def create_job_collection_to_xml(plan):
'''
<Resource xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">
<IntrinsicSettings>
<Plan>Standard</Plan>
<Quota>
<MaxJobCount>10</MaxJobCount>
<MaxRecurrence>
<Frequency>Second</Frequency>
<Interval>1</Interval>
</MaxRecurrence>
</Quota>
</IntrinsicSettings>
</Resource>
'''
if plan not in ["Free", "Standard"]:
raise ValueError("Plan: Invalid option must be 'Standard' or 'Free'")
body = '<Resource xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure"><IntrinsicSettings>'
body += ''.join(['<plan>', plan, '</plan>'])
body += '</IntrinsicSettings></Resource>'
return body
|
[
"<Resource",
"xmlns",
":",
"i",
"=",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"2001",
"/",
"XMLSchema",
"-",
"instance",
"xmlns",
"=",
"http",
":",
"//",
"schemas",
".",
"microsoft",
".",
"com",
"/",
"windowsazure",
">",
"<IntrinsicSettings",
">",
"<Plan",
">",
"Standard<",
"/",
"Plan",
">",
"<Quota",
">",
"<MaxJobCount",
">",
"10<",
"/",
"MaxJobCount",
">",
"<MaxRecurrence",
">",
"<Frequency",
">",
"Second<",
"/",
"Frequency",
">",
"<Interval",
">",
"1<",
"/",
"Interval",
">",
"<",
"/",
"MaxRecurrence",
">",
"<",
"/",
"Quota",
">",
"<",
"/",
"IntrinsicSettings",
">",
"<",
"/",
"Resource",
">"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/_serialization.py#L1665-L1688
|
[
"def",
"create_job_collection_to_xml",
"(",
"plan",
")",
":",
"if",
"plan",
"not",
"in",
"[",
"\"Free\"",
",",
"\"Standard\"",
"]",
":",
"raise",
"ValueError",
"(",
"\"Plan: Invalid option must be 'Standard' or 'Free'\"",
")",
"body",
"=",
"'<Resource xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.microsoft.com/windowsazure\"><IntrinsicSettings>'",
"body",
"+=",
"''",
".",
"join",
"(",
"[",
"'<plan>'",
",",
"plan",
",",
"'</plan>'",
"]",
")",
"body",
"+=",
"'</IntrinsicSettings></Resource>'",
"return",
"body"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ManagementLockClient.management_locks
|
Instance depends on the API version:
* 2015-01-01: :class:`ManagementLocksOperations<azure.mgmt.resource.locks.v2015_01_01.operations.ManagementLocksOperations>`
* 2016-09-01: :class:`ManagementLocksOperations<azure.mgmt.resource.locks.v2016_09_01.operations.ManagementLocksOperations>`
|
azure-mgmt-resource/azure/mgmt/resource/locks/management_lock_client.py
|
def management_locks(self):
"""Instance depends on the API version:
* 2015-01-01: :class:`ManagementLocksOperations<azure.mgmt.resource.locks.v2015_01_01.operations.ManagementLocksOperations>`
* 2016-09-01: :class:`ManagementLocksOperations<azure.mgmt.resource.locks.v2016_09_01.operations.ManagementLocksOperations>`
"""
api_version = self._get_api_version('management_locks')
if api_version == '2015-01-01':
from .v2015_01_01.operations import ManagementLocksOperations as OperationClass
elif api_version == '2016-09-01':
from .v2016_09_01.operations import ManagementLocksOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
|
def management_locks(self):
"""Instance depends on the API version:
* 2015-01-01: :class:`ManagementLocksOperations<azure.mgmt.resource.locks.v2015_01_01.operations.ManagementLocksOperations>`
* 2016-09-01: :class:`ManagementLocksOperations<azure.mgmt.resource.locks.v2016_09_01.operations.ManagementLocksOperations>`
"""
api_version = self._get_api_version('management_locks')
if api_version == '2015-01-01':
from .v2015_01_01.operations import ManagementLocksOperations as OperationClass
elif api_version == '2016-09-01':
from .v2016_09_01.operations import ManagementLocksOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
|
[
"Instance",
"depends",
"on",
"the",
"API",
"version",
":"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-mgmt-resource/azure/mgmt/resource/locks/management_lock_client.py#L124-L137
|
[
"def",
"management_locks",
"(",
"self",
")",
":",
"api_version",
"=",
"self",
".",
"_get_api_version",
"(",
"'management_locks'",
")",
"if",
"api_version",
"==",
"'2015-01-01'",
":",
"from",
".",
"v2015_01_01",
".",
"operations",
"import",
"ManagementLocksOperations",
"as",
"OperationClass",
"elif",
"api_version",
"==",
"'2016-09-01'",
":",
"from",
".",
"v2016_09_01",
".",
"operations",
"import",
"ManagementLocksOperations",
"as",
"OperationClass",
"else",
":",
"raise",
"NotImplementedError",
"(",
"\"APIVersion {} is not available\"",
".",
"format",
"(",
"api_version",
")",
")",
"return",
"OperationClass",
"(",
"self",
".",
"_client",
",",
"self",
".",
"config",
",",
"Serializer",
"(",
"self",
".",
"_models_dict",
"(",
"api_version",
")",
")",
",",
"Deserializer",
"(",
"self",
".",
"_models_dict",
"(",
"api_version",
")",
")",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
RunbookDraftOperations.replace_content
|
Replaces the runbook draft content.
:param resource_group_name: Name of an Azure Resource group.
:type resource_group_name: str
:param automation_account_name: The name of the automation account.
:type automation_account_name: str
:param runbook_name: The runbook name.
:type runbook_name: str
:param runbook_content: The runbook draft content.
:type runbook_content: Generator
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns object or
ClientRawResponse<object> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[Generator]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[Generator]]
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
|
azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py
|
def replace_content(
self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, callback=None, polling=True, **operation_config):
"""Replaces the runbook draft content.
:param resource_group_name: Name of an Azure Resource group.
:type resource_group_name: str
:param automation_account_name: The name of the automation account.
:type automation_account_name: str
:param runbook_name: The runbook name.
:type runbook_name: str
:param runbook_content: The runbook draft content.
:type runbook_content: Generator
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns object or
ClientRawResponse<object> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[Generator]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[Generator]]
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
"""
raw_result = self._replace_content_initial(
resource_group_name=resource_group_name,
automation_account_name=automation_account_name,
runbook_name=runbook_name,
runbook_content=runbook_content,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
header_dict = {
'location': 'str',
}
deserialized = self._deserialize('object', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response.add_headers(header_dict)
return client_raw_response
return deserialized
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
|
def replace_content(
self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, callback=None, polling=True, **operation_config):
"""Replaces the runbook draft content.
:param resource_group_name: Name of an Azure Resource group.
:type resource_group_name: str
:param automation_account_name: The name of the automation account.
:type automation_account_name: str
:param runbook_name: The runbook name.
:type runbook_name: str
:param runbook_content: The runbook draft content.
:type runbook_content: Generator
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns object or
ClientRawResponse<object> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[Generator]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[Generator]]
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
"""
raw_result = self._replace_content_initial(
resource_group_name=resource_group_name,
automation_account_name=automation_account_name,
runbook_name=runbook_name,
runbook_content=runbook_content,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
header_dict = {
'location': 'str',
}
deserialized = self._deserialize('object', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response.add_headers(header_dict)
return client_raw_response
return deserialized
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
|
[
"Replaces",
"the",
"runbook",
"draft",
"content",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py#L165-L219
|
[
"def",
"replace_content",
"(",
"self",
",",
"resource_group_name",
",",
"automation_account_name",
",",
"runbook_name",
",",
"runbook_content",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"callback",
"=",
"None",
",",
"polling",
"=",
"True",
",",
"*",
"*",
"operation_config",
")",
":",
"raw_result",
"=",
"self",
".",
"_replace_content_initial",
"(",
"resource_group_name",
"=",
"resource_group_name",
",",
"automation_account_name",
"=",
"automation_account_name",
",",
"runbook_name",
"=",
"runbook_name",
",",
"runbook_content",
"=",
"runbook_content",
",",
"custom_headers",
"=",
"custom_headers",
",",
"raw",
"=",
"True",
",",
"*",
"*",
"operation_config",
")",
"def",
"get_long_running_output",
"(",
"response",
")",
":",
"header_dict",
"=",
"{",
"'location'",
":",
"'str'",
",",
"}",
"deserialized",
"=",
"self",
".",
"_deserialize",
"(",
"'object'",
",",
"response",
")",
"if",
"raw",
":",
"client_raw_response",
"=",
"ClientRawResponse",
"(",
"deserialized",
",",
"response",
")",
"client_raw_response",
".",
"add_headers",
"(",
"header_dict",
")",
"return",
"client_raw_response",
"return",
"deserialized",
"lro_delay",
"=",
"operation_config",
".",
"get",
"(",
"'long_running_operation_timeout'",
",",
"self",
".",
"config",
".",
"long_running_operation_timeout",
")",
"if",
"polling",
"is",
"True",
":",
"polling_method",
"=",
"ARMPolling",
"(",
"lro_delay",
",",
"*",
"*",
"operation_config",
")",
"elif",
"polling",
"is",
"False",
":",
"polling_method",
"=",
"NoPolling",
"(",
")",
"else",
":",
"polling_method",
"=",
"polling",
"return",
"LROPoller",
"(",
"self",
".",
"_client",
",",
"raw_result",
",",
"get_long_running_output",
",",
"polling_method",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
DomainsOperations.list_recommendations
|
Get domain name recommendations based on keywords.
Get domain name recommendations based on keywords.
:param keywords: Keywords to be used for generating domain
recommendations.
:type keywords: str
:param max_domain_recommendations: Maximum number of recommendations.
:type max_domain_recommendations: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of NameIdentifier
:rtype:
~azure.mgmt.web.models.NameIdentifierPaged[~azure.mgmt.web.models.NameIdentifier]
:raises:
:class:`DefaultErrorResponseException<azure.mgmt.web.models.DefaultErrorResponseException>`
|
azure-mgmt-web/azure/mgmt/web/operations/domains_operations.py
|
def list_recommendations(
self, keywords=None, max_domain_recommendations=None, custom_headers=None, raw=False, **operation_config):
"""Get domain name recommendations based on keywords.
Get domain name recommendations based on keywords.
:param keywords: Keywords to be used for generating domain
recommendations.
:type keywords: str
:param max_domain_recommendations: Maximum number of recommendations.
:type max_domain_recommendations: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of NameIdentifier
:rtype:
~azure.mgmt.web.models.NameIdentifierPaged[~azure.mgmt.web.models.NameIdentifier]
:raises:
:class:`DefaultErrorResponseException<azure.mgmt.web.models.DefaultErrorResponseException>`
"""
parameters = models.DomainRecommendationSearchParameters(keywords=keywords, max_domain_recommendations=max_domain_recommendations)
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = self.list_recommendations.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct body
body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.DefaultErrorResponseException(self._deserialize, response)
return response
# Deserialize response
deserialized = models.NameIdentifierPaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.NameIdentifierPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
|
def list_recommendations(
self, keywords=None, max_domain_recommendations=None, custom_headers=None, raw=False, **operation_config):
"""Get domain name recommendations based on keywords.
Get domain name recommendations based on keywords.
:param keywords: Keywords to be used for generating domain
recommendations.
:type keywords: str
:param max_domain_recommendations: Maximum number of recommendations.
:type max_domain_recommendations: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of NameIdentifier
:rtype:
~azure.mgmt.web.models.NameIdentifierPaged[~azure.mgmt.web.models.NameIdentifier]
:raises:
:class:`DefaultErrorResponseException<azure.mgmt.web.models.DefaultErrorResponseException>`
"""
parameters = models.DomainRecommendationSearchParameters(keywords=keywords, max_domain_recommendations=max_domain_recommendations)
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = self.list_recommendations.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct body
body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.DefaultErrorResponseException(self._deserialize, response)
return response
# Deserialize response
deserialized = models.NameIdentifierPaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.NameIdentifierPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
|
[
"Get",
"domain",
"name",
"recommendations",
"based",
"on",
"keywords",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-mgmt-web/azure/mgmt/web/operations/domains_operations.py#L231-L304
|
[
"def",
"list_recommendations",
"(",
"self",
",",
"keywords",
"=",
"None",
",",
"max_domain_recommendations",
"=",
"None",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
":",
"parameters",
"=",
"models",
".",
"DomainRecommendationSearchParameters",
"(",
"keywords",
"=",
"keywords",
",",
"max_domain_recommendations",
"=",
"max_domain_recommendations",
")",
"def",
"internal_paging",
"(",
"next_link",
"=",
"None",
",",
"raw",
"=",
"False",
")",
":",
"if",
"not",
"next_link",
":",
"# Construct URL",
"url",
"=",
"self",
".",
"list_recommendations",
".",
"metadata",
"[",
"'url'",
"]",
"path_format_arguments",
"=",
"{",
"'subscriptionId'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"self.config.subscription_id\"",
",",
"self",
".",
"config",
".",
"subscription_id",
",",
"'str'",
")",
"}",
"url",
"=",
"self",
".",
"_client",
".",
"format_url",
"(",
"url",
",",
"*",
"*",
"path_format_arguments",
")",
"# Construct parameters",
"query_parameters",
"=",
"{",
"}",
"query_parameters",
"[",
"'api-version'",
"]",
"=",
"self",
".",
"_serialize",
".",
"query",
"(",
"\"self.api_version\"",
",",
"self",
".",
"api_version",
",",
"'str'",
")",
"else",
":",
"url",
"=",
"next_link",
"query_parameters",
"=",
"{",
"}",
"# Construct headers",
"header_parameters",
"=",
"{",
"}",
"header_parameters",
"[",
"'Accept'",
"]",
"=",
"'application/json'",
"header_parameters",
"[",
"'Content-Type'",
"]",
"=",
"'application/json; charset=utf-8'",
"if",
"self",
".",
"config",
".",
"generate_client_request_id",
":",
"header_parameters",
"[",
"'x-ms-client-request-id'",
"]",
"=",
"str",
"(",
"uuid",
".",
"uuid1",
"(",
")",
")",
"if",
"custom_headers",
":",
"header_parameters",
".",
"update",
"(",
"custom_headers",
")",
"if",
"self",
".",
"config",
".",
"accept_language",
"is",
"not",
"None",
":",
"header_parameters",
"[",
"'accept-language'",
"]",
"=",
"self",
".",
"_serialize",
".",
"header",
"(",
"\"self.config.accept_language\"",
",",
"self",
".",
"config",
".",
"accept_language",
",",
"'str'",
")",
"# Construct body",
"body_content",
"=",
"self",
".",
"_serialize",
".",
"body",
"(",
"parameters",
",",
"'DomainRecommendationSearchParameters'",
")",
"# Construct and send request",
"request",
"=",
"self",
".",
"_client",
".",
"post",
"(",
"url",
",",
"query_parameters",
",",
"header_parameters",
",",
"body_content",
")",
"response",
"=",
"self",
".",
"_client",
".",
"send",
"(",
"request",
",",
"stream",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
"if",
"response",
".",
"status_code",
"not",
"in",
"[",
"200",
"]",
":",
"raise",
"models",
".",
"DefaultErrorResponseException",
"(",
"self",
".",
"_deserialize",
",",
"response",
")",
"return",
"response",
"# Deserialize response",
"deserialized",
"=",
"models",
".",
"NameIdentifierPaged",
"(",
"internal_paging",
",",
"self",
".",
"_deserialize",
".",
"dependencies",
")",
"if",
"raw",
":",
"header_dict",
"=",
"{",
"}",
"client_raw_response",
"=",
"models",
".",
"NameIdentifierPaged",
"(",
"internal_paging",
",",
"self",
".",
"_deserialize",
".",
"dependencies",
",",
"header_dict",
")",
"return",
"client_raw_response",
"return",
"deserialized"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
KnowledgebaseOperations.update
|
Asynchronous operation to modify a knowledgebase.
:param kb_id: Knowledgebase id.
:type kb_id: str
:param update_kb: Post body of the request.
:type update_kb:
~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTO
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: Operation or ClientRawResponse if raw=true
:rtype: ~azure.cognitiveservices.knowledge.qnamaker.models.Operation
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException>`
|
azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/knowledgebase_operations.py
|
def update(
self, kb_id, update_kb, custom_headers=None, raw=False, **operation_config):
"""Asynchronous operation to modify a knowledgebase.
:param kb_id: Knowledgebase id.
:type kb_id: str
:param update_kb: Post body of the request.
:type update_kb:
~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTO
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: Operation or ClientRawResponse if raw=true
:rtype: ~azure.cognitiveservices.knowledge.qnamaker.models.Operation
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException>`
"""
# Construct URL
url = self.update.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'kbId': self._serialize.url("kb_id", kb_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(update_kb, 'UpdateKbOperationDTO')
# Construct and send request
request = self._client.patch(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [202]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
header_dict = {}
if response.status_code == 202:
deserialized = self._deserialize('Operation', response)
header_dict = {
'Location': 'str',
}
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response.add_headers(header_dict)
return client_raw_response
return deserialized
|
def update(
self, kb_id, update_kb, custom_headers=None, raw=False, **operation_config):
"""Asynchronous operation to modify a knowledgebase.
:param kb_id: Knowledgebase id.
:type kb_id: str
:param update_kb: Post body of the request.
:type update_kb:
~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTO
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: Operation or ClientRawResponse if raw=true
:rtype: ~azure.cognitiveservices.knowledge.qnamaker.models.Operation
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException>`
"""
# Construct URL
url = self.update.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'kbId': self._serialize.url("kb_id", kb_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(update_kb, 'UpdateKbOperationDTO')
# Construct and send request
request = self._client.patch(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [202]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
header_dict = {}
if response.status_code == 202:
deserialized = self._deserialize('Operation', response)
header_dict = {
'Location': 'str',
}
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response.add_headers(header_dict)
return client_raw_response
return deserialized
|
[
"Asynchronous",
"operation",
"to",
"modify",
"a",
"knowledgebase",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/knowledgebase_operations.py#L285-L347
|
[
"def",
"update",
"(",
"self",
",",
"kb_id",
",",
"update_kb",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
":",
"# Construct URL",
"url",
"=",
"self",
".",
"update",
".",
"metadata",
"[",
"'url'",
"]",
"path_format_arguments",
"=",
"{",
"'Endpoint'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"self.config.endpoint\"",
",",
"self",
".",
"config",
".",
"endpoint",
",",
"'str'",
",",
"skip_quote",
"=",
"True",
")",
",",
"'kbId'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"kb_id\"",
",",
"kb_id",
",",
"'str'",
")",
"}",
"url",
"=",
"self",
".",
"_client",
".",
"format_url",
"(",
"url",
",",
"*",
"*",
"path_format_arguments",
")",
"# Construct parameters",
"query_parameters",
"=",
"{",
"}",
"# Construct headers",
"header_parameters",
"=",
"{",
"}",
"header_parameters",
"[",
"'Accept'",
"]",
"=",
"'application/json'",
"header_parameters",
"[",
"'Content-Type'",
"]",
"=",
"'application/json; charset=utf-8'",
"if",
"custom_headers",
":",
"header_parameters",
".",
"update",
"(",
"custom_headers",
")",
"# Construct body",
"body_content",
"=",
"self",
".",
"_serialize",
".",
"body",
"(",
"update_kb",
",",
"'UpdateKbOperationDTO'",
")",
"# Construct and send request",
"request",
"=",
"self",
".",
"_client",
".",
"patch",
"(",
"url",
",",
"query_parameters",
",",
"header_parameters",
",",
"body_content",
")",
"response",
"=",
"self",
".",
"_client",
".",
"send",
"(",
"request",
",",
"stream",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
"if",
"response",
".",
"status_code",
"not",
"in",
"[",
"202",
"]",
":",
"raise",
"models",
".",
"ErrorResponseException",
"(",
"self",
".",
"_deserialize",
",",
"response",
")",
"deserialized",
"=",
"None",
"header_dict",
"=",
"{",
"}",
"if",
"response",
".",
"status_code",
"==",
"202",
":",
"deserialized",
"=",
"self",
".",
"_deserialize",
"(",
"'Operation'",
",",
"response",
")",
"header_dict",
"=",
"{",
"'Location'",
":",
"'str'",
",",
"}",
"if",
"raw",
":",
"client_raw_response",
"=",
"ClientRawResponse",
"(",
"deserialized",
",",
"response",
")",
"client_raw_response",
".",
"add_headers",
"(",
"header_dict",
")",
"return",
"client_raw_response",
"return",
"deserialized"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
MetricsOperations.get
|
Retrieve metric data.
Gets metric values for a single metric.
:param app_id: ID of the application. This is Application ID from the
API Access settings blade in the Azure portal.
:type app_id: str
:param metric_id: ID of the metric. This is either a standard AI
metric, or an application-specific custom metric. Possible values
include: 'requests/count', 'requests/duration', 'requests/failed',
'users/count', 'users/authenticated', 'pageViews/count',
'pageViews/duration', 'client/processingDuration',
'client/receiveDuration', 'client/networkDuration',
'client/sendDuration', 'client/totalDuration', 'dependencies/count',
'dependencies/failed', 'dependencies/duration', 'exceptions/count',
'exceptions/browser', 'exceptions/server', 'sessions/count',
'performanceCounters/requestExecutionTime',
'performanceCounters/requestsPerSecond',
'performanceCounters/requestsInQueue',
'performanceCounters/memoryAvailableBytes',
'performanceCounters/exceptionsPerSecond',
'performanceCounters/processCpuPercentage',
'performanceCounters/processIOBytesPerSecond',
'performanceCounters/processPrivateBytes',
'performanceCounters/processorCpuPercentage',
'availabilityResults/availabilityPercentage',
'availabilityResults/duration', 'billing/telemetryCount',
'customEvents/count'
:type metric_id: str or ~azure.applicationinsights.models.MetricId
:param timespan: The timespan over which to retrieve metric values.
This is an ISO8601 time period value. If timespan is omitted, a
default time range of `PT12H` ("last 12 hours") is used. The actual
timespan that is queried may be adjusted by the server based. In all
cases, the actual time span used for the query is included in the
response.
:type timespan: str
:param interval: The time interval to use when retrieving metric
values. This is an ISO8601 duration. If interval is omitted, the
metric value is aggregated across the entire timespan. If interval is
supplied, the server may adjust the interval to a more appropriate
size based on the timespan used for the query. In all cases, the
actual interval used for the query is included in the response.
:type interval: timedelta
:param aggregation: The aggregation to use when computing the metric
values. To retrieve more than one aggregation at a time, separate them
with a comma. If no aggregation is specified, then the default
aggregation for the metric is used.
:type aggregation: list[str or
~azure.applicationinsights.models.MetricsAggregation]
:param segment: The name of the dimension to segment the metric values
by. This dimension must be applicable to the metric you are
retrieving. To segment by more than one dimension at a time, separate
them with a comma (,). In this case, the metric data will be segmented
in the order the dimensions are listed in the parameter.
:type segment: list[str or
~azure.applicationinsights.models.MetricsSegment]
:param top: The number of segments to return. This value is only
valid when segment is specified.
:type top: int
:param orderby: The aggregation function and direction to sort the
segments by. This value is only valid when segment is specified.
:type orderby: str
:param filter: An expression used to filter the results. This value
should be a valid OData filter expression where the keys of each
clause should be applicable dimensions for the metric you are
retrieving.
:type filter: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: MetricsResult or ClientRawResponse if raw=true
:rtype: ~azure.applicationinsights.models.MetricsResult or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.applicationinsights.models.ErrorResponseException>`
|
azure-applicationinsights/azure/applicationinsights/operations/metrics_operations.py
|
def get(
self, app_id, metric_id, timespan=None, interval=None, aggregation=None, segment=None, top=None, orderby=None, filter=None, custom_headers=None, raw=False, **operation_config):
"""Retrieve metric data.
Gets metric values for a single metric.
:param app_id: ID of the application. This is Application ID from the
API Access settings blade in the Azure portal.
:type app_id: str
:param metric_id: ID of the metric. This is either a standard AI
metric, or an application-specific custom metric. Possible values
include: 'requests/count', 'requests/duration', 'requests/failed',
'users/count', 'users/authenticated', 'pageViews/count',
'pageViews/duration', 'client/processingDuration',
'client/receiveDuration', 'client/networkDuration',
'client/sendDuration', 'client/totalDuration', 'dependencies/count',
'dependencies/failed', 'dependencies/duration', 'exceptions/count',
'exceptions/browser', 'exceptions/server', 'sessions/count',
'performanceCounters/requestExecutionTime',
'performanceCounters/requestsPerSecond',
'performanceCounters/requestsInQueue',
'performanceCounters/memoryAvailableBytes',
'performanceCounters/exceptionsPerSecond',
'performanceCounters/processCpuPercentage',
'performanceCounters/processIOBytesPerSecond',
'performanceCounters/processPrivateBytes',
'performanceCounters/processorCpuPercentage',
'availabilityResults/availabilityPercentage',
'availabilityResults/duration', 'billing/telemetryCount',
'customEvents/count'
:type metric_id: str or ~azure.applicationinsights.models.MetricId
:param timespan: The timespan over which to retrieve metric values.
This is an ISO8601 time period value. If timespan is omitted, a
default time range of `PT12H` ("last 12 hours") is used. The actual
timespan that is queried may be adjusted by the server based. In all
cases, the actual time span used for the query is included in the
response.
:type timespan: str
:param interval: The time interval to use when retrieving metric
values. This is an ISO8601 duration. If interval is omitted, the
metric value is aggregated across the entire timespan. If interval is
supplied, the server may adjust the interval to a more appropriate
size based on the timespan used for the query. In all cases, the
actual interval used for the query is included in the response.
:type interval: timedelta
:param aggregation: The aggregation to use when computing the metric
values. To retrieve more than one aggregation at a time, separate them
with a comma. If no aggregation is specified, then the default
aggregation for the metric is used.
:type aggregation: list[str or
~azure.applicationinsights.models.MetricsAggregation]
:param segment: The name of the dimension to segment the metric values
by. This dimension must be applicable to the metric you are
retrieving. To segment by more than one dimension at a time, separate
them with a comma (,). In this case, the metric data will be segmented
in the order the dimensions are listed in the parameter.
:type segment: list[str or
~azure.applicationinsights.models.MetricsSegment]
:param top: The number of segments to return. This value is only
valid when segment is specified.
:type top: int
:param orderby: The aggregation function and direction to sort the
segments by. This value is only valid when segment is specified.
:type orderby: str
:param filter: An expression used to filter the results. This value
should be a valid OData filter expression where the keys of each
clause should be applicable dimensions for the metric you are
retrieving.
:type filter: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: MetricsResult or ClientRawResponse if raw=true
:rtype: ~azure.applicationinsights.models.MetricsResult or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.applicationinsights.models.ErrorResponseException>`
"""
# Construct URL
url = self.get.metadata['url']
path_format_arguments = {
'appId': self._serialize.url("app_id", app_id, 'str'),
'metricId': self._serialize.url("metric_id", metric_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if timespan is not None:
query_parameters['timespan'] = self._serialize.query("timespan", timespan, 'str')
if interval is not None:
query_parameters['interval'] = self._serialize.query("interval", interval, 'duration')
if aggregation is not None:
query_parameters['aggregation'] = self._serialize.query("aggregation", aggregation, '[MetricsAggregation]', div=',', min_items=1)
if segment is not None:
query_parameters['segment'] = self._serialize.query("segment", segment, '[str]', div=',', min_items=1)
if top is not None:
query_parameters['top'] = self._serialize.query("top", top, 'int')
if orderby is not None:
query_parameters['orderby'] = self._serialize.query("orderby", orderby, 'str')
if filter is not None:
query_parameters['filter'] = self._serialize.query("filter", filter, 'str')
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('MetricsResult', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
|
def get(
self, app_id, metric_id, timespan=None, interval=None, aggregation=None, segment=None, top=None, orderby=None, filter=None, custom_headers=None, raw=False, **operation_config):
"""Retrieve metric data.
Gets metric values for a single metric.
:param app_id: ID of the application. This is Application ID from the
API Access settings blade in the Azure portal.
:type app_id: str
:param metric_id: ID of the metric. This is either a standard AI
metric, or an application-specific custom metric. Possible values
include: 'requests/count', 'requests/duration', 'requests/failed',
'users/count', 'users/authenticated', 'pageViews/count',
'pageViews/duration', 'client/processingDuration',
'client/receiveDuration', 'client/networkDuration',
'client/sendDuration', 'client/totalDuration', 'dependencies/count',
'dependencies/failed', 'dependencies/duration', 'exceptions/count',
'exceptions/browser', 'exceptions/server', 'sessions/count',
'performanceCounters/requestExecutionTime',
'performanceCounters/requestsPerSecond',
'performanceCounters/requestsInQueue',
'performanceCounters/memoryAvailableBytes',
'performanceCounters/exceptionsPerSecond',
'performanceCounters/processCpuPercentage',
'performanceCounters/processIOBytesPerSecond',
'performanceCounters/processPrivateBytes',
'performanceCounters/processorCpuPercentage',
'availabilityResults/availabilityPercentage',
'availabilityResults/duration', 'billing/telemetryCount',
'customEvents/count'
:type metric_id: str or ~azure.applicationinsights.models.MetricId
:param timespan: The timespan over which to retrieve metric values.
This is an ISO8601 time period value. If timespan is omitted, a
default time range of `PT12H` ("last 12 hours") is used. The actual
timespan that is queried may be adjusted by the server based. In all
cases, the actual time span used for the query is included in the
response.
:type timespan: str
:param interval: The time interval to use when retrieving metric
values. This is an ISO8601 duration. If interval is omitted, the
metric value is aggregated across the entire timespan. If interval is
supplied, the server may adjust the interval to a more appropriate
size based on the timespan used for the query. In all cases, the
actual interval used for the query is included in the response.
:type interval: timedelta
:param aggregation: The aggregation to use when computing the metric
values. To retrieve more than one aggregation at a time, separate them
with a comma. If no aggregation is specified, then the default
aggregation for the metric is used.
:type aggregation: list[str or
~azure.applicationinsights.models.MetricsAggregation]
:param segment: The name of the dimension to segment the metric values
by. This dimension must be applicable to the metric you are
retrieving. To segment by more than one dimension at a time, separate
them with a comma (,). In this case, the metric data will be segmented
in the order the dimensions are listed in the parameter.
:type segment: list[str or
~azure.applicationinsights.models.MetricsSegment]
:param top: The number of segments to return. This value is only
valid when segment is specified.
:type top: int
:param orderby: The aggregation function and direction to sort the
segments by. This value is only valid when segment is specified.
:type orderby: str
:param filter: An expression used to filter the results. This value
should be a valid OData filter expression where the keys of each
clause should be applicable dimensions for the metric you are
retrieving.
:type filter: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: MetricsResult or ClientRawResponse if raw=true
:rtype: ~azure.applicationinsights.models.MetricsResult or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.applicationinsights.models.ErrorResponseException>`
"""
# Construct URL
url = self.get.metadata['url']
path_format_arguments = {
'appId': self._serialize.url("app_id", app_id, 'str'),
'metricId': self._serialize.url("metric_id", metric_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if timespan is not None:
query_parameters['timespan'] = self._serialize.query("timespan", timespan, 'str')
if interval is not None:
query_parameters['interval'] = self._serialize.query("interval", interval, 'duration')
if aggregation is not None:
query_parameters['aggregation'] = self._serialize.query("aggregation", aggregation, '[MetricsAggregation]', div=',', min_items=1)
if segment is not None:
query_parameters['segment'] = self._serialize.query("segment", segment, '[str]', div=',', min_items=1)
if top is not None:
query_parameters['top'] = self._serialize.query("top", top, 'int')
if orderby is not None:
query_parameters['orderby'] = self._serialize.query("orderby", orderby, 'str')
if filter is not None:
query_parameters['filter'] = self._serialize.query("filter", filter, 'str')
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('MetricsResult', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
|
[
"Retrieve",
"metric",
"data",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-applicationinsights/azure/applicationinsights/operations/metrics_operations.py#L36-L163
|
[
"def",
"get",
"(",
"self",
",",
"app_id",
",",
"metric_id",
",",
"timespan",
"=",
"None",
",",
"interval",
"=",
"None",
",",
"aggregation",
"=",
"None",
",",
"segment",
"=",
"None",
",",
"top",
"=",
"None",
",",
"orderby",
"=",
"None",
",",
"filter",
"=",
"None",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
":",
"# Construct URL",
"url",
"=",
"self",
".",
"get",
".",
"metadata",
"[",
"'url'",
"]",
"path_format_arguments",
"=",
"{",
"'appId'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"app_id\"",
",",
"app_id",
",",
"'str'",
")",
",",
"'metricId'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"metric_id\"",
",",
"metric_id",
",",
"'str'",
")",
"}",
"url",
"=",
"self",
".",
"_client",
".",
"format_url",
"(",
"url",
",",
"*",
"*",
"path_format_arguments",
")",
"# Construct parameters",
"query_parameters",
"=",
"{",
"}",
"if",
"timespan",
"is",
"not",
"None",
":",
"query_parameters",
"[",
"'timespan'",
"]",
"=",
"self",
".",
"_serialize",
".",
"query",
"(",
"\"timespan\"",
",",
"timespan",
",",
"'str'",
")",
"if",
"interval",
"is",
"not",
"None",
":",
"query_parameters",
"[",
"'interval'",
"]",
"=",
"self",
".",
"_serialize",
".",
"query",
"(",
"\"interval\"",
",",
"interval",
",",
"'duration'",
")",
"if",
"aggregation",
"is",
"not",
"None",
":",
"query_parameters",
"[",
"'aggregation'",
"]",
"=",
"self",
".",
"_serialize",
".",
"query",
"(",
"\"aggregation\"",
",",
"aggregation",
",",
"'[MetricsAggregation]'",
",",
"div",
"=",
"','",
",",
"min_items",
"=",
"1",
")",
"if",
"segment",
"is",
"not",
"None",
":",
"query_parameters",
"[",
"'segment'",
"]",
"=",
"self",
".",
"_serialize",
".",
"query",
"(",
"\"segment\"",
",",
"segment",
",",
"'[str]'",
",",
"div",
"=",
"','",
",",
"min_items",
"=",
"1",
")",
"if",
"top",
"is",
"not",
"None",
":",
"query_parameters",
"[",
"'top'",
"]",
"=",
"self",
".",
"_serialize",
".",
"query",
"(",
"\"top\"",
",",
"top",
",",
"'int'",
")",
"if",
"orderby",
"is",
"not",
"None",
":",
"query_parameters",
"[",
"'orderby'",
"]",
"=",
"self",
".",
"_serialize",
".",
"query",
"(",
"\"orderby\"",
",",
"orderby",
",",
"'str'",
")",
"if",
"filter",
"is",
"not",
"None",
":",
"query_parameters",
"[",
"'filter'",
"]",
"=",
"self",
".",
"_serialize",
".",
"query",
"(",
"\"filter\"",
",",
"filter",
",",
"'str'",
")",
"# Construct headers",
"header_parameters",
"=",
"{",
"}",
"header_parameters",
"[",
"'Accept'",
"]",
"=",
"'application/json'",
"if",
"custom_headers",
":",
"header_parameters",
".",
"update",
"(",
"custom_headers",
")",
"# Construct and send request",
"request",
"=",
"self",
".",
"_client",
".",
"get",
"(",
"url",
",",
"query_parameters",
",",
"header_parameters",
")",
"response",
"=",
"self",
".",
"_client",
".",
"send",
"(",
"request",
",",
"stream",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
"if",
"response",
".",
"status_code",
"not",
"in",
"[",
"200",
"]",
":",
"raise",
"models",
".",
"ErrorResponseException",
"(",
"self",
".",
"_deserialize",
",",
"response",
")",
"deserialized",
"=",
"None",
"if",
"response",
".",
"status_code",
"==",
"200",
":",
"deserialized",
"=",
"self",
".",
"_deserialize",
"(",
"'MetricsResult'",
",",
"response",
")",
"if",
"raw",
":",
"client_raw_response",
"=",
"ClientRawResponse",
"(",
"deserialized",
",",
"response",
")",
"return",
"client_raw_response",
"return",
"deserialized"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
MetricsOperations.get_multiple
|
Retrieve metric data.
Gets metric values for multiple metrics.
:param app_id: ID of the application. This is Application ID from the
API Access settings blade in the Azure portal.
:type app_id: str
:param body: The batched metrics query.
:type body:
list[~azure.applicationinsights.models.MetricsPostBodySchema]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype: list[~azure.applicationinsights.models.MetricsResultsItem] or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.applicationinsights.models.ErrorResponseException>`
|
azure-applicationinsights/azure/applicationinsights/operations/metrics_operations.py
|
def get_multiple(
self, app_id, body, custom_headers=None, raw=False, **operation_config):
"""Retrieve metric data.
Gets metric values for multiple metrics.
:param app_id: ID of the application. This is Application ID from the
API Access settings blade in the Azure portal.
:type app_id: str
:param body: The batched metrics query.
:type body:
list[~azure.applicationinsights.models.MetricsPostBodySchema]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype: list[~azure.applicationinsights.models.MetricsResultsItem] or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.applicationinsights.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_multiple.metadata['url']
path_format_arguments = {
'appId': self._serialize.url("app_id", app_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(body, '[MetricsPostBodySchema]')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[MetricsResultsItem]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
|
def get_multiple(
self, app_id, body, custom_headers=None, raw=False, **operation_config):
"""Retrieve metric data.
Gets metric values for multiple metrics.
:param app_id: ID of the application. This is Application ID from the
API Access settings blade in the Azure portal.
:type app_id: str
:param body: The batched metrics query.
:type body:
list[~azure.applicationinsights.models.MetricsPostBodySchema]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype: list[~azure.applicationinsights.models.MetricsResultsItem] or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.applicationinsights.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_multiple.metadata['url']
path_format_arguments = {
'appId': self._serialize.url("app_id", app_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(body, '[MetricsPostBodySchema]')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[MetricsResultsItem]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
|
[
"Retrieve",
"metric",
"data",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-applicationinsights/azure/applicationinsights/operations/metrics_operations.py#L166-L225
|
[
"def",
"get_multiple",
"(",
"self",
",",
"app_id",
",",
"body",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
":",
"# Construct URL",
"url",
"=",
"self",
".",
"get_multiple",
".",
"metadata",
"[",
"'url'",
"]",
"path_format_arguments",
"=",
"{",
"'appId'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"app_id\"",
",",
"app_id",
",",
"'str'",
")",
"}",
"url",
"=",
"self",
".",
"_client",
".",
"format_url",
"(",
"url",
",",
"*",
"*",
"path_format_arguments",
")",
"# Construct parameters",
"query_parameters",
"=",
"{",
"}",
"# Construct headers",
"header_parameters",
"=",
"{",
"}",
"header_parameters",
"[",
"'Accept'",
"]",
"=",
"'application/json'",
"header_parameters",
"[",
"'Content-Type'",
"]",
"=",
"'application/json; charset=utf-8'",
"if",
"custom_headers",
":",
"header_parameters",
".",
"update",
"(",
"custom_headers",
")",
"# Construct body",
"body_content",
"=",
"self",
".",
"_serialize",
".",
"body",
"(",
"body",
",",
"'[MetricsPostBodySchema]'",
")",
"# Construct and send request",
"request",
"=",
"self",
".",
"_client",
".",
"post",
"(",
"url",
",",
"query_parameters",
",",
"header_parameters",
",",
"body_content",
")",
"response",
"=",
"self",
".",
"_client",
".",
"send",
"(",
"request",
",",
"stream",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
"if",
"response",
".",
"status_code",
"not",
"in",
"[",
"200",
"]",
":",
"raise",
"models",
".",
"ErrorResponseException",
"(",
"self",
".",
"_deserialize",
",",
"response",
")",
"deserialized",
"=",
"None",
"if",
"response",
".",
"status_code",
"==",
"200",
":",
"deserialized",
"=",
"self",
".",
"_deserialize",
"(",
"'[MetricsResultsItem]'",
",",
"response",
")",
"if",
"raw",
":",
"client_raw_response",
"=",
"ClientRawResponse",
"(",
"deserialized",
",",
"response",
")",
"return",
"client_raw_response",
"return",
"deserialized"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
AutoLockRenew.register
|
Register a renewable entity for automatic lock renewal.
:param renewable: A locked entity that needs to be renewed.
:type renewable: ~azure.servicebus.aio.async_message.Message or
~azure.servicebus.aio.async_receive_handler.SessionReceiver
:param timeout: A time in seconds that the lock should be maintained for.
Default value is 300 (5 minutes).
:type timeout: int
|
azure-servicebus/azure/servicebus/aio/async_utils.py
|
def register(self, renewable, timeout=300):
"""Register a renewable entity for automatic lock renewal.
:param renewable: A locked entity that needs to be renewed.
:type renewable: ~azure.servicebus.aio.async_message.Message or
~azure.servicebus.aio.async_receive_handler.SessionReceiver
:param timeout: A time in seconds that the lock should be maintained for.
Default value is 300 (5 minutes).
:type timeout: int
"""
starttime = renewable_start_time(renewable)
renew_future = asyncio.ensure_future(self._auto_lock_renew(renewable, starttime, timeout), loop=self.loop)
self._futures.append(renew_future)
|
def register(self, renewable, timeout=300):
"""Register a renewable entity for automatic lock renewal.
:param renewable: A locked entity that needs to be renewed.
:type renewable: ~azure.servicebus.aio.async_message.Message or
~azure.servicebus.aio.async_receive_handler.SessionReceiver
:param timeout: A time in seconds that the lock should be maintained for.
Default value is 300 (5 minutes).
:type timeout: int
"""
starttime = renewable_start_time(renewable)
renew_future = asyncio.ensure_future(self._auto_lock_renew(renewable, starttime, timeout), loop=self.loop)
self._futures.append(renew_future)
|
[
"Register",
"a",
"renewable",
"entity",
"for",
"automatic",
"lock",
"renewal",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicebus/azure/servicebus/aio/async_utils.py#L86-L98
|
[
"def",
"register",
"(",
"self",
",",
"renewable",
",",
"timeout",
"=",
"300",
")",
":",
"starttime",
"=",
"renewable_start_time",
"(",
"renewable",
")",
"renew_future",
"=",
"asyncio",
".",
"ensure_future",
"(",
"self",
".",
"_auto_lock_renew",
"(",
"renewable",
",",
"starttime",
",",
"timeout",
")",
",",
"loop",
"=",
"self",
".",
"loop",
")",
"self",
".",
"_futures",
".",
"append",
"(",
"renew_future",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
UsersOperations.get_member_groups
|
Gets a collection that contains the object IDs of the groups of which
the user is a member.
:param object_id: The object ID of the user for which to get group
membership.
:type object_id: str
:param security_enabled_only: If true, only membership in
security-enabled groups should be checked. Otherwise, membership in
all groups should be checked.
:type security_enabled_only: bool
:param additional_properties: Unmatched properties from the message
are deserialized this collection
:type additional_properties: dict[str, object]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of str
:rtype: ~azure.graphrbac.models.StrPaged[str]
:raises:
:class:`GraphErrorException<azure.graphrbac.models.GraphErrorException>`
|
azure-graphrbac/azure/graphrbac/operations/users_operations.py
|
def get_member_groups(
self, object_id, security_enabled_only, additional_properties=None, custom_headers=None, raw=False, **operation_config):
"""Gets a collection that contains the object IDs of the groups of which
the user is a member.
:param object_id: The object ID of the user for which to get group
membership.
:type object_id: str
:param security_enabled_only: If true, only membership in
security-enabled groups should be checked. Otherwise, membership in
all groups should be checked.
:type security_enabled_only: bool
:param additional_properties: Unmatched properties from the message
are deserialized this collection
:type additional_properties: dict[str, object]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of str
:rtype: ~azure.graphrbac.models.StrPaged[str]
:raises:
:class:`GraphErrorException<azure.graphrbac.models.GraphErrorException>`
"""
parameters = models.UserGetMemberGroupsParameters(additional_properties=additional_properties, security_enabled_only=security_enabled_only)
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = self.get_member_groups.metadata['url']
path_format_arguments = {
'objectId': self._serialize.url("object_id", object_id, 'str'),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct body
body_content = self._serialize.body(parameters, 'UserGetMemberGroupsParameters')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.GraphErrorException(self._deserialize, response)
return response
# Deserialize response
deserialized = models.StrPaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.StrPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
|
def get_member_groups(
self, object_id, security_enabled_only, additional_properties=None, custom_headers=None, raw=False, **operation_config):
"""Gets a collection that contains the object IDs of the groups of which
the user is a member.
:param object_id: The object ID of the user for which to get group
membership.
:type object_id: str
:param security_enabled_only: If true, only membership in
security-enabled groups should be checked. Otherwise, membership in
all groups should be checked.
:type security_enabled_only: bool
:param additional_properties: Unmatched properties from the message
are deserialized this collection
:type additional_properties: dict[str, object]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of str
:rtype: ~azure.graphrbac.models.StrPaged[str]
:raises:
:class:`GraphErrorException<azure.graphrbac.models.GraphErrorException>`
"""
parameters = models.UserGetMemberGroupsParameters(additional_properties=additional_properties, security_enabled_only=security_enabled_only)
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = self.get_member_groups.metadata['url']
path_format_arguments = {
'objectId': self._serialize.url("object_id", object_id, 'str'),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct body
body_content = self._serialize.body(parameters, 'UserGetMemberGroupsParameters')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.GraphErrorException(self._deserialize, response)
return response
# Deserialize response
deserialized = models.StrPaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.StrPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
|
[
"Gets",
"a",
"collection",
"that",
"contains",
"the",
"object",
"IDs",
"of",
"the",
"groups",
"of",
"which",
"the",
"user",
"is",
"a",
"member",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-graphrbac/azure/graphrbac/operations/users_operations.py#L338-L415
|
[
"def",
"get_member_groups",
"(",
"self",
",",
"object_id",
",",
"security_enabled_only",
",",
"additional_properties",
"=",
"None",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
":",
"parameters",
"=",
"models",
".",
"UserGetMemberGroupsParameters",
"(",
"additional_properties",
"=",
"additional_properties",
",",
"security_enabled_only",
"=",
"security_enabled_only",
")",
"def",
"internal_paging",
"(",
"next_link",
"=",
"None",
",",
"raw",
"=",
"False",
")",
":",
"if",
"not",
"next_link",
":",
"# Construct URL",
"url",
"=",
"self",
".",
"get_member_groups",
".",
"metadata",
"[",
"'url'",
"]",
"path_format_arguments",
"=",
"{",
"'objectId'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"object_id\"",
",",
"object_id",
",",
"'str'",
")",
",",
"'tenantID'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"self.config.tenant_id\"",
",",
"self",
".",
"config",
".",
"tenant_id",
",",
"'str'",
")",
"}",
"url",
"=",
"self",
".",
"_client",
".",
"format_url",
"(",
"url",
",",
"*",
"*",
"path_format_arguments",
")",
"# Construct parameters",
"query_parameters",
"=",
"{",
"}",
"query_parameters",
"[",
"'api-version'",
"]",
"=",
"self",
".",
"_serialize",
".",
"query",
"(",
"\"self.api_version\"",
",",
"self",
".",
"api_version",
",",
"'str'",
")",
"else",
":",
"url",
"=",
"next_link",
"query_parameters",
"=",
"{",
"}",
"# Construct headers",
"header_parameters",
"=",
"{",
"}",
"header_parameters",
"[",
"'Accept'",
"]",
"=",
"'application/json'",
"header_parameters",
"[",
"'Content-Type'",
"]",
"=",
"'application/json; charset=utf-8'",
"if",
"self",
".",
"config",
".",
"generate_client_request_id",
":",
"header_parameters",
"[",
"'x-ms-client-request-id'",
"]",
"=",
"str",
"(",
"uuid",
".",
"uuid1",
"(",
")",
")",
"if",
"custom_headers",
":",
"header_parameters",
".",
"update",
"(",
"custom_headers",
")",
"if",
"self",
".",
"config",
".",
"accept_language",
"is",
"not",
"None",
":",
"header_parameters",
"[",
"'accept-language'",
"]",
"=",
"self",
".",
"_serialize",
".",
"header",
"(",
"\"self.config.accept_language\"",
",",
"self",
".",
"config",
".",
"accept_language",
",",
"'str'",
")",
"# Construct body",
"body_content",
"=",
"self",
".",
"_serialize",
".",
"body",
"(",
"parameters",
",",
"'UserGetMemberGroupsParameters'",
")",
"# Construct and send request",
"request",
"=",
"self",
".",
"_client",
".",
"post",
"(",
"url",
",",
"query_parameters",
",",
"header_parameters",
",",
"body_content",
")",
"response",
"=",
"self",
".",
"_client",
".",
"send",
"(",
"request",
",",
"stream",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
"if",
"response",
".",
"status_code",
"not",
"in",
"[",
"200",
"]",
":",
"raise",
"models",
".",
"GraphErrorException",
"(",
"self",
".",
"_deserialize",
",",
"response",
")",
"return",
"response",
"# Deserialize response",
"deserialized",
"=",
"models",
".",
"StrPaged",
"(",
"internal_paging",
",",
"self",
".",
"_deserialize",
".",
"dependencies",
")",
"if",
"raw",
":",
"header_dict",
"=",
"{",
"}",
"client_raw_response",
"=",
"models",
".",
"StrPaged",
"(",
"internal_paging",
",",
"self",
".",
"_deserialize",
".",
"dependencies",
",",
"header_dict",
")",
"return",
"client_raw_response",
"return",
"deserialized"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
build_package_from_pr_number
|
Will clone the given PR branch and vuild the package with the given name.
|
azure-sdk-tools/packaging_tools/drop_tools.py
|
def build_package_from_pr_number(gh_token, sdk_id, pr_number, output_folder, *, with_comment=False):
"""Will clone the given PR branch and vuild the package with the given name."""
con = Github(gh_token)
repo = con.get_repo(sdk_id)
sdk_pr = repo.get_pull(pr_number)
# "get_files" of Github only download the first 300 files. Might not be enough.
package_names = {f.filename.split('/')[0] for f in sdk_pr.get_files() if f.filename.startswith("azure")}
absolute_output_folder = Path(output_folder).resolve()
with tempfile.TemporaryDirectory() as temp_dir, \
manage_git_folder(gh_token, Path(temp_dir) / Path("sdk"), sdk_id, pr_number=pr_number) as sdk_folder:
for package_name in package_names:
_LOGGER.debug("Build {}".format(package_name))
execute_simple_command(
["python", "./build_package.py", "--dest", str(absolute_output_folder), package_name],
cwd=sdk_folder
)
_LOGGER.debug("Build finished: {}".format(package_name))
if with_comment:
files = [f.name for f in absolute_output_folder.iterdir()]
comment_message = None
dashboard = DashboardCommentableObject(sdk_pr, "(message created by the CI based on PR content)")
try:
installation_message = build_installation_message(sdk_pr)
download_message = build_download_message(sdk_pr, files)
comment_message = installation_message + "\n\n" + download_message
dashboard.create_comment(comment_message)
except Exception:
_LOGGER.critical("Unable to do PR comment:\n%s", comment_message)
|
def build_package_from_pr_number(gh_token, sdk_id, pr_number, output_folder, *, with_comment=False):
"""Will clone the given PR branch and vuild the package with the given name."""
con = Github(gh_token)
repo = con.get_repo(sdk_id)
sdk_pr = repo.get_pull(pr_number)
# "get_files" of Github only download the first 300 files. Might not be enough.
package_names = {f.filename.split('/')[0] for f in sdk_pr.get_files() if f.filename.startswith("azure")}
absolute_output_folder = Path(output_folder).resolve()
with tempfile.TemporaryDirectory() as temp_dir, \
manage_git_folder(gh_token, Path(temp_dir) / Path("sdk"), sdk_id, pr_number=pr_number) as sdk_folder:
for package_name in package_names:
_LOGGER.debug("Build {}".format(package_name))
execute_simple_command(
["python", "./build_package.py", "--dest", str(absolute_output_folder), package_name],
cwd=sdk_folder
)
_LOGGER.debug("Build finished: {}".format(package_name))
if with_comment:
files = [f.name for f in absolute_output_folder.iterdir()]
comment_message = None
dashboard = DashboardCommentableObject(sdk_pr, "(message created by the CI based on PR content)")
try:
installation_message = build_installation_message(sdk_pr)
download_message = build_download_message(sdk_pr, files)
comment_message = installation_message + "\n\n" + download_message
dashboard.create_comment(comment_message)
except Exception:
_LOGGER.critical("Unable to do PR comment:\n%s", comment_message)
|
[
"Will",
"clone",
"the",
"given",
"PR",
"branch",
"and",
"vuild",
"the",
"package",
"with",
"the",
"given",
"name",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-sdk-tools/packaging_tools/drop_tools.py#L47-L78
|
[
"def",
"build_package_from_pr_number",
"(",
"gh_token",
",",
"sdk_id",
",",
"pr_number",
",",
"output_folder",
",",
"*",
",",
"with_comment",
"=",
"False",
")",
":",
"con",
"=",
"Github",
"(",
"gh_token",
")",
"repo",
"=",
"con",
".",
"get_repo",
"(",
"sdk_id",
")",
"sdk_pr",
"=",
"repo",
".",
"get_pull",
"(",
"pr_number",
")",
"# \"get_files\" of Github only download the first 300 files. Might not be enough.",
"package_names",
"=",
"{",
"f",
".",
"filename",
".",
"split",
"(",
"'/'",
")",
"[",
"0",
"]",
"for",
"f",
"in",
"sdk_pr",
".",
"get_files",
"(",
")",
"if",
"f",
".",
"filename",
".",
"startswith",
"(",
"\"azure\"",
")",
"}",
"absolute_output_folder",
"=",
"Path",
"(",
"output_folder",
")",
".",
"resolve",
"(",
")",
"with",
"tempfile",
".",
"TemporaryDirectory",
"(",
")",
"as",
"temp_dir",
",",
"manage_git_folder",
"(",
"gh_token",
",",
"Path",
"(",
"temp_dir",
")",
"/",
"Path",
"(",
"\"sdk\"",
")",
",",
"sdk_id",
",",
"pr_number",
"=",
"pr_number",
")",
"as",
"sdk_folder",
":",
"for",
"package_name",
"in",
"package_names",
":",
"_LOGGER",
".",
"debug",
"(",
"\"Build {}\"",
".",
"format",
"(",
"package_name",
")",
")",
"execute_simple_command",
"(",
"[",
"\"python\"",
",",
"\"./build_package.py\"",
",",
"\"--dest\"",
",",
"str",
"(",
"absolute_output_folder",
")",
",",
"package_name",
"]",
",",
"cwd",
"=",
"sdk_folder",
")",
"_LOGGER",
".",
"debug",
"(",
"\"Build finished: {}\"",
".",
"format",
"(",
"package_name",
")",
")",
"if",
"with_comment",
":",
"files",
"=",
"[",
"f",
".",
"name",
"for",
"f",
"in",
"absolute_output_folder",
".",
"iterdir",
"(",
")",
"]",
"comment_message",
"=",
"None",
"dashboard",
"=",
"DashboardCommentableObject",
"(",
"sdk_pr",
",",
"\"(message created by the CI based on PR content)\"",
")",
"try",
":",
"installation_message",
"=",
"build_installation_message",
"(",
"sdk_pr",
")",
"download_message",
"=",
"build_download_message",
"(",
"sdk_pr",
",",
"files",
")",
"comment_message",
"=",
"installation_message",
"+",
"\"\\n\\n\"",
"+",
"download_message",
"dashboard",
".",
"create_comment",
"(",
"comment_message",
")",
"except",
"Exception",
":",
"_LOGGER",
".",
"critical",
"(",
"\"Unable to do PR comment:\\n%s\"",
",",
"comment_message",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
RedisOperations.import_data
|
Import data into Redis cache.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param name: The name of the Redis cache.
:type name: str
:param files: files to import.
:type files: list[str]
:param format: File format.
:type format: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
|
azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py
|
def import_data(
self, resource_group_name, name, files, format=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Import data into Redis cache.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param name: The name of the Redis cache.
:type name: str
:param files: files to import.
:type files: list[str]
:param format: File format.
:type format: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._import_data_initial(
resource_group_name=resource_group_name,
name=name,
files=files,
format=format,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
|
def import_data(
self, resource_group_name, name, files, format=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Import data into Redis cache.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param name: The name of the Redis cache.
:type name: str
:param files: files to import.
:type files: list[str]
:param format: File format.
:type format: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._import_data_initial(
resource_group_name=resource_group_name,
name=name,
files=files,
format=format,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
|
[
"Import",
"data",
"into",
"Redis",
"cache",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py#L864-L908
|
[
"def",
"import_data",
"(",
"self",
",",
"resource_group_name",
",",
"name",
",",
"files",
",",
"format",
"=",
"None",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"polling",
"=",
"True",
",",
"*",
"*",
"operation_config",
")",
":",
"raw_result",
"=",
"self",
".",
"_import_data_initial",
"(",
"resource_group_name",
"=",
"resource_group_name",
",",
"name",
"=",
"name",
",",
"files",
"=",
"files",
",",
"format",
"=",
"format",
",",
"custom_headers",
"=",
"custom_headers",
",",
"raw",
"=",
"True",
",",
"*",
"*",
"operation_config",
")",
"def",
"get_long_running_output",
"(",
"response",
")",
":",
"if",
"raw",
":",
"client_raw_response",
"=",
"ClientRawResponse",
"(",
"None",
",",
"response",
")",
"return",
"client_raw_response",
"lro_delay",
"=",
"operation_config",
".",
"get",
"(",
"'long_running_operation_timeout'",
",",
"self",
".",
"config",
".",
"long_running_operation_timeout",
")",
"if",
"polling",
"is",
"True",
":",
"polling_method",
"=",
"ARMPolling",
"(",
"lro_delay",
",",
"*",
"*",
"operation_config",
")",
"elif",
"polling",
"is",
"False",
":",
"polling_method",
"=",
"NoPolling",
"(",
")",
"else",
":",
"polling_method",
"=",
"polling",
"return",
"LROPoller",
"(",
"self",
".",
"_client",
",",
"raw_result",
",",
"get_long_running_output",
",",
"polling_method",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
KeyVaultId.create_object_id
|
:param collection: The resource collection type.
:type collection: str
:param vault: The vault URI.
:type vault: str
:param name: The resource name.
:type name: str
:param version: The resource version.
:type version: str
:rtype: KeyVaultId
|
azure-keyvault/azure/keyvault/key_vault_id.py
|
def create_object_id(collection, vault, name, version):
"""
:param collection: The resource collection type.
:type collection: str
:param vault: The vault URI.
:type vault: str
:param name: The resource name.
:type name: str
:param version: The resource version.
:type version: str
:rtype: KeyVaultId
"""
collection = _validate_string_argument(collection, 'collection')
vault = _validate_string_argument(vault, 'vault')
name = _validate_string_argument(name, 'name')
version = _validate_string_argument(version, 'version', True)
_parse_uri_argument(vault) # check that vault is a valid URI but don't change it
return KeyVaultIdentifier(collection=collection, vault=vault, name=name, version=version)
|
def create_object_id(collection, vault, name, version):
"""
:param collection: The resource collection type.
:type collection: str
:param vault: The vault URI.
:type vault: str
:param name: The resource name.
:type name: str
:param version: The resource version.
:type version: str
:rtype: KeyVaultId
"""
collection = _validate_string_argument(collection, 'collection')
vault = _validate_string_argument(vault, 'vault')
name = _validate_string_argument(name, 'name')
version = _validate_string_argument(version, 'version', True)
_parse_uri_argument(vault) # check that vault is a valid URI but don't change it
return KeyVaultIdentifier(collection=collection, vault=vault, name=name, version=version)
|
[
":",
"param",
"collection",
":",
"The",
"resource",
"collection",
"type",
".",
":",
"type",
"collection",
":",
"str",
":",
"param",
"vault",
":",
"The",
"vault",
"URI",
".",
":",
"type",
"vault",
":",
"str",
":",
"param",
"name",
":",
"The",
"resource",
"name",
".",
":",
"type",
"name",
":",
"str",
":",
"param",
"version",
":",
"The",
"resource",
"version",
".",
":",
"type",
"version",
":",
"str",
":",
"rtype",
":",
"KeyVaultId"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-keyvault/azure/keyvault/key_vault_id.py#L59-L76
|
[
"def",
"create_object_id",
"(",
"collection",
",",
"vault",
",",
"name",
",",
"version",
")",
":",
"collection",
"=",
"_validate_string_argument",
"(",
"collection",
",",
"'collection'",
")",
"vault",
"=",
"_validate_string_argument",
"(",
"vault",
",",
"'vault'",
")",
"name",
"=",
"_validate_string_argument",
"(",
"name",
",",
"'name'",
")",
"version",
"=",
"_validate_string_argument",
"(",
"version",
",",
"'version'",
",",
"True",
")",
"_parse_uri_argument",
"(",
"vault",
")",
"# check that vault is a valid URI but don't change it",
"return",
"KeyVaultIdentifier",
"(",
"collection",
"=",
"collection",
",",
"vault",
"=",
"vault",
",",
"name",
"=",
"name",
",",
"version",
"=",
"version",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
KeyVaultId.parse_object_id
|
:param collection: The resource collection type.
:type collection: str
:param id: The resource uri.
:type id: str
:rtype: KeyVaultId
|
azure-keyvault/azure/keyvault/key_vault_id.py
|
def parse_object_id(collection, id):
"""
:param collection: The resource collection type.
:type collection: str
:param id: The resource uri.
:type id: str
:rtype: KeyVaultId
"""
collection = _validate_string_argument(collection, 'collection')
return KeyVaultIdentifier(uri=id, collection=collection)
|
def parse_object_id(collection, id):
"""
:param collection: The resource collection type.
:type collection: str
:param id: The resource uri.
:type id: str
:rtype: KeyVaultId
"""
collection = _validate_string_argument(collection, 'collection')
return KeyVaultIdentifier(uri=id, collection=collection)
|
[
":",
"param",
"collection",
":",
"The",
"resource",
"collection",
"type",
".",
":",
"type",
"collection",
":",
"str",
":",
"param",
"id",
":",
"The",
"resource",
"uri",
".",
":",
"type",
"id",
":",
"str",
":",
"rtype",
":",
"KeyVaultId"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-keyvault/azure/keyvault/key_vault_id.py#L79-L88
|
[
"def",
"parse_object_id",
"(",
"collection",
",",
"id",
")",
":",
"collection",
"=",
"_validate_string_argument",
"(",
"collection",
",",
"'collection'",
")",
"return",
"KeyVaultIdentifier",
"(",
"uri",
"=",
"id",
",",
"collection",
"=",
"collection",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
KeyVaultId.create_key_id
|
:param vault: The vault uri.
:type vault: str
:param name: The key name.
:type name: str
:param version: The key version.
:type version: str
:rtype: KeyVaultId
|
azure-keyvault/azure/keyvault/key_vault_id.py
|
def create_key_id(vault, name, version=None):
"""
:param vault: The vault uri.
:type vault: str
:param name: The key name.
:type name: str
:param version: The key version.
:type version: str
:rtype: KeyVaultId
"""
return KeyId(vault=vault, name=name, version=version)
|
def create_key_id(vault, name, version=None):
"""
:param vault: The vault uri.
:type vault: str
:param name: The key name.
:type name: str
:param version: The key version.
:type version: str
:rtype: KeyVaultId
"""
return KeyId(vault=vault, name=name, version=version)
|
[
":",
"param",
"vault",
":",
"The",
"vault",
"uri",
".",
":",
"type",
"vault",
":",
"str",
":",
"param",
"name",
":",
"The",
"key",
"name",
".",
":",
"type",
"name",
":",
"str",
":",
"param",
"version",
":",
"The",
"key",
"version",
".",
":",
"type",
"version",
":",
"str",
":",
"rtype",
":",
"KeyVaultId"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-keyvault/azure/keyvault/key_vault_id.py#L91-L101
|
[
"def",
"create_key_id",
"(",
"vault",
",",
"name",
",",
"version",
"=",
"None",
")",
":",
"return",
"KeyId",
"(",
"vault",
"=",
"vault",
",",
"name",
"=",
"name",
",",
"version",
"=",
"version",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
KeyVaultId.create_secret_id
|
:param vault: The vault uri.
:type vault: str
:param name: The secret name.
:type name: str
:param version: The secret version.
:type version: str
:rtype: KeyVaultId
|
azure-keyvault/azure/keyvault/key_vault_id.py
|
def create_secret_id(vault, name, version=None):
"""
:param vault: The vault uri.
:type vault: str
:param name: The secret name.
:type name: str
:param version: The secret version.
:type version: str
:rtype: KeyVaultId
"""
return SecretId(vault=vault, name=name, version=version)
|
def create_secret_id(vault, name, version=None):
"""
:param vault: The vault uri.
:type vault: str
:param name: The secret name.
:type name: str
:param version: The secret version.
:type version: str
:rtype: KeyVaultId
"""
return SecretId(vault=vault, name=name, version=version)
|
[
":",
"param",
"vault",
":",
"The",
"vault",
"uri",
".",
":",
"type",
"vault",
":",
"str",
":",
"param",
"name",
":",
"The",
"secret",
"name",
".",
":",
"type",
"name",
":",
"str",
":",
"param",
"version",
":",
"The",
"secret",
"version",
".",
":",
"type",
"version",
":",
"str",
":",
"rtype",
":",
"KeyVaultId"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-keyvault/azure/keyvault/key_vault_id.py#L113-L123
|
[
"def",
"create_secret_id",
"(",
"vault",
",",
"name",
",",
"version",
"=",
"None",
")",
":",
"return",
"SecretId",
"(",
"vault",
"=",
"vault",
",",
"name",
"=",
"name",
",",
"version",
"=",
"version",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
KeyVaultId.create_certificate_id
|
:param vault: The vault uri.
:type vault: str
:param name: The certificate name.
:type name: str
:param version: The certificate version.
:type version: str
:rtype: KeyVaultId
|
azure-keyvault/azure/keyvault/key_vault_id.py
|
def create_certificate_id(vault, name, version=None):
"""
:param vault: The vault uri.
:type vault: str
:param name: The certificate name.
:type name: str
:param version: The certificate version.
:type version: str
:rtype: KeyVaultId
"""
return CertificateId(vault=vault, name=name, version=version)
|
def create_certificate_id(vault, name, version=None):
"""
:param vault: The vault uri.
:type vault: str
:param name: The certificate name.
:type name: str
:param version: The certificate version.
:type version: str
:rtype: KeyVaultId
"""
return CertificateId(vault=vault, name=name, version=version)
|
[
":",
"param",
"vault",
":",
"The",
"vault",
"uri",
".",
":",
"type",
"vault",
":",
"str",
":",
"param",
"name",
":",
"The",
"certificate",
"name",
".",
":",
"type",
"name",
":",
"str",
":",
"param",
"version",
":",
"The",
"certificate",
"version",
".",
":",
"type",
"version",
":",
"str",
":",
"rtype",
":",
"KeyVaultId"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-keyvault/azure/keyvault/key_vault_id.py#L135-L145
|
[
"def",
"create_certificate_id",
"(",
"vault",
",",
"name",
",",
"version",
"=",
"None",
")",
":",
"return",
"CertificateId",
"(",
"vault",
"=",
"vault",
",",
"name",
"=",
"name",
",",
"version",
"=",
"version",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
KeyVaultIdentifier._format
|
Formats the KeyVaultIdentifier into a identifier uri based of the specified format string
:param fmt: The format string for the identifier uri
:return: The formatted key vault object identifier uri
|
azure-keyvault/azure/keyvault/key_vault_id.py
|
def _format(self, fmt=None):
"""
Formats the KeyVaultIdentifier into a identifier uri based of the specified format string
:param fmt: The format string for the identifier uri
:return: The formatted key vault object identifier uri
"""
# if no fmt was specified use the _id_format from the current object
fmt = fmt or self._id_format
segments = []
# split the formatting string into segments
for fmt_seg in fmt.split('/'):
# if the segment is a substitution element
if fmt_seg.startswith('{') and fmt_seg.endswith('}'):
# get the attribute name from the segment element
fmt_seg = fmt_seg[1:-1]
fmt_prop = fmt_seg.rstrip('?')
# get the value of the attribute from the current object
seg_val = getattr(self, fmt_prop)
# if the attribute is specified add the value to the formatted segments
if seg_val:
segments.append(seg_val.strip('/').strip())
# if the attribute is not specified and the substitution is not optional raise an error
else:
if not fmt_seg.endswith('?'):
raise ValueError('invalid id: No value specified for the required segment "{}"'.format(fmt_prop))
# if the segment is a literal element simply add it to the formatted segments
else:
segments.append(fmt_seg)
# join all the formatted segments together
return '/'.join(segments)
|
def _format(self, fmt=None):
"""
Formats the KeyVaultIdentifier into a identifier uri based of the specified format string
:param fmt: The format string for the identifier uri
:return: The formatted key vault object identifier uri
"""
# if no fmt was specified use the _id_format from the current object
fmt = fmt or self._id_format
segments = []
# split the formatting string into segments
for fmt_seg in fmt.split('/'):
# if the segment is a substitution element
if fmt_seg.startswith('{') and fmt_seg.endswith('}'):
# get the attribute name from the segment element
fmt_seg = fmt_seg[1:-1]
fmt_prop = fmt_seg.rstrip('?')
# get the value of the attribute from the current object
seg_val = getattr(self, fmt_prop)
# if the attribute is specified add the value to the formatted segments
if seg_val:
segments.append(seg_val.strip('/').strip())
# if the attribute is not specified and the substitution is not optional raise an error
else:
if not fmt_seg.endswith('?'):
raise ValueError('invalid id: No value specified for the required segment "{}"'.format(fmt_prop))
# if the segment is a literal element simply add it to the formatted segments
else:
segments.append(fmt_seg)
# join all the formatted segments together
return '/'.join(segments)
|
[
"Formats",
"the",
"KeyVaultIdentifier",
"into",
"a",
"identifier",
"uri",
"based",
"of",
"the",
"specified",
"format",
"string",
":",
"param",
"fmt",
":",
"The",
"format",
"string",
"for",
"the",
"identifier",
"uri",
":",
"return",
":",
"The",
"formatted",
"key",
"vault",
"object",
"identifier",
"uri"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-keyvault/azure/keyvault/key_vault_id.py#L234-L268
|
[
"def",
"_format",
"(",
"self",
",",
"fmt",
"=",
"None",
")",
":",
"# if no fmt was specified use the _id_format from the current object",
"fmt",
"=",
"fmt",
"or",
"self",
".",
"_id_format",
"segments",
"=",
"[",
"]",
"# split the formatting string into segments",
"for",
"fmt_seg",
"in",
"fmt",
".",
"split",
"(",
"'/'",
")",
":",
"# if the segment is a substitution element",
"if",
"fmt_seg",
".",
"startswith",
"(",
"'{'",
")",
"and",
"fmt_seg",
".",
"endswith",
"(",
"'}'",
")",
":",
"# get the attribute name from the segment element",
"fmt_seg",
"=",
"fmt_seg",
"[",
"1",
":",
"-",
"1",
"]",
"fmt_prop",
"=",
"fmt_seg",
".",
"rstrip",
"(",
"'?'",
")",
"# get the value of the attribute from the current object",
"seg_val",
"=",
"getattr",
"(",
"self",
",",
"fmt_prop",
")",
"# if the attribute is specified add the value to the formatted segments",
"if",
"seg_val",
":",
"segments",
".",
"append",
"(",
"seg_val",
".",
"strip",
"(",
"'/'",
")",
".",
"strip",
"(",
")",
")",
"# if the attribute is not specified and the substitution is not optional raise an error",
"else",
":",
"if",
"not",
"fmt_seg",
".",
"endswith",
"(",
"'?'",
")",
":",
"raise",
"ValueError",
"(",
"'invalid id: No value specified for the required segment \"{}\"'",
".",
"format",
"(",
"fmt_prop",
")",
")",
"# if the segment is a literal element simply add it to the formatted segments",
"else",
":",
"segments",
".",
"append",
"(",
"fmt_seg",
")",
"# join all the formatted segments together",
"return",
"'/'",
".",
"join",
"(",
"segments",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
KeyVaultIdentifier._parse
|
Parses the specified uri, using _id_format as a format string, and sets the parsed format arguments as
attributes on the current id object.
:param uri: The key vault identifier uri to be parsed
:param validation_args: format arguments to be validated
:return: None
|
azure-keyvault/azure/keyvault/key_vault_id.py
|
def _parse(self, uri, validation_args):
"""
Parses the specified uri, using _id_format as a format string, and sets the parsed format arguments as
attributes on the current id object.
:param uri: The key vault identifier uri to be parsed
:param validation_args: format arguments to be validated
:return: None
"""
def format_error():
return ValueError('invalid id: The specified uri "{}", does to match the specified format "{}"'.format(uri, self._id_format))
uri = _validate_string_argument(uri, 'uri')
parsed_uri = _parse_uri_argument(uri)
# split all the id segments from the uri path using and insert the host as the first segment
id_segs = list(filter(None, parsed_uri.path.split('/')))
id_segs.insert(0, '{}://{}'.format(parsed_uri.scheme, parsed_uri.hostname))
# split the format segments from the classes format string
fmt_segs = list(filter(None, self._id_format.split('/')))
for ix in range(len(fmt_segs)):
# get the format segment and the id segment
fmt_seg = fmt_segs[ix]
id_seg = id_segs.pop(0) if len(id_segs) > 0 else ''
# if the segment is a substitution element
if fmt_seg.startswith('{') and fmt_seg.endswith('}'):
prop = fmt_seg[1:-1]
prop_strip = prop.rstrip('?')
# if the segment is not present in the specified uri and is not optional raise an error
if not id_seg and not prop.endswith('?'):
raise format_error()
# if the segment is in the segments to validate and doesn't match the expected vault raise an error
if prop_strip in validation_args and validation_args[prop_strip] and validation_args[prop_strip] != id_seg:
if id_seg and not prop.endswith('?'):
raise ValueError('invalid id: The {} "{}" does not match the expected "{}"'.format(prop, id_seg, validation_args[prop_strip]))
# set the attribute to the value parsed from the uri
self.__dict__[prop_strip] = id_seg
# otherwise the segment is a literal element
else:
# if the value parsed from the uri doesn't match the literal value from the format string raise an error
if not fmt_seg == id_seg:
raise format_error()
# if there are still segments left in the uri which were not accounted for in the format string raise an error
if len(id_segs) > 0:
raise format_error()
|
def _parse(self, uri, validation_args):
"""
Parses the specified uri, using _id_format as a format string, and sets the parsed format arguments as
attributes on the current id object.
:param uri: The key vault identifier uri to be parsed
:param validation_args: format arguments to be validated
:return: None
"""
def format_error():
return ValueError('invalid id: The specified uri "{}", does to match the specified format "{}"'.format(uri, self._id_format))
uri = _validate_string_argument(uri, 'uri')
parsed_uri = _parse_uri_argument(uri)
# split all the id segments from the uri path using and insert the host as the first segment
id_segs = list(filter(None, parsed_uri.path.split('/')))
id_segs.insert(0, '{}://{}'.format(parsed_uri.scheme, parsed_uri.hostname))
# split the format segments from the classes format string
fmt_segs = list(filter(None, self._id_format.split('/')))
for ix in range(len(fmt_segs)):
# get the format segment and the id segment
fmt_seg = fmt_segs[ix]
id_seg = id_segs.pop(0) if len(id_segs) > 0 else ''
# if the segment is a substitution element
if fmt_seg.startswith('{') and fmt_seg.endswith('}'):
prop = fmt_seg[1:-1]
prop_strip = prop.rstrip('?')
# if the segment is not present in the specified uri and is not optional raise an error
if not id_seg and not prop.endswith('?'):
raise format_error()
# if the segment is in the segments to validate and doesn't match the expected vault raise an error
if prop_strip in validation_args and validation_args[prop_strip] and validation_args[prop_strip] != id_seg:
if id_seg and not prop.endswith('?'):
raise ValueError('invalid id: The {} "{}" does not match the expected "{}"'.format(prop, id_seg, validation_args[prop_strip]))
# set the attribute to the value parsed from the uri
self.__dict__[prop_strip] = id_seg
# otherwise the segment is a literal element
else:
# if the value parsed from the uri doesn't match the literal value from the format string raise an error
if not fmt_seg == id_seg:
raise format_error()
# if there are still segments left in the uri which were not accounted for in the format string raise an error
if len(id_segs) > 0:
raise format_error()
|
[
"Parses",
"the",
"specified",
"uri",
"using",
"_id_format",
"as",
"a",
"format",
"string",
"and",
"sets",
"the",
"parsed",
"format",
"arguments",
"as",
"attributes",
"on",
"the",
"current",
"id",
"object",
".",
":",
"param",
"uri",
":",
"The",
"key",
"vault",
"identifier",
"uri",
"to",
"be",
"parsed",
":",
"param",
"validation_args",
":",
"format",
"arguments",
"to",
"be",
"validated",
":",
"return",
":",
"None"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-keyvault/azure/keyvault/key_vault_id.py#L270-L317
|
[
"def",
"_parse",
"(",
"self",
",",
"uri",
",",
"validation_args",
")",
":",
"def",
"format_error",
"(",
")",
":",
"return",
"ValueError",
"(",
"'invalid id: The specified uri \"{}\", does to match the specified format \"{}\"'",
".",
"format",
"(",
"uri",
",",
"self",
".",
"_id_format",
")",
")",
"uri",
"=",
"_validate_string_argument",
"(",
"uri",
",",
"'uri'",
")",
"parsed_uri",
"=",
"_parse_uri_argument",
"(",
"uri",
")",
"# split all the id segments from the uri path using and insert the host as the first segment",
"id_segs",
"=",
"list",
"(",
"filter",
"(",
"None",
",",
"parsed_uri",
".",
"path",
".",
"split",
"(",
"'/'",
")",
")",
")",
"id_segs",
".",
"insert",
"(",
"0",
",",
"'{}://{}'",
".",
"format",
"(",
"parsed_uri",
".",
"scheme",
",",
"parsed_uri",
".",
"hostname",
")",
")",
"# split the format segments from the classes format string",
"fmt_segs",
"=",
"list",
"(",
"filter",
"(",
"None",
",",
"self",
".",
"_id_format",
".",
"split",
"(",
"'/'",
")",
")",
")",
"for",
"ix",
"in",
"range",
"(",
"len",
"(",
"fmt_segs",
")",
")",
":",
"# get the format segment and the id segment",
"fmt_seg",
"=",
"fmt_segs",
"[",
"ix",
"]",
"id_seg",
"=",
"id_segs",
".",
"pop",
"(",
"0",
")",
"if",
"len",
"(",
"id_segs",
")",
">",
"0",
"else",
"''",
"# if the segment is a substitution element",
"if",
"fmt_seg",
".",
"startswith",
"(",
"'{'",
")",
"and",
"fmt_seg",
".",
"endswith",
"(",
"'}'",
")",
":",
"prop",
"=",
"fmt_seg",
"[",
"1",
":",
"-",
"1",
"]",
"prop_strip",
"=",
"prop",
".",
"rstrip",
"(",
"'?'",
")",
"# if the segment is not present in the specified uri and is not optional raise an error",
"if",
"not",
"id_seg",
"and",
"not",
"prop",
".",
"endswith",
"(",
"'?'",
")",
":",
"raise",
"format_error",
"(",
")",
"# if the segment is in the segments to validate and doesn't match the expected vault raise an error",
"if",
"prop_strip",
"in",
"validation_args",
"and",
"validation_args",
"[",
"prop_strip",
"]",
"and",
"validation_args",
"[",
"prop_strip",
"]",
"!=",
"id_seg",
":",
"if",
"id_seg",
"and",
"not",
"prop",
".",
"endswith",
"(",
"'?'",
")",
":",
"raise",
"ValueError",
"(",
"'invalid id: The {} \"{}\" does not match the expected \"{}\"'",
".",
"format",
"(",
"prop",
",",
"id_seg",
",",
"validation_args",
"[",
"prop_strip",
"]",
")",
")",
"# set the attribute to the value parsed from the uri",
"self",
".",
"__dict__",
"[",
"prop_strip",
"]",
"=",
"id_seg",
"# otherwise the segment is a literal element",
"else",
":",
"# if the value parsed from the uri doesn't match the literal value from the format string raise an error",
"if",
"not",
"fmt_seg",
"==",
"id_seg",
":",
"raise",
"format_error",
"(",
")",
"# if there are still segments left in the uri which were not accounted for in the format string raise an error",
"if",
"len",
"(",
"id_segs",
")",
">",
"0",
":",
"raise",
"format_error",
"(",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
RunbookOperations.publish
|
Publish runbook draft.
:param resource_group_name: Name of an Azure Resource group.
:type resource_group_name: str
:param automation_account_name: The name of the automation account.
:type automation_account_name: str
:param runbook_name: The parameters supplied to the publish runbook
operation.
:type runbook_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
|
azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py
|
def publish(
self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Publish runbook draft.
:param resource_group_name: Name of an Azure Resource group.
:type resource_group_name: str
:param automation_account_name: The name of the automation account.
:type automation_account_name: str
:param runbook_name: The parameters supplied to the publish runbook
operation.
:type runbook_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
"""
raw_result = self._publish_initial(
resource_group_name=resource_group_name,
automation_account_name=automation_account_name,
runbook_name=runbook_name,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response.add_headers({
'location': 'str',
})
return client_raw_response
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
|
def publish(
self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Publish runbook draft.
:param resource_group_name: Name of an Azure Resource group.
:type resource_group_name: str
:param automation_account_name: The name of the automation account.
:type automation_account_name: str
:param runbook_name: The parameters supplied to the publish runbook
operation.
:type runbook_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
"""
raw_result = self._publish_initial(
resource_group_name=resource_group_name,
automation_account_name=automation_account_name,
runbook_name=runbook_name,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response.add_headers({
'location': 'str',
})
return client_raw_response
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
|
[
"Publish",
"runbook",
"draft",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py#L83-L129
|
[
"def",
"publish",
"(",
"self",
",",
"resource_group_name",
",",
"automation_account_name",
",",
"runbook_name",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"polling",
"=",
"True",
",",
"*",
"*",
"operation_config",
")",
":",
"raw_result",
"=",
"self",
".",
"_publish_initial",
"(",
"resource_group_name",
"=",
"resource_group_name",
",",
"automation_account_name",
"=",
"automation_account_name",
",",
"runbook_name",
"=",
"runbook_name",
",",
"custom_headers",
"=",
"custom_headers",
",",
"raw",
"=",
"True",
",",
"*",
"*",
"operation_config",
")",
"def",
"get_long_running_output",
"(",
"response",
")",
":",
"if",
"raw",
":",
"client_raw_response",
"=",
"ClientRawResponse",
"(",
"None",
",",
"response",
")",
"client_raw_response",
".",
"add_headers",
"(",
"{",
"'location'",
":",
"'str'",
",",
"}",
")",
"return",
"client_raw_response",
"lro_delay",
"=",
"operation_config",
".",
"get",
"(",
"'long_running_operation_timeout'",
",",
"self",
".",
"config",
".",
"long_running_operation_timeout",
")",
"if",
"polling",
"is",
"True",
":",
"polling_method",
"=",
"ARMPolling",
"(",
"lro_delay",
",",
"*",
"*",
"operation_config",
")",
"elif",
"polling",
"is",
"False",
":",
"polling_method",
"=",
"NoPolling",
"(",
")",
"else",
":",
"polling_method",
"=",
"polling",
"return",
"LROPoller",
"(",
"self",
".",
"_client",
",",
"raw_result",
",",
"get_long_running_output",
",",
"polling_method",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
Message.renew_lock
|
Renew the message lock.
This will maintain the lock on the message to ensure
it is not returned to the queue to be reprocessed. In order to complete (or otherwise settle)
the message, the lock must be maintained. Messages received via ReceiveAndDelete mode are not
locked, and therefore cannot be renewed. This operation can also be performed as an asynchronous
background task by registering the message with an `azure.servicebus.aio.AutoLockRenew` instance.
This operation is only available for non-sessionful messages.
:raises: TypeError if the message is sessionful.
:raises: ~azure.servicebus.common.errors.MessageLockExpired is message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled is message has already been settled.
|
azure-servicebus/azure/servicebus/aio/async_message.py
|
async def renew_lock(self):
"""Renew the message lock.
This will maintain the lock on the message to ensure
it is not returned to the queue to be reprocessed. In order to complete (or otherwise settle)
the message, the lock must be maintained. Messages received via ReceiveAndDelete mode are not
locked, and therefore cannot be renewed. This operation can also be performed as an asynchronous
background task by registering the message with an `azure.servicebus.aio.AutoLockRenew` instance.
This operation is only available for non-sessionful messages.
:raises: TypeError if the message is sessionful.
:raises: ~azure.servicebus.common.errors.MessageLockExpired is message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled is message has already been settled.
"""
if hasattr(self._receiver, 'locked_until'):
raise TypeError("Session messages cannot be renewed. Please renew the Session lock instead.")
self._is_live('renew')
expiry = await self._receiver._renew_locks(self.lock_token) # pylint: disable=protected-access
self._expiry = datetime.datetime.fromtimestamp(expiry[b'expirations'][0]/1000.0)
|
async def renew_lock(self):
"""Renew the message lock.
This will maintain the lock on the message to ensure
it is not returned to the queue to be reprocessed. In order to complete (or otherwise settle)
the message, the lock must be maintained. Messages received via ReceiveAndDelete mode are not
locked, and therefore cannot be renewed. This operation can also be performed as an asynchronous
background task by registering the message with an `azure.servicebus.aio.AutoLockRenew` instance.
This operation is only available for non-sessionful messages.
:raises: TypeError if the message is sessionful.
:raises: ~azure.servicebus.common.errors.MessageLockExpired is message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled is message has already been settled.
"""
if hasattr(self._receiver, 'locked_until'):
raise TypeError("Session messages cannot be renewed. Please renew the Session lock instead.")
self._is_live('renew')
expiry = await self._receiver._renew_locks(self.lock_token) # pylint: disable=protected-access
self._expiry = datetime.datetime.fromtimestamp(expiry[b'expirations'][0]/1000.0)
|
[
"Renew",
"the",
"message",
"lock",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicebus/azure/servicebus/aio/async_message.py#L44-L63
|
[
"async",
"def",
"renew_lock",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
".",
"_receiver",
",",
"'locked_until'",
")",
":",
"raise",
"TypeError",
"(",
"\"Session messages cannot be renewed. Please renew the Session lock instead.\"",
")",
"self",
".",
"_is_live",
"(",
"'renew'",
")",
"expiry",
"=",
"await",
"self",
".",
"_receiver",
".",
"_renew_locks",
"(",
"self",
".",
"lock_token",
")",
"# pylint: disable=protected-access",
"self",
".",
"_expiry",
"=",
"datetime",
".",
"datetime",
".",
"fromtimestamp",
"(",
"expiry",
"[",
"b'expirations'",
"]",
"[",
"0",
"]",
"/",
"1000.0",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
Message.dead_letter
|
Move the message to the Dead Letter queue.
The Dead Letter queue is a sub-queue that can be
used to store messages that failed to process correctly, or otherwise require further inspection
or processing. The queue can also be configured to send expired messages to the Dead Letter queue.
To receive dead-lettered messages, use `QueueClient.get_deadletter_receiver()` or
`SubscriptionClient.get_deadletter_receiver()`.
:param description: The reason for dead-lettering the message.
:type description: str
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageSettleFailed if message settle operation fails.
|
azure-servicebus/azure/servicebus/aio/async_message.py
|
async def dead_letter(self, description=None):
"""Move the message to the Dead Letter queue.
The Dead Letter queue is a sub-queue that can be
used to store messages that failed to process correctly, or otherwise require further inspection
or processing. The queue can also be configured to send expired messages to the Dead Letter queue.
To receive dead-lettered messages, use `QueueClient.get_deadletter_receiver()` or
`SubscriptionClient.get_deadletter_receiver()`.
:param description: The reason for dead-lettering the message.
:type description: str
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageSettleFailed if message settle operation fails.
"""
self._is_live('reject')
try:
reject = functools.partial(self.message.reject, condition=DEADLETTERNAME, description=description)
await self._loop.run_in_executor(None, reject)
except Exception as e:
raise MessageSettleFailed("reject", e)
|
async def dead_letter(self, description=None):
"""Move the message to the Dead Letter queue.
The Dead Letter queue is a sub-queue that can be
used to store messages that failed to process correctly, or otherwise require further inspection
or processing. The queue can also be configured to send expired messages to the Dead Letter queue.
To receive dead-lettered messages, use `QueueClient.get_deadletter_receiver()` or
`SubscriptionClient.get_deadletter_receiver()`.
:param description: The reason for dead-lettering the message.
:type description: str
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageSettleFailed if message settle operation fails.
"""
self._is_live('reject')
try:
reject = functools.partial(self.message.reject, condition=DEADLETTERNAME, description=description)
await self._loop.run_in_executor(None, reject)
except Exception as e:
raise MessageSettleFailed("reject", e)
|
[
"Move",
"the",
"message",
"to",
"the",
"Dead",
"Letter",
"queue",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicebus/azure/servicebus/aio/async_message.py#L79-L100
|
[
"async",
"def",
"dead_letter",
"(",
"self",
",",
"description",
"=",
"None",
")",
":",
"self",
".",
"_is_live",
"(",
"'reject'",
")",
"try",
":",
"reject",
"=",
"functools",
".",
"partial",
"(",
"self",
".",
"message",
".",
"reject",
",",
"condition",
"=",
"DEADLETTERNAME",
",",
"description",
"=",
"description",
")",
"await",
"self",
".",
"_loop",
".",
"run_in_executor",
"(",
"None",
",",
"reject",
")",
"except",
"Exception",
"as",
"e",
":",
"raise",
"MessageSettleFailed",
"(",
"\"reject\"",
",",
"e",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
Message.abandon
|
Abandon the message.
This message will be returned to the queue to be reprocessed.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageSettleFailed if message settle operation fails.
|
azure-servicebus/azure/servicebus/aio/async_message.py
|
async def abandon(self):
"""Abandon the message.
This message will be returned to the queue to be reprocessed.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageSettleFailed if message settle operation fails.
"""
self._is_live('abandon')
try:
modify = functools.partial(self.message.modify, True, False)
await self._loop.run_in_executor(None, modify)
except Exception as e:
raise MessageSettleFailed("abandon", e)
|
async def abandon(self):
"""Abandon the message.
This message will be returned to the queue to be reprocessed.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageSettleFailed if message settle operation fails.
"""
self._is_live('abandon')
try:
modify = functools.partial(self.message.modify, True, False)
await self._loop.run_in_executor(None, modify)
except Exception as e:
raise MessageSettleFailed("abandon", e)
|
[
"Abandon",
"the",
"message",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicebus/azure/servicebus/aio/async_message.py#L102-L117
|
[
"async",
"def",
"abandon",
"(",
"self",
")",
":",
"self",
".",
"_is_live",
"(",
"'abandon'",
")",
"try",
":",
"modify",
"=",
"functools",
".",
"partial",
"(",
"self",
".",
"message",
".",
"modify",
",",
"True",
",",
"False",
")",
"await",
"self",
".",
"_loop",
".",
"run_in_executor",
"(",
"None",
",",
"modify",
")",
"except",
"Exception",
"as",
"e",
":",
"raise",
"MessageSettleFailed",
"(",
"\"abandon\"",
",",
"e",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
DeferredMessage.complete
|
Complete the message.
This removes the message from the queue.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageSettleFailed if message settle operation fails.
|
azure-servicebus/azure/servicebus/aio/async_message.py
|
async def complete(self):
"""Complete the message.
This removes the message from the queue.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageSettleFailed if message settle operation fails.
"""
self._is_live('complete')
await self._receiver._settle_deferred('completed', [self.lock_token]) # pylint: disable=protected-access
self._settled = True
|
async def complete(self):
"""Complete the message.
This removes the message from the queue.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has already expired.
:raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
:raises: ~azure.servicebus.common.errors.MessageSettleFailed if message settle operation fails.
"""
self._is_live('complete')
await self._receiver._settle_deferred('completed', [self.lock_token]) # pylint: disable=protected-access
self._settled = True
|
[
"Complete",
"the",
"message",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicebus/azure/servicebus/aio/async_message.py#L167-L179
|
[
"async",
"def",
"complete",
"(",
"self",
")",
":",
"self",
".",
"_is_live",
"(",
"'complete'",
")",
"await",
"self",
".",
"_receiver",
".",
"_settle_deferred",
"(",
"'completed'",
",",
"[",
"self",
".",
"lock_token",
"]",
")",
"# pylint: disable=protected-access",
"self",
".",
"_settled",
"=",
"True"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
parse_input
|
From a syntax like package_name#submodule, build a package name
and complete module name.
|
scripts/multiapi_init_gen.py
|
def parse_input(input_parameter):
"""From a syntax like package_name#submodule, build a package name
and complete module name.
"""
split_package_name = input_parameter.split('#')
package_name = split_package_name[0]
module_name = package_name.replace("-", ".")
if len(split_package_name) >= 2:
module_name = ".".join([module_name, split_package_name[1]])
return package_name, module_name
|
def parse_input(input_parameter):
"""From a syntax like package_name#submodule, build a package name
and complete module name.
"""
split_package_name = input_parameter.split('#')
package_name = split_package_name[0]
module_name = package_name.replace("-", ".")
if len(split_package_name) >= 2:
module_name = ".".join([module_name, split_package_name[1]])
return package_name, module_name
|
[
"From",
"a",
"syntax",
"like",
"package_name#submodule",
"build",
"a",
"package",
"name",
"and",
"complete",
"module",
"name",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/scripts/multiapi_init_gen.py#L35-L44
|
[
"def",
"parse_input",
"(",
"input_parameter",
")",
":",
"split_package_name",
"=",
"input_parameter",
".",
"split",
"(",
"'#'",
")",
"package_name",
"=",
"split_package_name",
"[",
"0",
"]",
"module_name",
"=",
"package_name",
".",
"replace",
"(",
"\"-\"",
",",
"\".\"",
")",
"if",
"len",
"(",
"split_package_name",
")",
">=",
"2",
":",
"module_name",
"=",
"\".\"",
".",
"join",
"(",
"[",
"module_name",
",",
"split_package_name",
"[",
"1",
"]",
"]",
")",
"return",
"package_name",
",",
"module_name"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
extract_api_version_from_code
|
Will extract from __code__ the API version. Should be use if you use this is an operation group with no constant api_version.
|
scripts/multiapi_init_gen.py
|
def extract_api_version_from_code(function):
"""Will extract from __code__ the API version. Should be use if you use this is an operation group with no constant api_version.
"""
try:
srccode = inspect.getsource(function)
try:
ast_tree = ast.parse(srccode)
except IndentationError:
ast_tree = ast.parse('with 0:\n'+srccode)
api_version_visitor = ApiVersionExtractor()
api_version_visitor.visit(ast_tree)
return api_version_visitor.api_version
except Exception:
raise
|
def extract_api_version_from_code(function):
"""Will extract from __code__ the API version. Should be use if you use this is an operation group with no constant api_version.
"""
try:
srccode = inspect.getsource(function)
try:
ast_tree = ast.parse(srccode)
except IndentationError:
ast_tree = ast.parse('with 0:\n'+srccode)
api_version_visitor = ApiVersionExtractor()
api_version_visitor.visit(ast_tree)
return api_version_visitor.api_version
except Exception:
raise
|
[
"Will",
"extract",
"from",
"__code__",
"the",
"API",
"version",
".",
"Should",
"be",
"use",
"if",
"you",
"use",
"this",
"is",
"an",
"operation",
"group",
"with",
"no",
"constant",
"api_version",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/scripts/multiapi_init_gen.py#L71-L85
|
[
"def",
"extract_api_version_from_code",
"(",
"function",
")",
":",
"try",
":",
"srccode",
"=",
"inspect",
".",
"getsource",
"(",
"function",
")",
"try",
":",
"ast_tree",
"=",
"ast",
".",
"parse",
"(",
"srccode",
")",
"except",
"IndentationError",
":",
"ast_tree",
"=",
"ast",
".",
"parse",
"(",
"'with 0:\\n'",
"+",
"srccode",
")",
"api_version_visitor",
"=",
"ApiVersionExtractor",
"(",
")",
"api_version_visitor",
".",
"visit",
"(",
"ast_tree",
")",
"return",
"api_version_visitor",
".",
"api_version",
"except",
"Exception",
":",
"raise"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
AlterationsOperations.replace
|
Replace alterations data.
:param word_alterations: Collection of word alterations.
:type word_alterations:
list[~azure.cognitiveservices.knowledge.qnamaker.models.AlterationsDTO]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException>`
|
azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/alterations_operations.py
|
def replace(
self, word_alterations, custom_headers=None, raw=False, **operation_config):
"""Replace alterations data.
:param word_alterations: Collection of word alterations.
:type word_alterations:
list[~azure.cognitiveservices.knowledge.qnamaker.models.AlterationsDTO]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException>`
"""
word_alterations1 = models.WordAlterationsDTO(word_alterations=word_alterations)
# Construct URL
url = self.replace.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True)
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(word_alterations1, 'WordAlterationsDTO')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [204]:
raise models.ErrorResponseException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
|
def replace(
self, word_alterations, custom_headers=None, raw=False, **operation_config):
"""Replace alterations data.
:param word_alterations: Collection of word alterations.
:type word_alterations:
list[~azure.cognitiveservices.knowledge.qnamaker.models.AlterationsDTO]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException>`
"""
word_alterations1 = models.WordAlterationsDTO(word_alterations=word_alterations)
# Construct URL
url = self.replace.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True)
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(word_alterations1, 'WordAlterationsDTO')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [204]:
raise models.ErrorResponseException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
|
[
"Replace",
"alterations",
"data",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/alterations_operations.py#L87-L134
|
[
"def",
"replace",
"(",
"self",
",",
"word_alterations",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
":",
"word_alterations1",
"=",
"models",
".",
"WordAlterationsDTO",
"(",
"word_alterations",
"=",
"word_alterations",
")",
"# Construct URL",
"url",
"=",
"self",
".",
"replace",
".",
"metadata",
"[",
"'url'",
"]",
"path_format_arguments",
"=",
"{",
"'Endpoint'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"self.config.endpoint\"",
",",
"self",
".",
"config",
".",
"endpoint",
",",
"'str'",
",",
"skip_quote",
"=",
"True",
")",
"}",
"url",
"=",
"self",
".",
"_client",
".",
"format_url",
"(",
"url",
",",
"*",
"*",
"path_format_arguments",
")",
"# Construct parameters",
"query_parameters",
"=",
"{",
"}",
"# Construct headers",
"header_parameters",
"=",
"{",
"}",
"header_parameters",
"[",
"'Content-Type'",
"]",
"=",
"'application/json; charset=utf-8'",
"if",
"custom_headers",
":",
"header_parameters",
".",
"update",
"(",
"custom_headers",
")",
"# Construct body",
"body_content",
"=",
"self",
".",
"_serialize",
".",
"body",
"(",
"word_alterations1",
",",
"'WordAlterationsDTO'",
")",
"# Construct and send request",
"request",
"=",
"self",
".",
"_client",
".",
"put",
"(",
"url",
",",
"query_parameters",
",",
"header_parameters",
",",
"body_content",
")",
"response",
"=",
"self",
".",
"_client",
".",
"send",
"(",
"request",
",",
"stream",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
"if",
"response",
".",
"status_code",
"not",
"in",
"[",
"204",
"]",
":",
"raise",
"models",
".",
"ErrorResponseException",
"(",
"self",
".",
"_deserialize",
",",
"response",
")",
"if",
"raw",
":",
"client_raw_response",
"=",
"ClientRawResponse",
"(",
"None",
",",
"response",
")",
"return",
"client_raw_response"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
MeshSecretValueOperations.add_value
|
Adds the specified value as a new version of the specified secret
resource.
Creates a new value of the specified secret resource. The name of the
value is typically the version identifier. Once created the value
cannot be changed.
:param secret_resource_name: The name of the secret resource.
:type secret_resource_name: str
:param secret_value_resource_name: The name of the secret resource
value which is typically the version identifier for the value.
:type secret_value_resource_name: str
:param name: Version identifier of the secret value.
:type name: str
:param value: The actual value of the secret.
:type value: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: SecretValueResourceDescription or ClientRawResponse if
raw=true
:rtype: ~azure.servicefabric.models.SecretValueResourceDescription or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`FabricErrorException<azure.servicefabric.models.FabricErrorException>`
|
azure-servicefabric/azure/servicefabric/operations/mesh_secret_value_operations.py
|
def add_value(
self, secret_resource_name, secret_value_resource_name, name, value=None, custom_headers=None, raw=False, **operation_config):
"""Adds the specified value as a new version of the specified secret
resource.
Creates a new value of the specified secret resource. The name of the
value is typically the version identifier. Once created the value
cannot be changed.
:param secret_resource_name: The name of the secret resource.
:type secret_resource_name: str
:param secret_value_resource_name: The name of the secret resource
value which is typically the version identifier for the value.
:type secret_value_resource_name: str
:param name: Version identifier of the secret value.
:type name: str
:param value: The actual value of the secret.
:type value: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: SecretValueResourceDescription or ClientRawResponse if
raw=true
:rtype: ~azure.servicefabric.models.SecretValueResourceDescription or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`FabricErrorException<azure.servicefabric.models.FabricErrorException>`
"""
secret_value_resource_description = models.SecretValueResourceDescription(name=name, value=value)
# Construct URL
url = self.add_value.metadata['url']
path_format_arguments = {
'secretResourceName': self._serialize.url("secret_resource_name", secret_resource_name, 'str', skip_quote=True),
'secretValueResourceName': self._serialize.url("secret_value_resource_name", secret_value_resource_name, 'str', skip_quote=True)
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(secret_value_resource_description, 'SecretValueResourceDescription')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200, 201, 202]:
raise models.FabricErrorException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('SecretValueResourceDescription', response)
if response.status_code == 201:
deserialized = self._deserialize('SecretValueResourceDescription', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
|
def add_value(
self, secret_resource_name, secret_value_resource_name, name, value=None, custom_headers=None, raw=False, **operation_config):
"""Adds the specified value as a new version of the specified secret
resource.
Creates a new value of the specified secret resource. The name of the
value is typically the version identifier. Once created the value
cannot be changed.
:param secret_resource_name: The name of the secret resource.
:type secret_resource_name: str
:param secret_value_resource_name: The name of the secret resource
value which is typically the version identifier for the value.
:type secret_value_resource_name: str
:param name: Version identifier of the secret value.
:type name: str
:param value: The actual value of the secret.
:type value: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: SecretValueResourceDescription or ClientRawResponse if
raw=true
:rtype: ~azure.servicefabric.models.SecretValueResourceDescription or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`FabricErrorException<azure.servicefabric.models.FabricErrorException>`
"""
secret_value_resource_description = models.SecretValueResourceDescription(name=name, value=value)
# Construct URL
url = self.add_value.metadata['url']
path_format_arguments = {
'secretResourceName': self._serialize.url("secret_resource_name", secret_resource_name, 'str', skip_quote=True),
'secretValueResourceName': self._serialize.url("secret_value_resource_name", secret_value_resource_name, 'str', skip_quote=True)
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(secret_value_resource_description, 'SecretValueResourceDescription')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200, 201, 202]:
raise models.FabricErrorException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('SecretValueResourceDescription', response)
if response.status_code == 201:
deserialized = self._deserialize('SecretValueResourceDescription', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
|
[
"Adds",
"the",
"specified",
"value",
"as",
"a",
"new",
"version",
"of",
"the",
"specified",
"secret",
"resource",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicefabric/azure/servicefabric/operations/mesh_secret_value_operations.py#L38-L110
|
[
"def",
"add_value",
"(",
"self",
",",
"secret_resource_name",
",",
"secret_value_resource_name",
",",
"name",
",",
"value",
"=",
"None",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
":",
"secret_value_resource_description",
"=",
"models",
".",
"SecretValueResourceDescription",
"(",
"name",
"=",
"name",
",",
"value",
"=",
"value",
")",
"# Construct URL",
"url",
"=",
"self",
".",
"add_value",
".",
"metadata",
"[",
"'url'",
"]",
"path_format_arguments",
"=",
"{",
"'secretResourceName'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"secret_resource_name\"",
",",
"secret_resource_name",
",",
"'str'",
",",
"skip_quote",
"=",
"True",
")",
",",
"'secretValueResourceName'",
":",
"self",
".",
"_serialize",
".",
"url",
"(",
"\"secret_value_resource_name\"",
",",
"secret_value_resource_name",
",",
"'str'",
",",
"skip_quote",
"=",
"True",
")",
"}",
"url",
"=",
"self",
".",
"_client",
".",
"format_url",
"(",
"url",
",",
"*",
"*",
"path_format_arguments",
")",
"# Construct parameters",
"query_parameters",
"=",
"{",
"}",
"query_parameters",
"[",
"'api-version'",
"]",
"=",
"self",
".",
"_serialize",
".",
"query",
"(",
"\"self.api_version\"",
",",
"self",
".",
"api_version",
",",
"'str'",
")",
"# Construct headers",
"header_parameters",
"=",
"{",
"}",
"header_parameters",
"[",
"'Accept'",
"]",
"=",
"'application/json'",
"header_parameters",
"[",
"'Content-Type'",
"]",
"=",
"'application/json; charset=utf-8'",
"if",
"custom_headers",
":",
"header_parameters",
".",
"update",
"(",
"custom_headers",
")",
"# Construct body",
"body_content",
"=",
"self",
".",
"_serialize",
".",
"body",
"(",
"secret_value_resource_description",
",",
"'SecretValueResourceDescription'",
")",
"# Construct and send request",
"request",
"=",
"self",
".",
"_client",
".",
"put",
"(",
"url",
",",
"query_parameters",
",",
"header_parameters",
",",
"body_content",
")",
"response",
"=",
"self",
".",
"_client",
".",
"send",
"(",
"request",
",",
"stream",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
"if",
"response",
".",
"status_code",
"not",
"in",
"[",
"200",
",",
"201",
",",
"202",
"]",
":",
"raise",
"models",
".",
"FabricErrorException",
"(",
"self",
".",
"_deserialize",
",",
"response",
")",
"deserialized",
"=",
"None",
"if",
"response",
".",
"status_code",
"==",
"200",
":",
"deserialized",
"=",
"self",
".",
"_deserialize",
"(",
"'SecretValueResourceDescription'",
",",
"response",
")",
"if",
"response",
".",
"status_code",
"==",
"201",
":",
"deserialized",
"=",
"self",
".",
"_deserialize",
"(",
"'SecretValueResourceDescription'",
",",
"response",
")",
"if",
"raw",
":",
"client_raw_response",
"=",
"ClientRawResponse",
"(",
"deserialized",
",",
"response",
")",
"return",
"client_raw_response",
"return",
"deserialized"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.get_storage_account_properties
|
Returns system properties for the specified storage account.
service_name:
Name of the storage service account.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def get_storage_account_properties(self, service_name):
'''
Returns system properties for the specified storage account.
service_name:
Name of the storage service account.
'''
_validate_not_none('service_name', service_name)
return self._perform_get(self._get_storage_service_path(service_name),
StorageService)
|
def get_storage_account_properties(self, service_name):
'''
Returns system properties for the specified storage account.
service_name:
Name of the storage service account.
'''
_validate_not_none('service_name', service_name)
return self._perform_get(self._get_storage_service_path(service_name),
StorageService)
|
[
"Returns",
"system",
"properties",
"for",
"the",
"specified",
"storage",
"account",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L128-L137
|
[
"def",
"get_storage_account_properties",
"(",
"self",
",",
"service_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"return",
"self",
".",
"_perform_get",
"(",
"self",
".",
"_get_storage_service_path",
"(",
"service_name",
")",
",",
"StorageService",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.get_storage_account_keys
|
Returns the primary and secondary access keys for the specified
storage account.
service_name:
Name of the storage service account.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def get_storage_account_keys(self, service_name):
'''
Returns the primary and secondary access keys for the specified
storage account.
service_name:
Name of the storage service account.
'''
_validate_not_none('service_name', service_name)
return self._perform_get(
self._get_storage_service_path(service_name) + '/keys',
StorageService)
|
def get_storage_account_keys(self, service_name):
'''
Returns the primary and secondary access keys for the specified
storage account.
service_name:
Name of the storage service account.
'''
_validate_not_none('service_name', service_name)
return self._perform_get(
self._get_storage_service_path(service_name) + '/keys',
StorageService)
|
[
"Returns",
"the",
"primary",
"and",
"secondary",
"access",
"keys",
"for",
"the",
"specified",
"storage",
"account",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L139-L150
|
[
"def",
"get_storage_account_keys",
"(",
"self",
",",
"service_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"return",
"self",
".",
"_perform_get",
"(",
"self",
".",
"_get_storage_service_path",
"(",
"service_name",
")",
"+",
"'/keys'",
",",
"StorageService",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.regenerate_storage_account_keys
|
Regenerates the primary or secondary access key for the specified
storage account.
service_name:
Name of the storage service account.
key_type:
Specifies which key to regenerate. Valid values are:
Primary, Secondary
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def regenerate_storage_account_keys(self, service_name, key_type):
'''
Regenerates the primary or secondary access key for the specified
storage account.
service_name:
Name of the storage service account.
key_type:
Specifies which key to regenerate. Valid values are:
Primary, Secondary
'''
_validate_not_none('service_name', service_name)
_validate_not_none('key_type', key_type)
return self._perform_post(
self._get_storage_service_path(
service_name) + '/keys?action=regenerate',
_XmlSerializer.regenerate_keys_to_xml(
key_type),
StorageService)
|
def regenerate_storage_account_keys(self, service_name, key_type):
'''
Regenerates the primary or secondary access key for the specified
storage account.
service_name:
Name of the storage service account.
key_type:
Specifies which key to regenerate. Valid values are:
Primary, Secondary
'''
_validate_not_none('service_name', service_name)
_validate_not_none('key_type', key_type)
return self._perform_post(
self._get_storage_service_path(
service_name) + '/keys?action=regenerate',
_XmlSerializer.regenerate_keys_to_xml(
key_type),
StorageService)
|
[
"Regenerates",
"the",
"primary",
"or",
"secondary",
"access",
"key",
"for",
"the",
"specified",
"storage",
"account",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L152-L170
|
[
"def",
"regenerate_storage_account_keys",
"(",
"self",
",",
"service_name",
",",
"key_type",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'key_type'",
",",
"key_type",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_storage_service_path",
"(",
"service_name",
")",
"+",
"'/keys?action=regenerate'",
",",
"_XmlSerializer",
".",
"regenerate_keys_to_xml",
"(",
"key_type",
")",
",",
"StorageService",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.create_storage_account
|
Creates a new storage account in Windows Azure.
service_name:
A name for the storage account that is unique within Windows Azure.
Storage account names must be between 3 and 24 characters in length
and use numbers and lower-case letters only.
description:
A description for the storage account. The description may be up
to 1024 characters in length.
label:
A name for the storage account. The name may be up to 100
characters in length. The name can be used to identify the storage
account for your tracking purposes.
affinity_group:
The name of an existing affinity group in the specified
subscription. You can specify either a location or affinity_group,
but not both.
location:
The location where the storage account is created. You can specify
either a location or affinity_group, but not both.
geo_replication_enabled:
Deprecated. Replaced by the account_type parameter.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
account_type:
Specifies whether the account supports locally-redundant storage,
geo-redundant storage, zone-redundant storage, or read access
geo-redundant storage.
Possible values are:
Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def create_storage_account(self, service_name, description, label,
affinity_group=None, location=None,
geo_replication_enabled=None,
extended_properties=None,
account_type='Standard_GRS'):
'''
Creates a new storage account in Windows Azure.
service_name:
A name for the storage account that is unique within Windows Azure.
Storage account names must be between 3 and 24 characters in length
and use numbers and lower-case letters only.
description:
A description for the storage account. The description may be up
to 1024 characters in length.
label:
A name for the storage account. The name may be up to 100
characters in length. The name can be used to identify the storage
account for your tracking purposes.
affinity_group:
The name of an existing affinity group in the specified
subscription. You can specify either a location or affinity_group,
but not both.
location:
The location where the storage account is created. You can specify
either a location or affinity_group, but not both.
geo_replication_enabled:
Deprecated. Replaced by the account_type parameter.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
account_type:
Specifies whether the account supports locally-redundant storage,
geo-redundant storage, zone-redundant storage, or read access
geo-redundant storage.
Possible values are:
Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS
'''
_validate_not_none('service_name', service_name)
_validate_not_none('description', description)
_validate_not_none('label', label)
if affinity_group is None and location is None:
raise ValueError(
'location or affinity_group must be specified')
if affinity_group is not None and location is not None:
raise ValueError(
'Only one of location or affinity_group needs to be specified')
if geo_replication_enabled == False:
account_type = 'Standard_LRS'
return self._perform_post(
self._get_storage_service_path(),
_XmlSerializer.create_storage_service_input_to_xml(
service_name,
description,
label,
affinity_group,
location,
account_type,
extended_properties),
as_async=True)
|
def create_storage_account(self, service_name, description, label,
affinity_group=None, location=None,
geo_replication_enabled=None,
extended_properties=None,
account_type='Standard_GRS'):
'''
Creates a new storage account in Windows Azure.
service_name:
A name for the storage account that is unique within Windows Azure.
Storage account names must be between 3 and 24 characters in length
and use numbers and lower-case letters only.
description:
A description for the storage account. The description may be up
to 1024 characters in length.
label:
A name for the storage account. The name may be up to 100
characters in length. The name can be used to identify the storage
account for your tracking purposes.
affinity_group:
The name of an existing affinity group in the specified
subscription. You can specify either a location or affinity_group,
but not both.
location:
The location where the storage account is created. You can specify
either a location or affinity_group, but not both.
geo_replication_enabled:
Deprecated. Replaced by the account_type parameter.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
account_type:
Specifies whether the account supports locally-redundant storage,
geo-redundant storage, zone-redundant storage, or read access
geo-redundant storage.
Possible values are:
Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS
'''
_validate_not_none('service_name', service_name)
_validate_not_none('description', description)
_validate_not_none('label', label)
if affinity_group is None and location is None:
raise ValueError(
'location or affinity_group must be specified')
if affinity_group is not None and location is not None:
raise ValueError(
'Only one of location or affinity_group needs to be specified')
if geo_replication_enabled == False:
account_type = 'Standard_LRS'
return self._perform_post(
self._get_storage_service_path(),
_XmlSerializer.create_storage_service_input_to_xml(
service_name,
description,
label,
affinity_group,
location,
account_type,
extended_properties),
as_async=True)
|
[
"Creates",
"a",
"new",
"storage",
"account",
"in",
"Windows",
"Azure",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L172-L235
|
[
"def",
"create_storage_account",
"(",
"self",
",",
"service_name",
",",
"description",
",",
"label",
",",
"affinity_group",
"=",
"None",
",",
"location",
"=",
"None",
",",
"geo_replication_enabled",
"=",
"None",
",",
"extended_properties",
"=",
"None",
",",
"account_type",
"=",
"'Standard_GRS'",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'description'",
",",
"description",
")",
"_validate_not_none",
"(",
"'label'",
",",
"label",
")",
"if",
"affinity_group",
"is",
"None",
"and",
"location",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'location or affinity_group must be specified'",
")",
"if",
"affinity_group",
"is",
"not",
"None",
"and",
"location",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"'Only one of location or affinity_group needs to be specified'",
")",
"if",
"geo_replication_enabled",
"==",
"False",
":",
"account_type",
"=",
"'Standard_LRS'",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_storage_service_path",
"(",
")",
",",
"_XmlSerializer",
".",
"create_storage_service_input_to_xml",
"(",
"service_name",
",",
"description",
",",
"label",
",",
"affinity_group",
",",
"location",
",",
"account_type",
",",
"extended_properties",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.update_storage_account
|
Updates the label, the description, and enables or disables the
geo-replication status for a storage account in Windows Azure.
service_name:
Name of the storage service account.
description:
A description for the storage account. The description may be up
to 1024 characters in length.
label:
A name for the storage account. The name may be up to 100
characters in length. The name can be used to identify the storage
account for your tracking purposes.
geo_replication_enabled:
Deprecated. Replaced by the account_type parameter.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
account_type:
Specifies whether the account supports locally-redundant storage,
geo-redundant storage, zone-redundant storage, or read access
geo-redundant storage.
Possible values are:
Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def update_storage_account(self, service_name, description=None,
label=None, geo_replication_enabled=None,
extended_properties=None,
account_type='Standard_GRS'):
'''
Updates the label, the description, and enables or disables the
geo-replication status for a storage account in Windows Azure.
service_name:
Name of the storage service account.
description:
A description for the storage account. The description may be up
to 1024 characters in length.
label:
A name for the storage account. The name may be up to 100
characters in length. The name can be used to identify the storage
account for your tracking purposes.
geo_replication_enabled:
Deprecated. Replaced by the account_type parameter.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
account_type:
Specifies whether the account supports locally-redundant storage,
geo-redundant storage, zone-redundant storage, or read access
geo-redundant storage.
Possible values are:
Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS
'''
_validate_not_none('service_name', service_name)
if geo_replication_enabled == False:
account_type = 'Standard_LRS'
return self._perform_put(
self._get_storage_service_path(service_name),
_XmlSerializer.update_storage_service_input_to_xml(
description,
label,
account_type,
extended_properties))
|
def update_storage_account(self, service_name, description=None,
label=None, geo_replication_enabled=None,
extended_properties=None,
account_type='Standard_GRS'):
'''
Updates the label, the description, and enables or disables the
geo-replication status for a storage account in Windows Azure.
service_name:
Name of the storage service account.
description:
A description for the storage account. The description may be up
to 1024 characters in length.
label:
A name for the storage account. The name may be up to 100
characters in length. The name can be used to identify the storage
account for your tracking purposes.
geo_replication_enabled:
Deprecated. Replaced by the account_type parameter.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
account_type:
Specifies whether the account supports locally-redundant storage,
geo-redundant storage, zone-redundant storage, or read access
geo-redundant storage.
Possible values are:
Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS
'''
_validate_not_none('service_name', service_name)
if geo_replication_enabled == False:
account_type = 'Standard_LRS'
return self._perform_put(
self._get_storage_service_path(service_name),
_XmlSerializer.update_storage_service_input_to_xml(
description,
label,
account_type,
extended_properties))
|
[
"Updates",
"the",
"label",
"the",
"description",
"and",
"enables",
"or",
"disables",
"the",
"geo",
"-",
"replication",
"status",
"for",
"a",
"storage",
"account",
"in",
"Windows",
"Azure",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L237-L279
|
[
"def",
"update_storage_account",
"(",
"self",
",",
"service_name",
",",
"description",
"=",
"None",
",",
"label",
"=",
"None",
",",
"geo_replication_enabled",
"=",
"None",
",",
"extended_properties",
"=",
"None",
",",
"account_type",
"=",
"'Standard_GRS'",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"if",
"geo_replication_enabled",
"==",
"False",
":",
"account_type",
"=",
"'Standard_LRS'",
"return",
"self",
".",
"_perform_put",
"(",
"self",
".",
"_get_storage_service_path",
"(",
"service_name",
")",
",",
"_XmlSerializer",
".",
"update_storage_service_input_to_xml",
"(",
"description",
",",
"label",
",",
"account_type",
",",
"extended_properties",
")",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_storage_account
|
Deletes the specified storage account from Windows Azure.
service_name:
Name of the storage service account.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_storage_account(self, service_name):
'''
Deletes the specified storage account from Windows Azure.
service_name:
Name of the storage service account.
'''
_validate_not_none('service_name', service_name)
return self._perform_delete(
self._get_storage_service_path(service_name),
as_async=True)
|
def delete_storage_account(self, service_name):
'''
Deletes the specified storage account from Windows Azure.
service_name:
Name of the storage service account.
'''
_validate_not_none('service_name', service_name)
return self._perform_delete(
self._get_storage_service_path(service_name),
as_async=True)
|
[
"Deletes",
"the",
"specified",
"storage",
"account",
"from",
"Windows",
"Azure",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L281-L291
|
[
"def",
"delete_storage_account",
"(",
"self",
",",
"service_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"return",
"self",
".",
"_perform_delete",
"(",
"self",
".",
"_get_storage_service_path",
"(",
"service_name",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.check_storage_account_name_availability
|
Checks to see if the specified storage account name is available, or
if it has already been taken.
service_name:
Name of the storage service account.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def check_storage_account_name_availability(self, service_name):
'''
Checks to see if the specified storage account name is available, or
if it has already been taken.
service_name:
Name of the storage service account.
'''
_validate_not_none('service_name', service_name)
return self._perform_get(
self._get_storage_service_path() +
'/operations/isavailable/' +
_str(service_name) + '',
AvailabilityResponse)
|
def check_storage_account_name_availability(self, service_name):
'''
Checks to see if the specified storage account name is available, or
if it has already been taken.
service_name:
Name of the storage service account.
'''
_validate_not_none('service_name', service_name)
return self._perform_get(
self._get_storage_service_path() +
'/operations/isavailable/' +
_str(service_name) + '',
AvailabilityResponse)
|
[
"Checks",
"to",
"see",
"if",
"the",
"specified",
"storage",
"account",
"name",
"is",
"available",
"or",
"if",
"it",
"has",
"already",
"been",
"taken",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L293-L306
|
[
"def",
"check_storage_account_name_availability",
"(",
"self",
",",
"service_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"return",
"self",
".",
"_perform_get",
"(",
"self",
".",
"_get_storage_service_path",
"(",
")",
"+",
"'/operations/isavailable/'",
"+",
"_str",
"(",
"service_name",
")",
"+",
"''",
",",
"AvailabilityResponse",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.get_hosted_service_properties
|
Retrieves system properties for the specified hosted service. These
properties include the service name and service type; the name of the
affinity group to which the service belongs, or its location if it is
not part of an affinity group; and optionally, information on the
service's deployments.
service_name:
Name of the hosted service.
embed_detail:
When True, the management service returns properties for all
deployments of the service, as well as for the service itself.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def get_hosted_service_properties(self, service_name, embed_detail=False):
'''
Retrieves system properties for the specified hosted service. These
properties include the service name and service type; the name of the
affinity group to which the service belongs, or its location if it is
not part of an affinity group; and optionally, information on the
service's deployments.
service_name:
Name of the hosted service.
embed_detail:
When True, the management service returns properties for all
deployments of the service, as well as for the service itself.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('embed_detail', embed_detail)
return self._perform_get(
self._get_hosted_service_path(service_name) +
'?embed-detail=' +
_str(embed_detail).lower(),
HostedService)
|
def get_hosted_service_properties(self, service_name, embed_detail=False):
'''
Retrieves system properties for the specified hosted service. These
properties include the service name and service type; the name of the
affinity group to which the service belongs, or its location if it is
not part of an affinity group; and optionally, information on the
service's deployments.
service_name:
Name of the hosted service.
embed_detail:
When True, the management service returns properties for all
deployments of the service, as well as for the service itself.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('embed_detail', embed_detail)
return self._perform_get(
self._get_hosted_service_path(service_name) +
'?embed-detail=' +
_str(embed_detail).lower(),
HostedService)
|
[
"Retrieves",
"system",
"properties",
"for",
"the",
"specified",
"hosted",
"service",
".",
"These",
"properties",
"include",
"the",
"service",
"name",
"and",
"service",
"type",
";",
"the",
"name",
"of",
"the",
"affinity",
"group",
"to",
"which",
"the",
"service",
"belongs",
"or",
"its",
"location",
"if",
"it",
"is",
"not",
"part",
"of",
"an",
"affinity",
"group",
";",
"and",
"optionally",
"information",
"on",
"the",
"service",
"s",
"deployments",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L321-L341
|
[
"def",
"get_hosted_service_properties",
"(",
"self",
",",
"service_name",
",",
"embed_detail",
"=",
"False",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'embed_detail'",
",",
"embed_detail",
")",
"return",
"self",
".",
"_perform_get",
"(",
"self",
".",
"_get_hosted_service_path",
"(",
"service_name",
")",
"+",
"'?embed-detail='",
"+",
"_str",
"(",
"embed_detail",
")",
".",
"lower",
"(",
")",
",",
"HostedService",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.create_hosted_service
|
Creates a new hosted service in Windows Azure.
service_name:
A name for the hosted service that is unique within Windows Azure.
This name is the DNS prefix name and can be used to access the
hosted service.
label:
A name for the hosted service. The name can be up to 100 characters
in length. The name can be used to identify the storage account for
your tracking purposes.
description:
A description for the hosted service. The description can be up to
1024 characters in length.
location:
The location where the hosted service will be created. You can
specify either a location or affinity_group, but not both.
affinity_group:
The name of an existing affinity group associated with this
subscription. This name is a GUID and can be retrieved by examining
the name element of the response body returned by
list_affinity_groups. You can specify either a location or
affinity_group, but not both.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def create_hosted_service(self, service_name, label, description=None,
location=None, affinity_group=None,
extended_properties=None):
'''
Creates a new hosted service in Windows Azure.
service_name:
A name for the hosted service that is unique within Windows Azure.
This name is the DNS prefix name and can be used to access the
hosted service.
label:
A name for the hosted service. The name can be up to 100 characters
in length. The name can be used to identify the storage account for
your tracking purposes.
description:
A description for the hosted service. The description can be up to
1024 characters in length.
location:
The location where the hosted service will be created. You can
specify either a location or affinity_group, but not both.
affinity_group:
The name of an existing affinity group associated with this
subscription. This name is a GUID and can be retrieved by examining
the name element of the response body returned by
list_affinity_groups. You can specify either a location or
affinity_group, but not both.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('label', label)
if affinity_group is None and location is None:
raise ValueError(
'location or affinity_group must be specified')
if affinity_group is not None and location is not None:
raise ValueError(
'Only one of location or affinity_group needs to be specified')
return self._perform_post(self._get_hosted_service_path(),
_XmlSerializer.create_hosted_service_to_xml(
service_name,
label,
description,
location,
affinity_group,
extended_properties),
as_async=True)
|
def create_hosted_service(self, service_name, label, description=None,
location=None, affinity_group=None,
extended_properties=None):
'''
Creates a new hosted service in Windows Azure.
service_name:
A name for the hosted service that is unique within Windows Azure.
This name is the DNS prefix name and can be used to access the
hosted service.
label:
A name for the hosted service. The name can be up to 100 characters
in length. The name can be used to identify the storage account for
your tracking purposes.
description:
A description for the hosted service. The description can be up to
1024 characters in length.
location:
The location where the hosted service will be created. You can
specify either a location or affinity_group, but not both.
affinity_group:
The name of an existing affinity group associated with this
subscription. This name is a GUID and can be retrieved by examining
the name element of the response body returned by
list_affinity_groups. You can specify either a location or
affinity_group, but not both.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('label', label)
if affinity_group is None and location is None:
raise ValueError(
'location or affinity_group must be specified')
if affinity_group is not None and location is not None:
raise ValueError(
'Only one of location or affinity_group needs to be specified')
return self._perform_post(self._get_hosted_service_path(),
_XmlSerializer.create_hosted_service_to_xml(
service_name,
label,
description,
location,
affinity_group,
extended_properties),
as_async=True)
|
[
"Creates",
"a",
"new",
"hosted",
"service",
"in",
"Windows",
"Azure",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L343-L393
|
[
"def",
"create_hosted_service",
"(",
"self",
",",
"service_name",
",",
"label",
",",
"description",
"=",
"None",
",",
"location",
"=",
"None",
",",
"affinity_group",
"=",
"None",
",",
"extended_properties",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'label'",
",",
"label",
")",
"if",
"affinity_group",
"is",
"None",
"and",
"location",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'location or affinity_group must be specified'",
")",
"if",
"affinity_group",
"is",
"not",
"None",
"and",
"location",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"'Only one of location or affinity_group needs to be specified'",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_hosted_service_path",
"(",
")",
",",
"_XmlSerializer",
".",
"create_hosted_service_to_xml",
"(",
"service_name",
",",
"label",
",",
"description",
",",
"location",
",",
"affinity_group",
",",
"extended_properties",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.update_hosted_service
|
Updates the label and/or the description for a hosted service in
Windows Azure.
service_name:
Name of the hosted service.
label:
A name for the hosted service. The name may be up to 100 characters
in length. You must specify a value for either Label or
Description, or for both. It is recommended that the label be
unique within the subscription. The name can be used
identify the hosted service for your tracking purposes.
description:
A description for the hosted service. The description may be up to
1024 characters in length. You must specify a value for either
Label or Description, or for both.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def update_hosted_service(self, service_name, label=None, description=None,
extended_properties=None):
'''
Updates the label and/or the description for a hosted service in
Windows Azure.
service_name:
Name of the hosted service.
label:
A name for the hosted service. The name may be up to 100 characters
in length. You must specify a value for either Label or
Description, or for both. It is recommended that the label be
unique within the subscription. The name can be used
identify the hosted service for your tracking purposes.
description:
A description for the hosted service. The description may be up to
1024 characters in length. You must specify a value for either
Label or Description, or for both.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
'''
_validate_not_none('service_name', service_name)
return self._perform_put(self._get_hosted_service_path(service_name),
_XmlSerializer.update_hosted_service_to_xml(
label,
description,
extended_properties))
|
def update_hosted_service(self, service_name, label=None, description=None,
extended_properties=None):
'''
Updates the label and/or the description for a hosted service in
Windows Azure.
service_name:
Name of the hosted service.
label:
A name for the hosted service. The name may be up to 100 characters
in length. You must specify a value for either Label or
Description, or for both. It is recommended that the label be
unique within the subscription. The name can be used
identify the hosted service for your tracking purposes.
description:
A description for the hosted service. The description may be up to
1024 characters in length. You must specify a value for either
Label or Description, or for both.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
'''
_validate_not_none('service_name', service_name)
return self._perform_put(self._get_hosted_service_path(service_name),
_XmlSerializer.update_hosted_service_to_xml(
label,
description,
extended_properties))
|
[
"Updates",
"the",
"label",
"and",
"/",
"or",
"the",
"description",
"for",
"a",
"hosted",
"service",
"in",
"Windows",
"Azure",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L395-L426
|
[
"def",
"update_hosted_service",
"(",
"self",
",",
"service_name",
",",
"label",
"=",
"None",
",",
"description",
"=",
"None",
",",
"extended_properties",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"return",
"self",
".",
"_perform_put",
"(",
"self",
".",
"_get_hosted_service_path",
"(",
"service_name",
")",
",",
"_XmlSerializer",
".",
"update_hosted_service_to_xml",
"(",
"label",
",",
"description",
",",
"extended_properties",
")",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_hosted_service
|
Deletes the specified hosted service from Windows Azure.
service_name:
Name of the hosted service.
complete:
True if all OS/data disks and the source blobs for the disks should
also be deleted from storage.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_hosted_service(self, service_name, complete=False):
'''
Deletes the specified hosted service from Windows Azure.
service_name:
Name of the hosted service.
complete:
True if all OS/data disks and the source blobs for the disks should
also be deleted from storage.
'''
_validate_not_none('service_name', service_name)
path = self._get_hosted_service_path(service_name)
if complete == True:
path = path +'?comp=media'
return self._perform_delete(path, as_async=True)
|
def delete_hosted_service(self, service_name, complete=False):
'''
Deletes the specified hosted service from Windows Azure.
service_name:
Name of the hosted service.
complete:
True if all OS/data disks and the source blobs for the disks should
also be deleted from storage.
'''
_validate_not_none('service_name', service_name)
path = self._get_hosted_service_path(service_name)
if complete == True:
path = path +'?comp=media'
return self._perform_delete(path, as_async=True)
|
[
"Deletes",
"the",
"specified",
"hosted",
"service",
"from",
"Windows",
"Azure",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L428-L446
|
[
"def",
"delete_hosted_service",
"(",
"self",
",",
"service_name",
",",
"complete",
"=",
"False",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"path",
"=",
"self",
".",
"_get_hosted_service_path",
"(",
"service_name",
")",
"if",
"complete",
"==",
"True",
":",
"path",
"=",
"path",
"+",
"'?comp=media'",
"return",
"self",
".",
"_perform_delete",
"(",
"path",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.get_deployment_by_slot
|
Returns configuration information, status, and system properties for
a deployment.
service_name:
Name of the hosted service.
deployment_slot:
The environment to which the hosted service is deployed. Valid
values are: staging, production
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def get_deployment_by_slot(self, service_name, deployment_slot):
'''
Returns configuration information, status, and system properties for
a deployment.
service_name:
Name of the hosted service.
deployment_slot:
The environment to which the hosted service is deployed. Valid
values are: staging, production
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_slot', deployment_slot)
return self._perform_get(
self._get_deployment_path_using_slot(
service_name, deployment_slot),
Deployment)
|
def get_deployment_by_slot(self, service_name, deployment_slot):
'''
Returns configuration information, status, and system properties for
a deployment.
service_name:
Name of the hosted service.
deployment_slot:
The environment to which the hosted service is deployed. Valid
values are: staging, production
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_slot', deployment_slot)
return self._perform_get(
self._get_deployment_path_using_slot(
service_name, deployment_slot),
Deployment)
|
[
"Returns",
"configuration",
"information",
"status",
"and",
"system",
"properties",
"for",
"a",
"deployment",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L448-L464
|
[
"def",
"get_deployment_by_slot",
"(",
"self",
",",
"service_name",
",",
"deployment_slot",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_slot'",
",",
"deployment_slot",
")",
"return",
"self",
".",
"_perform_get",
"(",
"self",
".",
"_get_deployment_path_using_slot",
"(",
"service_name",
",",
"deployment_slot",
")",
",",
"Deployment",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.get_deployment_by_name
|
Returns configuration information, status, and system properties for a
deployment.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def get_deployment_by_name(self, service_name, deployment_name):
'''
Returns configuration information, status, and system properties for a
deployment.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
return self._perform_get(
self._get_deployment_path_using_name(
service_name, deployment_name),
Deployment)
|
def get_deployment_by_name(self, service_name, deployment_name):
'''
Returns configuration information, status, and system properties for a
deployment.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
return self._perform_get(
self._get_deployment_path_using_name(
service_name, deployment_name),
Deployment)
|
[
"Returns",
"configuration",
"information",
"status",
"and",
"system",
"properties",
"for",
"a",
"deployment",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L466-L481
|
[
"def",
"get_deployment_by_name",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"return",
"self",
".",
"_perform_get",
"(",
"self",
".",
"_get_deployment_path_using_name",
"(",
"service_name",
",",
"deployment_name",
")",
",",
"Deployment",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.create_deployment
|
Uploads a new service package and creates a new deployment on staging
or production.
service_name:
Name of the hosted service.
deployment_slot:
The environment to which the hosted service is deployed. Valid
values are: staging, production
name:
The name for the deployment. The deployment name must be unique
among other deployments for the hosted service.
package_url:
A URL that refers to the location of the service package in the
Blob service. The service package can be located either in a
storage account beneath the same subscription or a Shared Access
Signature (SAS) URI from any storage account.
label:
A name for the hosted service. The name can be up to 100 characters
in length. It is recommended that the label be unique within the
subscription. The name can be used to identify the hosted service
for your tracking purposes.
configuration:
The base-64 encoded service configuration file for the deployment.
start_deployment:
Indicates whether to start the deployment immediately after it is
created. If false, the service model is still deployed to the
virtual machines but the code is not run immediately. Instead, the
service is Suspended until you call Update Deployment Status and
set the status to Running, at which time the service will be
started. A deployed service still incurs charges, even if it is
suspended.
treat_warnings_as_error:
Indicates whether to treat package validation warnings as errors.
If set to true, the Created Deployment operation fails if there
are validation warnings on the service package.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def create_deployment(self, service_name, deployment_slot, name,
package_url, label, configuration,
start_deployment=False,
treat_warnings_as_error=False,
extended_properties=None):
'''
Uploads a new service package and creates a new deployment on staging
or production.
service_name:
Name of the hosted service.
deployment_slot:
The environment to which the hosted service is deployed. Valid
values are: staging, production
name:
The name for the deployment. The deployment name must be unique
among other deployments for the hosted service.
package_url:
A URL that refers to the location of the service package in the
Blob service. The service package can be located either in a
storage account beneath the same subscription or a Shared Access
Signature (SAS) URI from any storage account.
label:
A name for the hosted service. The name can be up to 100 characters
in length. It is recommended that the label be unique within the
subscription. The name can be used to identify the hosted service
for your tracking purposes.
configuration:
The base-64 encoded service configuration file for the deployment.
start_deployment:
Indicates whether to start the deployment immediately after it is
created. If false, the service model is still deployed to the
virtual machines but the code is not run immediately. Instead, the
service is Suspended until you call Update Deployment Status and
set the status to Running, at which time the service will be
started. A deployed service still incurs charges, even if it is
suspended.
treat_warnings_as_error:
Indicates whether to treat package validation warnings as errors.
If set to true, the Created Deployment operation fails if there
are validation warnings on the service package.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_slot', deployment_slot)
_validate_not_none('name', name)
_validate_not_none('package_url', package_url)
_validate_not_none('label', label)
_validate_not_none('configuration', configuration)
return self._perform_post(
self._get_deployment_path_using_slot(
service_name, deployment_slot),
_XmlSerializer.create_deployment_to_xml(
name,
package_url,
label,
configuration,
start_deployment,
treat_warnings_as_error,
extended_properties),
as_async=True)
|
def create_deployment(self, service_name, deployment_slot, name,
package_url, label, configuration,
start_deployment=False,
treat_warnings_as_error=False,
extended_properties=None):
'''
Uploads a new service package and creates a new deployment on staging
or production.
service_name:
Name of the hosted service.
deployment_slot:
The environment to which the hosted service is deployed. Valid
values are: staging, production
name:
The name for the deployment. The deployment name must be unique
among other deployments for the hosted service.
package_url:
A URL that refers to the location of the service package in the
Blob service. The service package can be located either in a
storage account beneath the same subscription or a Shared Access
Signature (SAS) URI from any storage account.
label:
A name for the hosted service. The name can be up to 100 characters
in length. It is recommended that the label be unique within the
subscription. The name can be used to identify the hosted service
for your tracking purposes.
configuration:
The base-64 encoded service configuration file for the deployment.
start_deployment:
Indicates whether to start the deployment immediately after it is
created. If false, the service model is still deployed to the
virtual machines but the code is not run immediately. Instead, the
service is Suspended until you call Update Deployment Status and
set the status to Running, at which time the service will be
started. A deployed service still incurs charges, even if it is
suspended.
treat_warnings_as_error:
Indicates whether to treat package validation warnings as errors.
If set to true, the Created Deployment operation fails if there
are validation warnings on the service package.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_slot', deployment_slot)
_validate_not_none('name', name)
_validate_not_none('package_url', package_url)
_validate_not_none('label', label)
_validate_not_none('configuration', configuration)
return self._perform_post(
self._get_deployment_path_using_slot(
service_name, deployment_slot),
_XmlSerializer.create_deployment_to_xml(
name,
package_url,
label,
configuration,
start_deployment,
treat_warnings_as_error,
extended_properties),
as_async=True)
|
[
"Uploads",
"a",
"new",
"service",
"package",
"and",
"creates",
"a",
"new",
"deployment",
"on",
"staging",
"or",
"production",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L483-L549
|
[
"def",
"create_deployment",
"(",
"self",
",",
"service_name",
",",
"deployment_slot",
",",
"name",
",",
"package_url",
",",
"label",
",",
"configuration",
",",
"start_deployment",
"=",
"False",
",",
"treat_warnings_as_error",
"=",
"False",
",",
"extended_properties",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_slot'",
",",
"deployment_slot",
")",
"_validate_not_none",
"(",
"'name'",
",",
"name",
")",
"_validate_not_none",
"(",
"'package_url'",
",",
"package_url",
")",
"_validate_not_none",
"(",
"'label'",
",",
"label",
")",
"_validate_not_none",
"(",
"'configuration'",
",",
"configuration",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_deployment_path_using_slot",
"(",
"service_name",
",",
"deployment_slot",
")",
",",
"_XmlSerializer",
".",
"create_deployment_to_xml",
"(",
"name",
",",
"package_url",
",",
"label",
",",
"configuration",
",",
"start_deployment",
",",
"treat_warnings_as_error",
",",
"extended_properties",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_deployment
|
Deletes the specified deployment.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_deployment(self, service_name, deployment_name,delete_vhd=False):
'''
Deletes the specified deployment.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
path= self._get_deployment_path_using_name(service_name, deployment_name)
if delete_vhd:
path += '?comp=media'
return self._perform_delete(
path,
as_async=True)
|
def delete_deployment(self, service_name, deployment_name,delete_vhd=False):
'''
Deletes the specified deployment.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
path= self._get_deployment_path_using_name(service_name, deployment_name)
if delete_vhd:
path += '?comp=media'
return self._perform_delete(
path,
as_async=True)
|
[
"Deletes",
"the",
"specified",
"deployment",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L551-L567
|
[
"def",
"delete_deployment",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"delete_vhd",
"=",
"False",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"path",
"=",
"self",
".",
"_get_deployment_path_using_name",
"(",
"service_name",
",",
"deployment_name",
")",
"if",
"delete_vhd",
":",
"path",
"+=",
"'?comp=media'",
"return",
"self",
".",
"_perform_delete",
"(",
"path",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.swap_deployment
|
Initiates a virtual IP swap between the staging and production
deployment environments for a service. If the service is currently
running in the staging environment, it will be swapped to the
production environment. If it is running in the production
environment, it will be swapped to staging.
service_name:
Name of the hosted service.
production:
The name of the production deployment.
source_deployment:
The name of the source deployment.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def swap_deployment(self, service_name, production, source_deployment):
'''
Initiates a virtual IP swap between the staging and production
deployment environments for a service. If the service is currently
running in the staging environment, it will be swapped to the
production environment. If it is running in the production
environment, it will be swapped to staging.
service_name:
Name of the hosted service.
production:
The name of the production deployment.
source_deployment:
The name of the source deployment.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('production', production)
_validate_not_none('source_deployment', source_deployment)
return self._perform_post(self._get_hosted_service_path(service_name),
_XmlSerializer.swap_deployment_to_xml(
production, source_deployment),
as_async=True)
|
def swap_deployment(self, service_name, production, source_deployment):
'''
Initiates a virtual IP swap between the staging and production
deployment environments for a service. If the service is currently
running in the staging environment, it will be swapped to the
production environment. If it is running in the production
environment, it will be swapped to staging.
service_name:
Name of the hosted service.
production:
The name of the production deployment.
source_deployment:
The name of the source deployment.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('production', production)
_validate_not_none('source_deployment', source_deployment)
return self._perform_post(self._get_hosted_service_path(service_name),
_XmlSerializer.swap_deployment_to_xml(
production, source_deployment),
as_async=True)
|
[
"Initiates",
"a",
"virtual",
"IP",
"swap",
"between",
"the",
"staging",
"and",
"production",
"deployment",
"environments",
"for",
"a",
"service",
".",
"If",
"the",
"service",
"is",
"currently",
"running",
"in",
"the",
"staging",
"environment",
"it",
"will",
"be",
"swapped",
"to",
"the",
"production",
"environment",
".",
"If",
"it",
"is",
"running",
"in",
"the",
"production",
"environment",
"it",
"will",
"be",
"swapped",
"to",
"staging",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L569-L590
|
[
"def",
"swap_deployment",
"(",
"self",
",",
"service_name",
",",
"production",
",",
"source_deployment",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'production'",
",",
"production",
")",
"_validate_not_none",
"(",
"'source_deployment'",
",",
"source_deployment",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_hosted_service_path",
"(",
"service_name",
")",
",",
"_XmlSerializer",
".",
"swap_deployment_to_xml",
"(",
"production",
",",
"source_deployment",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.change_deployment_configuration
|
Initiates a change to the deployment configuration.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
configuration:
The base-64 encoded service configuration file for the deployment.
treat_warnings_as_error:
Indicates whether to treat package validation warnings as errors.
If set to true, the Created Deployment operation fails if there
are validation warnings on the service package.
mode:
If set to Manual, WalkUpgradeDomain must be called to apply the
update. If set to Auto, the Windows Azure platform will
automatically apply the update To each upgrade domain for the
service. Possible values are: Auto, Manual
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def change_deployment_configuration(self, service_name, deployment_name,
configuration,
treat_warnings_as_error=False,
mode='Auto', extended_properties=None):
'''
Initiates a change to the deployment configuration.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
configuration:
The base-64 encoded service configuration file for the deployment.
treat_warnings_as_error:
Indicates whether to treat package validation warnings as errors.
If set to true, the Created Deployment operation fails if there
are validation warnings on the service package.
mode:
If set to Manual, WalkUpgradeDomain must be called to apply the
update. If set to Auto, the Windows Azure platform will
automatically apply the update To each upgrade domain for the
service. Possible values are: Auto, Manual
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('configuration', configuration)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/?comp=config',
_XmlSerializer.change_deployment_to_xml(
configuration,
treat_warnings_as_error,
mode,
extended_properties),
as_async=True)
|
def change_deployment_configuration(self, service_name, deployment_name,
configuration,
treat_warnings_as_error=False,
mode='Auto', extended_properties=None):
'''
Initiates a change to the deployment configuration.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
configuration:
The base-64 encoded service configuration file for the deployment.
treat_warnings_as_error:
Indicates whether to treat package validation warnings as errors.
If set to true, the Created Deployment operation fails if there
are validation warnings on the service package.
mode:
If set to Manual, WalkUpgradeDomain must be called to apply the
update. If set to Auto, the Windows Azure platform will
automatically apply the update To each upgrade domain for the
service. Possible values are: Auto, Manual
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('configuration', configuration)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/?comp=config',
_XmlSerializer.change_deployment_to_xml(
configuration,
treat_warnings_as_error,
mode,
extended_properties),
as_async=True)
|
[
"Initiates",
"a",
"change",
"to",
"the",
"deployment",
"configuration",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L592-L633
|
[
"def",
"change_deployment_configuration",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"configuration",
",",
"treat_warnings_as_error",
"=",
"False",
",",
"mode",
"=",
"'Auto'",
",",
"extended_properties",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'configuration'",
",",
"configuration",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_deployment_path_using_name",
"(",
"service_name",
",",
"deployment_name",
")",
"+",
"'/?comp=config'",
",",
"_XmlSerializer",
".",
"change_deployment_to_xml",
"(",
"configuration",
",",
"treat_warnings_as_error",
",",
"mode",
",",
"extended_properties",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.update_deployment_status
|
Initiates a change in deployment status.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
status:
The change to initiate to the deployment status. Possible values
include:
Running, Suspended
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def update_deployment_status(self, service_name, deployment_name, status):
'''
Initiates a change in deployment status.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
status:
The change to initiate to the deployment status. Possible values
include:
Running, Suspended
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('status', status)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/?comp=status',
_XmlSerializer.update_deployment_status_to_xml(
status),
as_async=True)
|
def update_deployment_status(self, service_name, deployment_name, status):
'''
Initiates a change in deployment status.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
status:
The change to initiate to the deployment status. Possible values
include:
Running, Suspended
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('status', status)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/?comp=status',
_XmlSerializer.update_deployment_status_to_xml(
status),
as_async=True)
|
[
"Initiates",
"a",
"change",
"in",
"deployment",
"status",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L635-L656
|
[
"def",
"update_deployment_status",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"status",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'status'",
",",
"status",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_deployment_path_using_name",
"(",
"service_name",
",",
"deployment_name",
")",
"+",
"'/?comp=status'",
",",
"_XmlSerializer",
".",
"update_deployment_status_to_xml",
"(",
"status",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.upgrade_deployment
|
Initiates an upgrade.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
mode:
If set to Manual, WalkUpgradeDomain must be called to apply the
update. If set to Auto, the Windows Azure platform will
automatically apply the update To each upgrade domain for the
service. Possible values are: Auto, Manual
package_url:
A URL that refers to the location of the service package in the
Blob service. The service package can be located either in a
storage account beneath the same subscription or a Shared Access
Signature (SAS) URI from any storage account.
configuration:
The base-64 encoded service configuration file for the deployment.
label:
A name for the hosted service. The name can be up to 100 characters
in length. It is recommended that the label be unique within the
subscription. The name can be used to identify the hosted service
for your tracking purposes.
force:
Specifies whether the rollback should proceed even when it will
cause local data to be lost from some role instances. True if the
rollback should proceed; otherwise false if the rollback should
fail.
role_to_upgrade:
The name of the specific role to upgrade.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def upgrade_deployment(self, service_name, deployment_name, mode,
package_url, configuration, label, force,
role_to_upgrade=None, extended_properties=None):
'''
Initiates an upgrade.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
mode:
If set to Manual, WalkUpgradeDomain must be called to apply the
update. If set to Auto, the Windows Azure platform will
automatically apply the update To each upgrade domain for the
service. Possible values are: Auto, Manual
package_url:
A URL that refers to the location of the service package in the
Blob service. The service package can be located either in a
storage account beneath the same subscription or a Shared Access
Signature (SAS) URI from any storage account.
configuration:
The base-64 encoded service configuration file for the deployment.
label:
A name for the hosted service. The name can be up to 100 characters
in length. It is recommended that the label be unique within the
subscription. The name can be used to identify the hosted service
for your tracking purposes.
force:
Specifies whether the rollback should proceed even when it will
cause local data to be lost from some role instances. True if the
rollback should proceed; otherwise false if the rollback should
fail.
role_to_upgrade:
The name of the specific role to upgrade.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('mode', mode)
_validate_not_none('package_url', package_url)
_validate_not_none('configuration', configuration)
_validate_not_none('label', label)
_validate_not_none('force', force)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/?comp=upgrade',
_XmlSerializer.upgrade_deployment_to_xml(
mode,
package_url,
configuration,
label,
role_to_upgrade,
force,
extended_properties),
as_async=True)
|
def upgrade_deployment(self, service_name, deployment_name, mode,
package_url, configuration, label, force,
role_to_upgrade=None, extended_properties=None):
'''
Initiates an upgrade.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
mode:
If set to Manual, WalkUpgradeDomain must be called to apply the
update. If set to Auto, the Windows Azure platform will
automatically apply the update To each upgrade domain for the
service. Possible values are: Auto, Manual
package_url:
A URL that refers to the location of the service package in the
Blob service. The service package can be located either in a
storage account beneath the same subscription or a Shared Access
Signature (SAS) URI from any storage account.
configuration:
The base-64 encoded service configuration file for the deployment.
label:
A name for the hosted service. The name can be up to 100 characters
in length. It is recommended that the label be unique within the
subscription. The name can be used to identify the hosted service
for your tracking purposes.
force:
Specifies whether the rollback should proceed even when it will
cause local data to be lost from some role instances. True if the
rollback should proceed; otherwise false if the rollback should
fail.
role_to_upgrade:
The name of the specific role to upgrade.
extended_properties:
Dictionary containing name/value pairs of storage account
properties. You can have a maximum of 50 extended property
name/value pairs. The maximum length of the Name element is 64
characters, only alphanumeric characters and underscores are valid
in the Name, and the name must start with a letter. The value has
a maximum length of 255 characters.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('mode', mode)
_validate_not_none('package_url', package_url)
_validate_not_none('configuration', configuration)
_validate_not_none('label', label)
_validate_not_none('force', force)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/?comp=upgrade',
_XmlSerializer.upgrade_deployment_to_xml(
mode,
package_url,
configuration,
label,
role_to_upgrade,
force,
extended_properties),
as_async=True)
|
[
"Initiates",
"an",
"upgrade",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L658-L718
|
[
"def",
"upgrade_deployment",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"mode",
",",
"package_url",
",",
"configuration",
",",
"label",
",",
"force",
",",
"role_to_upgrade",
"=",
"None",
",",
"extended_properties",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'mode'",
",",
"mode",
")",
"_validate_not_none",
"(",
"'package_url'",
",",
"package_url",
")",
"_validate_not_none",
"(",
"'configuration'",
",",
"configuration",
")",
"_validate_not_none",
"(",
"'label'",
",",
"label",
")",
"_validate_not_none",
"(",
"'force'",
",",
"force",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_deployment_path_using_name",
"(",
"service_name",
",",
"deployment_name",
")",
"+",
"'/?comp=upgrade'",
",",
"_XmlSerializer",
".",
"upgrade_deployment_to_xml",
"(",
"mode",
",",
"package_url",
",",
"configuration",
",",
"label",
",",
"role_to_upgrade",
",",
"force",
",",
"extended_properties",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.walk_upgrade_domain
|
Specifies the next upgrade domain to be walked during manual in-place
upgrade or configuration change.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
upgrade_domain:
An integer value that identifies the upgrade domain to walk.
Upgrade domains are identified with a zero-based index: the first
upgrade domain has an ID of 0, the second has an ID of 1, and so on.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def walk_upgrade_domain(self, service_name, deployment_name,
upgrade_domain):
'''
Specifies the next upgrade domain to be walked during manual in-place
upgrade or configuration change.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
upgrade_domain:
An integer value that identifies the upgrade domain to walk.
Upgrade domains are identified with a zero-based index: the first
upgrade domain has an ID of 0, the second has an ID of 1, and so on.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('upgrade_domain', upgrade_domain)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/?comp=walkupgradedomain',
_XmlSerializer.walk_upgrade_domain_to_xml(
upgrade_domain),
as_async=True)
|
def walk_upgrade_domain(self, service_name, deployment_name,
upgrade_domain):
'''
Specifies the next upgrade domain to be walked during manual in-place
upgrade or configuration change.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
upgrade_domain:
An integer value that identifies the upgrade domain to walk.
Upgrade domains are identified with a zero-based index: the first
upgrade domain has an ID of 0, the second has an ID of 1, and so on.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('upgrade_domain', upgrade_domain)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/?comp=walkupgradedomain',
_XmlSerializer.walk_upgrade_domain_to_xml(
upgrade_domain),
as_async=True)
|
[
"Specifies",
"the",
"next",
"upgrade",
"domain",
"to",
"be",
"walked",
"during",
"manual",
"in",
"-",
"place",
"upgrade",
"or",
"configuration",
"change",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L720-L743
|
[
"def",
"walk_upgrade_domain",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"upgrade_domain",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'upgrade_domain'",
",",
"upgrade_domain",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_deployment_path_using_name",
"(",
"service_name",
",",
"deployment_name",
")",
"+",
"'/?comp=walkupgradedomain'",
",",
"_XmlSerializer",
".",
"walk_upgrade_domain_to_xml",
"(",
"upgrade_domain",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.rollback_update_or_upgrade
|
Cancels an in progress configuration change (update) or upgrade and
returns the deployment to its state before the upgrade or
configuration change was started.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
mode:
Specifies whether the rollback should proceed automatically.
auto - The rollback proceeds without further user input.
manual - You must call the Walk Upgrade Domain operation to
apply the rollback to each upgrade domain.
force:
Specifies whether the rollback should proceed even when it will
cause local data to be lost from some role instances. True if the
rollback should proceed; otherwise false if the rollback should
fail.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def rollback_update_or_upgrade(self, service_name, deployment_name, mode,
force):
'''
Cancels an in progress configuration change (update) or upgrade and
returns the deployment to its state before the upgrade or
configuration change was started.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
mode:
Specifies whether the rollback should proceed automatically.
auto - The rollback proceeds without further user input.
manual - You must call the Walk Upgrade Domain operation to
apply the rollback to each upgrade domain.
force:
Specifies whether the rollback should proceed even when it will
cause local data to be lost from some role instances. True if the
rollback should proceed; otherwise false if the rollback should
fail.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('mode', mode)
_validate_not_none('force', force)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/?comp=rollback',
_XmlSerializer.rollback_upgrade_to_xml(
mode, force),
as_async=True)
|
def rollback_update_or_upgrade(self, service_name, deployment_name, mode,
force):
'''
Cancels an in progress configuration change (update) or upgrade and
returns the deployment to its state before the upgrade or
configuration change was started.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
mode:
Specifies whether the rollback should proceed automatically.
auto - The rollback proceeds without further user input.
manual - You must call the Walk Upgrade Domain operation to
apply the rollback to each upgrade domain.
force:
Specifies whether the rollback should proceed even when it will
cause local data to be lost from some role instances. True if the
rollback should proceed; otherwise false if the rollback should
fail.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('mode', mode)
_validate_not_none('force', force)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/?comp=rollback',
_XmlSerializer.rollback_upgrade_to_xml(
mode, force),
as_async=True)
|
[
"Cancels",
"an",
"in",
"progress",
"configuration",
"change",
"(",
"update",
")",
"or",
"upgrade",
"and",
"returns",
"the",
"deployment",
"to",
"its",
"state",
"before",
"the",
"upgrade",
"or",
"configuration",
"change",
"was",
"started",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L745-L776
|
[
"def",
"rollback_update_or_upgrade",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"mode",
",",
"force",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'mode'",
",",
"mode",
")",
"_validate_not_none",
"(",
"'force'",
",",
"force",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_deployment_path_using_name",
"(",
"service_name",
",",
"deployment_name",
")",
"+",
"'/?comp=rollback'",
",",
"_XmlSerializer",
".",
"rollback_upgrade_to_xml",
"(",
"mode",
",",
"force",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.reboot_role_instance
|
Requests a reboot of a role instance that is running in a deployment.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
role_instance_name:
The name of the role instance.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def reboot_role_instance(self, service_name, deployment_name,
role_instance_name):
'''
Requests a reboot of a role instance that is running in a deployment.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
role_instance_name:
The name of the role instance.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_instance_name', role_instance_name)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + \
'/roleinstances/' + _str(role_instance_name) + \
'?comp=reboot',
'',
as_async=True)
|
def reboot_role_instance(self, service_name, deployment_name,
role_instance_name):
'''
Requests a reboot of a role instance that is running in a deployment.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
role_instance_name:
The name of the role instance.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_instance_name', role_instance_name)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + \
'/roleinstances/' + _str(role_instance_name) + \
'?comp=reboot',
'',
as_async=True)
|
[
"Requests",
"a",
"reboot",
"of",
"a",
"role",
"instance",
"that",
"is",
"running",
"in",
"a",
"deployment",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L778-L799
|
[
"def",
"reboot_role_instance",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_instance_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_instance_name'",
",",
"role_instance_name",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_deployment_path_using_name",
"(",
"service_name",
",",
"deployment_name",
")",
"+",
"'/roleinstances/'",
"+",
"_str",
"(",
"role_instance_name",
")",
"+",
"'?comp=reboot'",
",",
"''",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_role_instances
|
Reinstalls the operating system on instances of web roles or worker
roles and initializes the storage resources that are used by them. If
you do not want to initialize storage resources, you can use
reimage_role_instance.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
role_instance_names:
List of role instance names.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_role_instances(self, service_name, deployment_name,
role_instance_names):
'''
Reinstalls the operating system on instances of web roles or worker
roles and initializes the storage resources that are used by them. If
you do not want to initialize storage resources, you can use
reimage_role_instance.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
role_instance_names:
List of role instance names.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_instance_names', role_instance_names)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/roleinstances/?comp=delete',
_XmlSerializer.role_instances_to_xml(role_instance_names),
as_async=True)
|
def delete_role_instances(self, service_name, deployment_name,
role_instance_names):
'''
Reinstalls the operating system on instances of web roles or worker
roles and initializes the storage resources that are used by them. If
you do not want to initialize storage resources, you can use
reimage_role_instance.
service_name:
Name of the hosted service.
deployment_name:
The name of the deployment.
role_instance_names:
List of role instance names.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_instance_names', role_instance_names)
return self._perform_post(
self._get_deployment_path_using_name(
service_name, deployment_name) + '/roleinstances/?comp=delete',
_XmlSerializer.role_instances_to_xml(role_instance_names),
as_async=True)
|
[
"Reinstalls",
"the",
"operating",
"system",
"on",
"instances",
"of",
"web",
"roles",
"or",
"worker",
"roles",
"and",
"initializes",
"the",
"storage",
"resources",
"that",
"are",
"used",
"by",
"them",
".",
"If",
"you",
"do",
"not",
"want",
"to",
"initialize",
"storage",
"resources",
"you",
"can",
"use",
"reimage_role_instance",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L850-L872
|
[
"def",
"delete_role_instances",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_instance_names",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_instance_names'",
",",
"role_instance_names",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_deployment_path_using_name",
"(",
"service_name",
",",
"deployment_name",
")",
"+",
"'/roleinstances/?comp=delete'",
",",
"_XmlSerializer",
".",
"role_instances_to_xml",
"(",
"role_instance_names",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.check_hosted_service_name_availability
|
Checks to see if the specified hosted service name is available, or if
it has already been taken.
service_name:
Name of the hosted service.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def check_hosted_service_name_availability(self, service_name):
'''
Checks to see if the specified hosted service name is available, or if
it has already been taken.
service_name:
Name of the hosted service.
'''
_validate_not_none('service_name', service_name)
return self._perform_get(
'/' + self.subscription_id +
'/services/hostedservices/operations/isavailable/' +
_str(service_name) + '',
AvailabilityResponse)
|
def check_hosted_service_name_availability(self, service_name):
'''
Checks to see if the specified hosted service name is available, or if
it has already been taken.
service_name:
Name of the hosted service.
'''
_validate_not_none('service_name', service_name)
return self._perform_get(
'/' + self.subscription_id +
'/services/hostedservices/operations/isavailable/' +
_str(service_name) + '',
AvailabilityResponse)
|
[
"Checks",
"to",
"see",
"if",
"the",
"specified",
"hosted",
"service",
"name",
"is",
"available",
"or",
"if",
"it",
"has",
"already",
"been",
"taken",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L874-L887
|
[
"def",
"check_hosted_service_name_availability",
"(",
"self",
",",
"service_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"return",
"self",
".",
"_perform_get",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/services/hostedservices/operations/isavailable/'",
"+",
"_str",
"(",
"service_name",
")",
"+",
"''",
",",
"AvailabilityResponse",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.list_service_certificates
|
Lists all of the service certificates associated with the specified
hosted service.
service_name:
Name of the hosted service.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def list_service_certificates(self, service_name):
'''
Lists all of the service certificates associated with the specified
hosted service.
service_name:
Name of the hosted service.
'''
_validate_not_none('service_name', service_name)
return self._perform_get(
'/' + self.subscription_id + '/services/hostedservices/' +
_str(service_name) + '/certificates',
Certificates)
|
def list_service_certificates(self, service_name):
'''
Lists all of the service certificates associated with the specified
hosted service.
service_name:
Name of the hosted service.
'''
_validate_not_none('service_name', service_name)
return self._perform_get(
'/' + self.subscription_id + '/services/hostedservices/' +
_str(service_name) + '/certificates',
Certificates)
|
[
"Lists",
"all",
"of",
"the",
"service",
"certificates",
"associated",
"with",
"the",
"specified",
"hosted",
"service",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L890-L902
|
[
"def",
"list_service_certificates",
"(",
"self",
",",
"service_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"return",
"self",
".",
"_perform_get",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/services/hostedservices/'",
"+",
"_str",
"(",
"service_name",
")",
"+",
"'/certificates'",
",",
"Certificates",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.get_service_certificate
|
Returns the public data for the specified X.509 certificate associated
with a hosted service.
service_name:
Name of the hosted service.
thumbalgorithm:
The algorithm for the certificate's thumbprint.
thumbprint:
The hexadecimal representation of the thumbprint.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def get_service_certificate(self, service_name, thumbalgorithm, thumbprint):
'''
Returns the public data for the specified X.509 certificate associated
with a hosted service.
service_name:
Name of the hosted service.
thumbalgorithm:
The algorithm for the certificate's thumbprint.
thumbprint:
The hexadecimal representation of the thumbprint.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('thumbalgorithm', thumbalgorithm)
_validate_not_none('thumbprint', thumbprint)
return self._perform_get(
'/' + self.subscription_id + '/services/hostedservices/' +
_str(service_name) + '/certificates/' +
_str(thumbalgorithm) + '-' + _str(thumbprint) + '',
Certificate)
|
def get_service_certificate(self, service_name, thumbalgorithm, thumbprint):
'''
Returns the public data for the specified X.509 certificate associated
with a hosted service.
service_name:
Name of the hosted service.
thumbalgorithm:
The algorithm for the certificate's thumbprint.
thumbprint:
The hexadecimal representation of the thumbprint.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('thumbalgorithm', thumbalgorithm)
_validate_not_none('thumbprint', thumbprint)
return self._perform_get(
'/' + self.subscription_id + '/services/hostedservices/' +
_str(service_name) + '/certificates/' +
_str(thumbalgorithm) + '-' + _str(thumbprint) + '',
Certificate)
|
[
"Returns",
"the",
"public",
"data",
"for",
"the",
"specified",
"X",
".",
"509",
"certificate",
"associated",
"with",
"a",
"hosted",
"service",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L904-L923
|
[
"def",
"get_service_certificate",
"(",
"self",
",",
"service_name",
",",
"thumbalgorithm",
",",
"thumbprint",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'thumbalgorithm'",
",",
"thumbalgorithm",
")",
"_validate_not_none",
"(",
"'thumbprint'",
",",
"thumbprint",
")",
"return",
"self",
".",
"_perform_get",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/services/hostedservices/'",
"+",
"_str",
"(",
"service_name",
")",
"+",
"'/certificates/'",
"+",
"_str",
"(",
"thumbalgorithm",
")",
"+",
"'-'",
"+",
"_str",
"(",
"thumbprint",
")",
"+",
"''",
",",
"Certificate",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.add_service_certificate
|
Adds a certificate to a hosted service.
service_name:
Name of the hosted service.
data:
The base-64 encoded form of the pfx/cer file.
certificate_format:
The service certificate format.
password:
The certificate password. Default to None when using cer format.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def add_service_certificate(self, service_name, data, certificate_format,
password=None):
'''
Adds a certificate to a hosted service.
service_name:
Name of the hosted service.
data:
The base-64 encoded form of the pfx/cer file.
certificate_format:
The service certificate format.
password:
The certificate password. Default to None when using cer format.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('data', data)
_validate_not_none('certificate_format', certificate_format)
_validate_not_none('password', password)
return self._perform_post(
'/' + self.subscription_id + '/services/hostedservices/' +
_str(service_name) + '/certificates',
_XmlSerializer.certificate_file_to_xml(
data, certificate_format, password),
as_async=True)
|
def add_service_certificate(self, service_name, data, certificate_format,
password=None):
'''
Adds a certificate to a hosted service.
service_name:
Name of the hosted service.
data:
The base-64 encoded form of the pfx/cer file.
certificate_format:
The service certificate format.
password:
The certificate password. Default to None when using cer format.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('data', data)
_validate_not_none('certificate_format', certificate_format)
_validate_not_none('password', password)
return self._perform_post(
'/' + self.subscription_id + '/services/hostedservices/' +
_str(service_name) + '/certificates',
_XmlSerializer.certificate_file_to_xml(
data, certificate_format, password),
as_async=True)
|
[
"Adds",
"a",
"certificate",
"to",
"a",
"hosted",
"service",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L925-L949
|
[
"def",
"add_service_certificate",
"(",
"self",
",",
"service_name",
",",
"data",
",",
"certificate_format",
",",
"password",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'data'",
",",
"data",
")",
"_validate_not_none",
"(",
"'certificate_format'",
",",
"certificate_format",
")",
"_validate_not_none",
"(",
"'password'",
",",
"password",
")",
"return",
"self",
".",
"_perform_post",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/services/hostedservices/'",
"+",
"_str",
"(",
"service_name",
")",
"+",
"'/certificates'",
",",
"_XmlSerializer",
".",
"certificate_file_to_xml",
"(",
"data",
",",
"certificate_format",
",",
"password",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_service_certificate
|
Deletes a service certificate from the certificate store of a hosted
service.
service_name:
Name of the hosted service.
thumbalgorithm:
The algorithm for the certificate's thumbprint.
thumbprint:
The hexadecimal representation of the thumbprint.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_service_certificate(self, service_name, thumbalgorithm,
thumbprint):
'''
Deletes a service certificate from the certificate store of a hosted
service.
service_name:
Name of the hosted service.
thumbalgorithm:
The algorithm for the certificate's thumbprint.
thumbprint:
The hexadecimal representation of the thumbprint.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('thumbalgorithm', thumbalgorithm)
_validate_not_none('thumbprint', thumbprint)
return self._perform_delete(
'/' + self.subscription_id + '/services/hostedservices/' +
_str(service_name) + '/certificates/' +
_str(thumbalgorithm) + '-' + _str(thumbprint),
as_async=True)
|
def delete_service_certificate(self, service_name, thumbalgorithm,
thumbprint):
'''
Deletes a service certificate from the certificate store of a hosted
service.
service_name:
Name of the hosted service.
thumbalgorithm:
The algorithm for the certificate's thumbprint.
thumbprint:
The hexadecimal representation of the thumbprint.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('thumbalgorithm', thumbalgorithm)
_validate_not_none('thumbprint', thumbprint)
return self._perform_delete(
'/' + self.subscription_id + '/services/hostedservices/' +
_str(service_name) + '/certificates/' +
_str(thumbalgorithm) + '-' + _str(thumbprint),
as_async=True)
|
[
"Deletes",
"a",
"service",
"certificate",
"from",
"the",
"certificate",
"store",
"of",
"a",
"hosted",
"service",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L951-L971
|
[
"def",
"delete_service_certificate",
"(",
"self",
",",
"service_name",
",",
"thumbalgorithm",
",",
"thumbprint",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'thumbalgorithm'",
",",
"thumbalgorithm",
")",
"_validate_not_none",
"(",
"'thumbprint'",
",",
"thumbprint",
")",
"return",
"self",
".",
"_perform_delete",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/services/hostedservices/'",
"+",
"_str",
"(",
"service_name",
")",
"+",
"'/certificates/'",
"+",
"_str",
"(",
"thumbalgorithm",
")",
"+",
"'-'",
"+",
"_str",
"(",
"thumbprint",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.get_management_certificate
|
The Get Management Certificate operation retrieves information about
the management certificate with the specified thumbprint. Management
certificates, which are also known as subscription certificates,
authenticate clients attempting to connect to resources associated
with your Windows Azure subscription.
thumbprint:
The thumbprint value of the certificate.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def get_management_certificate(self, thumbprint):
'''
The Get Management Certificate operation retrieves information about
the management certificate with the specified thumbprint. Management
certificates, which are also known as subscription certificates,
authenticate clients attempting to connect to resources associated
with your Windows Azure subscription.
thumbprint:
The thumbprint value of the certificate.
'''
_validate_not_none('thumbprint', thumbprint)
return self._perform_get(
'/' + self.subscription_id + '/certificates/' + _str(thumbprint),
SubscriptionCertificate)
|
def get_management_certificate(self, thumbprint):
'''
The Get Management Certificate operation retrieves information about
the management certificate with the specified thumbprint. Management
certificates, which are also known as subscription certificates,
authenticate clients attempting to connect to resources associated
with your Windows Azure subscription.
thumbprint:
The thumbprint value of the certificate.
'''
_validate_not_none('thumbprint', thumbprint)
return self._perform_get(
'/' + self.subscription_id + '/certificates/' + _str(thumbprint),
SubscriptionCertificate)
|
[
"The",
"Get",
"Management",
"Certificate",
"operation",
"retrieves",
"information",
"about",
"the",
"management",
"certificate",
"with",
"the",
"specified",
"thumbprint",
".",
"Management",
"certificates",
"which",
"are",
"also",
"known",
"as",
"subscription",
"certificates",
"authenticate",
"clients",
"attempting",
"to",
"connect",
"to",
"resources",
"associated",
"with",
"your",
"Windows",
"Azure",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L985-L999
|
[
"def",
"get_management_certificate",
"(",
"self",
",",
"thumbprint",
")",
":",
"_validate_not_none",
"(",
"'thumbprint'",
",",
"thumbprint",
")",
"return",
"self",
".",
"_perform_get",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/certificates/'",
"+",
"_str",
"(",
"thumbprint",
")",
",",
"SubscriptionCertificate",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.add_management_certificate
|
The Add Management Certificate operation adds a certificate to the
list of management certificates. Management certificates, which are
also known as subscription certificates, authenticate clients
attempting to connect to resources associated with your Windows Azure
subscription.
public_key:
A base64 representation of the management certificate public key.
thumbprint:
The thumb print that uniquely identifies the management
certificate.
data:
The certificate's raw data in base-64 encoded .cer format.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def add_management_certificate(self, public_key, thumbprint, data):
'''
The Add Management Certificate operation adds a certificate to the
list of management certificates. Management certificates, which are
also known as subscription certificates, authenticate clients
attempting to connect to resources associated with your Windows Azure
subscription.
public_key:
A base64 representation of the management certificate public key.
thumbprint:
The thumb print that uniquely identifies the management
certificate.
data:
The certificate's raw data in base-64 encoded .cer format.
'''
_validate_not_none('public_key', public_key)
_validate_not_none('thumbprint', thumbprint)
_validate_not_none('data', data)
return self._perform_post(
'/' + self.subscription_id + '/certificates',
_XmlSerializer.subscription_certificate_to_xml(
public_key, thumbprint, data))
|
def add_management_certificate(self, public_key, thumbprint, data):
'''
The Add Management Certificate operation adds a certificate to the
list of management certificates. Management certificates, which are
also known as subscription certificates, authenticate clients
attempting to connect to resources associated with your Windows Azure
subscription.
public_key:
A base64 representation of the management certificate public key.
thumbprint:
The thumb print that uniquely identifies the management
certificate.
data:
The certificate's raw data in base-64 encoded .cer format.
'''
_validate_not_none('public_key', public_key)
_validate_not_none('thumbprint', thumbprint)
_validate_not_none('data', data)
return self._perform_post(
'/' + self.subscription_id + '/certificates',
_XmlSerializer.subscription_certificate_to_xml(
public_key, thumbprint, data))
|
[
"The",
"Add",
"Management",
"Certificate",
"operation",
"adds",
"a",
"certificate",
"to",
"the",
"list",
"of",
"management",
"certificates",
".",
"Management",
"certificates",
"which",
"are",
"also",
"known",
"as",
"subscription",
"certificates",
"authenticate",
"clients",
"attempting",
"to",
"connect",
"to",
"resources",
"associated",
"with",
"your",
"Windows",
"Azure",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1001-L1023
|
[
"def",
"add_management_certificate",
"(",
"self",
",",
"public_key",
",",
"thumbprint",
",",
"data",
")",
":",
"_validate_not_none",
"(",
"'public_key'",
",",
"public_key",
")",
"_validate_not_none",
"(",
"'thumbprint'",
",",
"thumbprint",
")",
"_validate_not_none",
"(",
"'data'",
",",
"data",
")",
"return",
"self",
".",
"_perform_post",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/certificates'",
",",
"_XmlSerializer",
".",
"subscription_certificate_to_xml",
"(",
"public_key",
",",
"thumbprint",
",",
"data",
")",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_management_certificate
|
The Delete Management Certificate operation deletes a certificate from
the list of management certificates. Management certificates, which
are also known as subscription certificates, authenticate clients
attempting to connect to resources associated with your Windows Azure
subscription.
thumbprint:
The thumb print that uniquely identifies the management
certificate.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_management_certificate(self, thumbprint):
'''
The Delete Management Certificate operation deletes a certificate from
the list of management certificates. Management certificates, which
are also known as subscription certificates, authenticate clients
attempting to connect to resources associated with your Windows Azure
subscription.
thumbprint:
The thumb print that uniquely identifies the management
certificate.
'''
_validate_not_none('thumbprint', thumbprint)
return self._perform_delete(
'/' + self.subscription_id + '/certificates/' + _str(thumbprint))
|
def delete_management_certificate(self, thumbprint):
'''
The Delete Management Certificate operation deletes a certificate from
the list of management certificates. Management certificates, which
are also known as subscription certificates, authenticate clients
attempting to connect to resources associated with your Windows Azure
subscription.
thumbprint:
The thumb print that uniquely identifies the management
certificate.
'''
_validate_not_none('thumbprint', thumbprint)
return self._perform_delete(
'/' + self.subscription_id + '/certificates/' + _str(thumbprint))
|
[
"The",
"Delete",
"Management",
"Certificate",
"operation",
"deletes",
"a",
"certificate",
"from",
"the",
"list",
"of",
"management",
"certificates",
".",
"Management",
"certificates",
"which",
"are",
"also",
"known",
"as",
"subscription",
"certificates",
"authenticate",
"clients",
"attempting",
"to",
"connect",
"to",
"resources",
"associated",
"with",
"your",
"Windows",
"Azure",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1025-L1039
|
[
"def",
"delete_management_certificate",
"(",
"self",
",",
"thumbprint",
")",
":",
"_validate_not_none",
"(",
"'thumbprint'",
",",
"thumbprint",
")",
"return",
"self",
".",
"_perform_delete",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/certificates/'",
"+",
"_str",
"(",
"thumbprint",
")",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.get_affinity_group_properties
|
Returns the system properties associated with the specified affinity
group.
affinity_group_name:
The name of the affinity group.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def get_affinity_group_properties(self, affinity_group_name):
'''
Returns the system properties associated with the specified affinity
group.
affinity_group_name:
The name of the affinity group.
'''
_validate_not_none('affinity_group_name', affinity_group_name)
return self._perform_get(
'/' + self.subscription_id + '/affinitygroups/' +
_str(affinity_group_name) + '',
AffinityGroup)
|
def get_affinity_group_properties(self, affinity_group_name):
'''
Returns the system properties associated with the specified affinity
group.
affinity_group_name:
The name of the affinity group.
'''
_validate_not_none('affinity_group_name', affinity_group_name)
return self._perform_get(
'/' + self.subscription_id + '/affinitygroups/' +
_str(affinity_group_name) + '',
AffinityGroup)
|
[
"Returns",
"the",
"system",
"properties",
"associated",
"with",
"the",
"specified",
"affinity",
"group",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1050-L1062
|
[
"def",
"get_affinity_group_properties",
"(",
"self",
",",
"affinity_group_name",
")",
":",
"_validate_not_none",
"(",
"'affinity_group_name'",
",",
"affinity_group_name",
")",
"return",
"self",
".",
"_perform_get",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/affinitygroups/'",
"+",
"_str",
"(",
"affinity_group_name",
")",
"+",
"''",
",",
"AffinityGroup",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.create_affinity_group
|
Creates a new affinity group for the specified subscription.
name:
A name for the affinity group that is unique to the subscription.
label:
A name for the affinity group. The name can be up to 100 characters
in length.
location:
The data center location where the affinity group will be created.
To list available locations, use the list_location function.
description:
A description for the affinity group. The description can be up to
1024 characters in length.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def create_affinity_group(self, name, label, location, description=None):
'''
Creates a new affinity group for the specified subscription.
name:
A name for the affinity group that is unique to the subscription.
label:
A name for the affinity group. The name can be up to 100 characters
in length.
location:
The data center location where the affinity group will be created.
To list available locations, use the list_location function.
description:
A description for the affinity group. The description can be up to
1024 characters in length.
'''
_validate_not_none('name', name)
_validate_not_none('label', label)
_validate_not_none('location', location)
return self._perform_post(
'/' + self.subscription_id + '/affinitygroups',
_XmlSerializer.create_affinity_group_to_xml(name,
label,
description,
location))
|
def create_affinity_group(self, name, label, location, description=None):
'''
Creates a new affinity group for the specified subscription.
name:
A name for the affinity group that is unique to the subscription.
label:
A name for the affinity group. The name can be up to 100 characters
in length.
location:
The data center location where the affinity group will be created.
To list available locations, use the list_location function.
description:
A description for the affinity group. The description can be up to
1024 characters in length.
'''
_validate_not_none('name', name)
_validate_not_none('label', label)
_validate_not_none('location', location)
return self._perform_post(
'/' + self.subscription_id + '/affinitygroups',
_XmlSerializer.create_affinity_group_to_xml(name,
label,
description,
location))
|
[
"Creates",
"a",
"new",
"affinity",
"group",
"for",
"the",
"specified",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1064-L1088
|
[
"def",
"create_affinity_group",
"(",
"self",
",",
"name",
",",
"label",
",",
"location",
",",
"description",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'name'",
",",
"name",
")",
"_validate_not_none",
"(",
"'label'",
",",
"label",
")",
"_validate_not_none",
"(",
"'location'",
",",
"location",
")",
"return",
"self",
".",
"_perform_post",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/affinitygroups'",
",",
"_XmlSerializer",
".",
"create_affinity_group_to_xml",
"(",
"name",
",",
"label",
",",
"description",
",",
"location",
")",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.update_affinity_group
|
Updates the label and/or the description for an affinity group for the
specified subscription.
affinity_group_name:
The name of the affinity group.
label:
A name for the affinity group. The name can be up to 100 characters
in length.
description:
A description for the affinity group. The description can be up to
1024 characters in length.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def update_affinity_group(self, affinity_group_name, label,
description=None):
'''
Updates the label and/or the description for an affinity group for the
specified subscription.
affinity_group_name:
The name of the affinity group.
label:
A name for the affinity group. The name can be up to 100 characters
in length.
description:
A description for the affinity group. The description can be up to
1024 characters in length.
'''
_validate_not_none('affinity_group_name', affinity_group_name)
_validate_not_none('label', label)
return self._perform_put(
'/' + self.subscription_id + '/affinitygroups/' +
_str(affinity_group_name),
_XmlSerializer.update_affinity_group_to_xml(label, description))
|
def update_affinity_group(self, affinity_group_name, label,
description=None):
'''
Updates the label and/or the description for an affinity group for the
specified subscription.
affinity_group_name:
The name of the affinity group.
label:
A name for the affinity group. The name can be up to 100 characters
in length.
description:
A description for the affinity group. The description can be up to
1024 characters in length.
'''
_validate_not_none('affinity_group_name', affinity_group_name)
_validate_not_none('label', label)
return self._perform_put(
'/' + self.subscription_id + '/affinitygroups/' +
_str(affinity_group_name),
_XmlSerializer.update_affinity_group_to_xml(label, description))
|
[
"Updates",
"the",
"label",
"and",
"/",
"or",
"the",
"description",
"for",
"an",
"affinity",
"group",
"for",
"the",
"specified",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1090-L1110
|
[
"def",
"update_affinity_group",
"(",
"self",
",",
"affinity_group_name",
",",
"label",
",",
"description",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'affinity_group_name'",
",",
"affinity_group_name",
")",
"_validate_not_none",
"(",
"'label'",
",",
"label",
")",
"return",
"self",
".",
"_perform_put",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/affinitygroups/'",
"+",
"_str",
"(",
"affinity_group_name",
")",
",",
"_XmlSerializer",
".",
"update_affinity_group_to_xml",
"(",
"label",
",",
"description",
")",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_affinity_group
|
Deletes an affinity group in the specified subscription.
affinity_group_name:
The name of the affinity group.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_affinity_group(self, affinity_group_name):
'''
Deletes an affinity group in the specified subscription.
affinity_group_name:
The name of the affinity group.
'''
_validate_not_none('affinity_group_name', affinity_group_name)
return self._perform_delete('/' + self.subscription_id + \
'/affinitygroups/' + \
_str(affinity_group_name))
|
def delete_affinity_group(self, affinity_group_name):
'''
Deletes an affinity group in the specified subscription.
affinity_group_name:
The name of the affinity group.
'''
_validate_not_none('affinity_group_name', affinity_group_name)
return self._perform_delete('/' + self.subscription_id + \
'/affinitygroups/' + \
_str(affinity_group_name))
|
[
"Deletes",
"an",
"affinity",
"group",
"in",
"the",
"specified",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1112-L1122
|
[
"def",
"delete_affinity_group",
"(",
"self",
",",
"affinity_group_name",
")",
":",
"_validate_not_none",
"(",
"'affinity_group_name'",
",",
"affinity_group_name",
")",
"return",
"self",
".",
"_perform_delete",
"(",
"'/'",
"+",
"self",
".",
"subscription_id",
"+",
"'/affinitygroups/'",
"+",
"_str",
"(",
"affinity_group_name",
")",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.list_subscription_operations
|
List subscription operations.
start_time: Required. An ISO8601 date.
end_time: Required. An ISO8601 date.
object_id_filter: Optional. Returns subscription operations only for the specified object type and object ID
operation_result_filter: Optional. Returns subscription operations only for the specified result status, either Succeeded, Failed, or InProgress.
continuation_token: Optional.
More information at:
https://msdn.microsoft.com/en-us/library/azure/gg715318.aspx
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def list_subscription_operations(self, start_time=None, end_time=None, object_id_filter=None,
operation_result_filter=None, continuation_token=None):
'''
List subscription operations.
start_time: Required. An ISO8601 date.
end_time: Required. An ISO8601 date.
object_id_filter: Optional. Returns subscription operations only for the specified object type and object ID
operation_result_filter: Optional. Returns subscription operations only for the specified result status, either Succeeded, Failed, or InProgress.
continuation_token: Optional.
More information at:
https://msdn.microsoft.com/en-us/library/azure/gg715318.aspx
'''
start_time = ('StartTime=' + start_time) if start_time else ''
end_time = ('EndTime=' + end_time) if end_time else ''
object_id_filter = ('ObjectIdFilter=' + object_id_filter) if object_id_filter else ''
operation_result_filter = ('OperationResultFilter=' + operation_result_filter) if operation_result_filter else ''
continuation_token = ('ContinuationToken=' + continuation_token) if continuation_token else ''
parameters = ('&'.join(v for v in (start_time, end_time, object_id_filter, operation_result_filter, continuation_token) if v))
parameters = '?' + parameters if parameters else ''
return self._perform_get(self._get_list_subscription_operations_path() + parameters,
SubscriptionOperationCollection)
|
def list_subscription_operations(self, start_time=None, end_time=None, object_id_filter=None,
operation_result_filter=None, continuation_token=None):
'''
List subscription operations.
start_time: Required. An ISO8601 date.
end_time: Required. An ISO8601 date.
object_id_filter: Optional. Returns subscription operations only for the specified object type and object ID
operation_result_filter: Optional. Returns subscription operations only for the specified result status, either Succeeded, Failed, or InProgress.
continuation_token: Optional.
More information at:
https://msdn.microsoft.com/en-us/library/azure/gg715318.aspx
'''
start_time = ('StartTime=' + start_time) if start_time else ''
end_time = ('EndTime=' + end_time) if end_time else ''
object_id_filter = ('ObjectIdFilter=' + object_id_filter) if object_id_filter else ''
operation_result_filter = ('OperationResultFilter=' + operation_result_filter) if operation_result_filter else ''
continuation_token = ('ContinuationToken=' + continuation_token) if continuation_token else ''
parameters = ('&'.join(v for v in (start_time, end_time, object_id_filter, operation_result_filter, continuation_token) if v))
parameters = '?' + parameters if parameters else ''
return self._perform_get(self._get_list_subscription_operations_path() + parameters,
SubscriptionOperationCollection)
|
[
"List",
"subscription",
"operations",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1163-L1186
|
[
"def",
"list_subscription_operations",
"(",
"self",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",",
"object_id_filter",
"=",
"None",
",",
"operation_result_filter",
"=",
"None",
",",
"continuation_token",
"=",
"None",
")",
":",
"start_time",
"=",
"(",
"'StartTime='",
"+",
"start_time",
")",
"if",
"start_time",
"else",
"''",
"end_time",
"=",
"(",
"'EndTime='",
"+",
"end_time",
")",
"if",
"end_time",
"else",
"''",
"object_id_filter",
"=",
"(",
"'ObjectIdFilter='",
"+",
"object_id_filter",
")",
"if",
"object_id_filter",
"else",
"''",
"operation_result_filter",
"=",
"(",
"'OperationResultFilter='",
"+",
"operation_result_filter",
")",
"if",
"operation_result_filter",
"else",
"''",
"continuation_token",
"=",
"(",
"'ContinuationToken='",
"+",
"continuation_token",
")",
"if",
"continuation_token",
"else",
"''",
"parameters",
"=",
"(",
"'&'",
".",
"join",
"(",
"v",
"for",
"v",
"in",
"(",
"start_time",
",",
"end_time",
",",
"object_id_filter",
",",
"operation_result_filter",
",",
"continuation_token",
")",
"if",
"v",
")",
")",
"parameters",
"=",
"'?'",
"+",
"parameters",
"if",
"parameters",
"else",
"''",
"return",
"self",
".",
"_perform_get",
"(",
"self",
".",
"_get_list_subscription_operations_path",
"(",
")",
"+",
"parameters",
",",
"SubscriptionOperationCollection",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.create_reserved_ip_address
|
Reserves an IPv4 address for the specified subscription.
name:
Required. Specifies the name for the reserved IP address.
label:
Optional. Specifies a label for the reserved IP address. The label
can be up to 100 characters long and can be used for your tracking
purposes.
location:
Required. Specifies the location of the reserved IP address. This
should be the same location that is assigned to the cloud service
containing the deployment that will use the reserved IP address.
To see the available locations, you can use list_locations.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def create_reserved_ip_address(self, name, label=None, location=None):
'''
Reserves an IPv4 address for the specified subscription.
name:
Required. Specifies the name for the reserved IP address.
label:
Optional. Specifies a label for the reserved IP address. The label
can be up to 100 characters long and can be used for your tracking
purposes.
location:
Required. Specifies the location of the reserved IP address. This
should be the same location that is assigned to the cloud service
containing the deployment that will use the reserved IP address.
To see the available locations, you can use list_locations.
'''
_validate_not_none('name', name)
return self._perform_post(
self._get_reserved_ip_path(),
_XmlSerializer.create_reserved_ip_to_xml(name, label, location),
as_async=True)
|
def create_reserved_ip_address(self, name, label=None, location=None):
'''
Reserves an IPv4 address for the specified subscription.
name:
Required. Specifies the name for the reserved IP address.
label:
Optional. Specifies a label for the reserved IP address. The label
can be up to 100 characters long and can be used for your tracking
purposes.
location:
Required. Specifies the location of the reserved IP address. This
should be the same location that is assigned to the cloud service
containing the deployment that will use the reserved IP address.
To see the available locations, you can use list_locations.
'''
_validate_not_none('name', name)
return self._perform_post(
self._get_reserved_ip_path(),
_XmlSerializer.create_reserved_ip_to_xml(name, label, location),
as_async=True)
|
[
"Reserves",
"an",
"IPv4",
"address",
"for",
"the",
"specified",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1189-L1209
|
[
"def",
"create_reserved_ip_address",
"(",
"self",
",",
"name",
",",
"label",
"=",
"None",
",",
"location",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'name'",
",",
"name",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_reserved_ip_path",
"(",
")",
",",
"_XmlSerializer",
".",
"create_reserved_ip_to_xml",
"(",
"name",
",",
"label",
",",
"location",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_reserved_ip_address
|
Deletes a reserved IP address from the specified subscription.
name:
Required. Name of the reserved IP address.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_reserved_ip_address(self, name):
'''
Deletes a reserved IP address from the specified subscription.
name:
Required. Name of the reserved IP address.
'''
_validate_not_none('name', name)
return self._perform_delete(self._get_reserved_ip_path(name),
as_async=True)
|
def delete_reserved_ip_address(self, name):
'''
Deletes a reserved IP address from the specified subscription.
name:
Required. Name of the reserved IP address.
'''
_validate_not_none('name', name)
return self._perform_delete(self._get_reserved_ip_path(name),
as_async=True)
|
[
"Deletes",
"a",
"reserved",
"IP",
"address",
"from",
"the",
"specified",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1211-L1220
|
[
"def",
"delete_reserved_ip_address",
"(",
"self",
",",
"name",
")",
":",
"_validate_not_none",
"(",
"'name'",
",",
"name",
")",
"return",
"self",
".",
"_perform_delete",
"(",
"self",
".",
"_get_reserved_ip_path",
"(",
"name",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.associate_reserved_ip_address
|
Associate an existing reservedIP to a deployment.
name:
Required. Name of the reserved IP address.
service_name:
Required. Name of the hosted service.
deployment_name:
Required. Name of the deployment.
virtual_ip_name:
Optional. Name of the VirtualIP in case of multi Vip tenant.
If this value is not specified default virtualIP is used
for this operation.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def associate_reserved_ip_address(
self, name, service_name, deployment_name, virtual_ip_name=None
):
'''
Associate an existing reservedIP to a deployment.
name:
Required. Name of the reserved IP address.
service_name:
Required. Name of the hosted service.
deployment_name:
Required. Name of the deployment.
virtual_ip_name:
Optional. Name of the VirtualIP in case of multi Vip tenant.
If this value is not specified default virtualIP is used
for this operation.
'''
_validate_not_none('name', name)
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
return self._perform_post(
self._get_reserved_ip_path_for_association(name),
_XmlSerializer.associate_reserved_ip_to_xml(
service_name, deployment_name, virtual_ip_name
),
as_async=True,
x_ms_version='2015-02-01'
)
|
def associate_reserved_ip_address(
self, name, service_name, deployment_name, virtual_ip_name=None
):
'''
Associate an existing reservedIP to a deployment.
name:
Required. Name of the reserved IP address.
service_name:
Required. Name of the hosted service.
deployment_name:
Required. Name of the deployment.
virtual_ip_name:
Optional. Name of the VirtualIP in case of multi Vip tenant.
If this value is not specified default virtualIP is used
for this operation.
'''
_validate_not_none('name', name)
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
return self._perform_post(
self._get_reserved_ip_path_for_association(name),
_XmlSerializer.associate_reserved_ip_to_xml(
service_name, deployment_name, virtual_ip_name
),
as_async=True,
x_ms_version='2015-02-01'
)
|
[
"Associate",
"an",
"existing",
"reservedIP",
"to",
"a",
"deployment",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1222-L1252
|
[
"def",
"associate_reserved_ip_address",
"(",
"self",
",",
"name",
",",
"service_name",
",",
"deployment_name",
",",
"virtual_ip_name",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'name'",
",",
"name",
")",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_reserved_ip_path_for_association",
"(",
"name",
")",
",",
"_XmlSerializer",
".",
"associate_reserved_ip_to_xml",
"(",
"service_name",
",",
"deployment_name",
",",
"virtual_ip_name",
")",
",",
"as_async",
"=",
"True",
",",
"x_ms_version",
"=",
"'2015-02-01'",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.disassociate_reserved_ip_address
|
Disassociate an existing reservedIP from the given deployment.
name:
Required. Name of the reserved IP address.
service_name:
Required. Name of the hosted service.
deployment_name:
Required. Name of the deployment.
virtual_ip_name:
Optional. Name of the VirtualIP in case of multi Vip tenant.
If this value is not specified default virtualIP is used
for this operation.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def disassociate_reserved_ip_address(
self, name, service_name, deployment_name, virtual_ip_name=None
):
'''
Disassociate an existing reservedIP from the given deployment.
name:
Required. Name of the reserved IP address.
service_name:
Required. Name of the hosted service.
deployment_name:
Required. Name of the deployment.
virtual_ip_name:
Optional. Name of the VirtualIP in case of multi Vip tenant.
If this value is not specified default virtualIP is used
for this operation.
'''
_validate_not_none('name', name)
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
return self._perform_post(
self._get_reserved_ip_path_for_disassociation(name),
_XmlSerializer.associate_reserved_ip_to_xml(
service_name, deployment_name, virtual_ip_name
),
as_async=True,
x_ms_version='2015-02-01'
)
|
def disassociate_reserved_ip_address(
self, name, service_name, deployment_name, virtual_ip_name=None
):
'''
Disassociate an existing reservedIP from the given deployment.
name:
Required. Name of the reserved IP address.
service_name:
Required. Name of the hosted service.
deployment_name:
Required. Name of the deployment.
virtual_ip_name:
Optional. Name of the VirtualIP in case of multi Vip tenant.
If this value is not specified default virtualIP is used
for this operation.
'''
_validate_not_none('name', name)
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
return self._perform_post(
self._get_reserved_ip_path_for_disassociation(name),
_XmlSerializer.associate_reserved_ip_to_xml(
service_name, deployment_name, virtual_ip_name
),
as_async=True,
x_ms_version='2015-02-01'
)
|
[
"Disassociate",
"an",
"existing",
"reservedIP",
"from",
"the",
"given",
"deployment",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1254-L1284
|
[
"def",
"disassociate_reserved_ip_address",
"(",
"self",
",",
"name",
",",
"service_name",
",",
"deployment_name",
",",
"virtual_ip_name",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'name'",
",",
"name",
")",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_reserved_ip_path_for_disassociation",
"(",
"name",
")",
",",
"_XmlSerializer",
".",
"associate_reserved_ip_to_xml",
"(",
"service_name",
",",
"deployment_name",
",",
"virtual_ip_name",
")",
",",
"as_async",
"=",
"True",
",",
"x_ms_version",
"=",
"'2015-02-01'",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.get_reserved_ip_address
|
Retrieves information about the specified reserved IP address.
name:
Required. Name of the reserved IP address.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def get_reserved_ip_address(self, name):
'''
Retrieves information about the specified reserved IP address.
name:
Required. Name of the reserved IP address.
'''
_validate_not_none('name', name)
return self._perform_get(self._get_reserved_ip_path(name), ReservedIP)
|
def get_reserved_ip_address(self, name):
'''
Retrieves information about the specified reserved IP address.
name:
Required. Name of the reserved IP address.
'''
_validate_not_none('name', name)
return self._perform_get(self._get_reserved_ip_path(name), ReservedIP)
|
[
"Retrieves",
"information",
"about",
"the",
"specified",
"reserved",
"IP",
"address",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1286-L1294
|
[
"def",
"get_reserved_ip_address",
"(",
"self",
",",
"name",
")",
":",
"_validate_not_none",
"(",
"'name'",
",",
"name",
")",
"return",
"self",
".",
"_perform_get",
"(",
"self",
".",
"_get_reserved_ip_path",
"(",
"name",
")",
",",
"ReservedIP",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.get_role
|
Retrieves the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def get_role(self, service_name, deployment_name, role_name):
'''
Retrieves the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
return self._perform_get(
self._get_role_path(service_name, deployment_name, role_name),
PersistentVMRole)
|
def get_role(self, service_name, deployment_name, role_name):
'''
Retrieves the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
return self._perform_get(
self._get_role_path(service_name, deployment_name, role_name),
PersistentVMRole)
|
[
"Retrieves",
"the",
"specified",
"virtual",
"machine",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1304-L1320
|
[
"def",
"get_role",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_name'",
",",
"role_name",
")",
"return",
"self",
".",
"_perform_get",
"(",
"self",
".",
"_get_role_path",
"(",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
",",
"PersistentVMRole",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.create_virtual_machine_deployment
|
Provisions a virtual machine based on the supplied configuration.
service_name:
Name of the hosted service.
deployment_name:
The name for the deployment. The deployment name must be unique
among other deployments for the hosted service.
deployment_slot:
The environment to which the hosted service is deployed. Valid
values are: staging, production
label:
Specifies an identifier for the deployment. The label can be up to
100 characters long. The label can be used for tracking purposes.
role_name:
The name of the role.
system_config:
Contains the metadata required to provision a virtual machine from
a Windows or Linux OS image. Use an instance of
WindowsConfigurationSet or LinuxConfigurationSet.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine. If you are creating a Virtual
Machine by using a VM Image, this parameter is not used.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under. Use an instance of ConfigurationSet.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine
allocation in the Windows Azure environment. Virtual machines
specified in the same availability set are allocated to different
nodes to maximize availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall,Small,Medium,Large,
ExtraLarge,A5,A6,A7,A8,A9,Basic_A0,Basic_A1,Basic_A2,Basic_A3,
Basic_A4,Standard_D1,Standard_D2,Standard_D3,Standard_D4,
Standard_D11,Standard_D12,Standard_D13,Standard_D14,Standard_G1,
Standard_G2,Sandard_G3,Standard_G4,Standard_G5. The specified
value must be compatible with the disk selected in the
OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
virtual_network_name:
Specifies the name of an existing virtual network to which the
deployment will belong.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
be installed on the Virtual Machine. This element is used if
provision_guest_agent is set to True. Use an iterable of instances
of ResourceExtensionReference.
provision_guest_agent:
Optional. Indicates whether the VM Agent is installed on the
Virtual Machine. To run a resource extension in a Virtual Machine,
this service must be installed.
vm_image_name:
Optional. Specifies the name of the VM Image that is to be used to
create the Virtual Machine. If this is specified, the
system_config and network_config parameters are not used.
media_location:
Optional. Required if the Virtual Machine is being created from a
published VM Image. Specifies the location of the VHD file that is
created when VMImageName specifies a published VM Image.
dns_servers:
Optional. List of DNS servers (use DnsServer class) to associate
with the Virtual Machine.
reserved_ip_name:
Optional. Specifies the name of a reserved IP address that is to be
assigned to the deployment. You must run create_reserved_ip_address
before you can assign the address to the deployment using this
element.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def create_virtual_machine_deployment(self, service_name, deployment_name,
deployment_slot, label, role_name,
system_config, os_virtual_hard_disk,
network_config=None,
availability_set_name=None,
data_virtual_hard_disks=None,
role_size=None,
role_type='PersistentVMRole',
virtual_network_name=None,
resource_extension_references=None,
provision_guest_agent=None,
vm_image_name=None,
media_location=None,
dns_servers=None,
reserved_ip_name=None):
'''
Provisions a virtual machine based on the supplied configuration.
service_name:
Name of the hosted service.
deployment_name:
The name for the deployment. The deployment name must be unique
among other deployments for the hosted service.
deployment_slot:
The environment to which the hosted service is deployed. Valid
values are: staging, production
label:
Specifies an identifier for the deployment. The label can be up to
100 characters long. The label can be used for tracking purposes.
role_name:
The name of the role.
system_config:
Contains the metadata required to provision a virtual machine from
a Windows or Linux OS image. Use an instance of
WindowsConfigurationSet or LinuxConfigurationSet.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine. If you are creating a Virtual
Machine by using a VM Image, this parameter is not used.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under. Use an instance of ConfigurationSet.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine
allocation in the Windows Azure environment. Virtual machines
specified in the same availability set are allocated to different
nodes to maximize availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall,Small,Medium,Large,
ExtraLarge,A5,A6,A7,A8,A9,Basic_A0,Basic_A1,Basic_A2,Basic_A3,
Basic_A4,Standard_D1,Standard_D2,Standard_D3,Standard_D4,
Standard_D11,Standard_D12,Standard_D13,Standard_D14,Standard_G1,
Standard_G2,Sandard_G3,Standard_G4,Standard_G5. The specified
value must be compatible with the disk selected in the
OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
virtual_network_name:
Specifies the name of an existing virtual network to which the
deployment will belong.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
be installed on the Virtual Machine. This element is used if
provision_guest_agent is set to True. Use an iterable of instances
of ResourceExtensionReference.
provision_guest_agent:
Optional. Indicates whether the VM Agent is installed on the
Virtual Machine. To run a resource extension in a Virtual Machine,
this service must be installed.
vm_image_name:
Optional. Specifies the name of the VM Image that is to be used to
create the Virtual Machine. If this is specified, the
system_config and network_config parameters are not used.
media_location:
Optional. Required if the Virtual Machine is being created from a
published VM Image. Specifies the location of the VHD file that is
created when VMImageName specifies a published VM Image.
dns_servers:
Optional. List of DNS servers (use DnsServer class) to associate
with the Virtual Machine.
reserved_ip_name:
Optional. Specifies the name of a reserved IP address that is to be
assigned to the deployment. You must run create_reserved_ip_address
before you can assign the address to the deployment using this
element.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('deployment_slot', deployment_slot)
_validate_not_none('label', label)
_validate_not_none('role_name', role_name)
return self._perform_post(
self._get_deployment_path_using_name(service_name),
_XmlSerializer.virtual_machine_deployment_to_xml(
deployment_name,
deployment_slot,
label,
role_name,
system_config,
os_virtual_hard_disk,
role_type,
network_config,
availability_set_name,
data_virtual_hard_disks,
role_size,
virtual_network_name,
resource_extension_references,
provision_guest_agent,
vm_image_name,
media_location,
dns_servers,
reserved_ip_name),
as_async=True)
|
def create_virtual_machine_deployment(self, service_name, deployment_name,
deployment_slot, label, role_name,
system_config, os_virtual_hard_disk,
network_config=None,
availability_set_name=None,
data_virtual_hard_disks=None,
role_size=None,
role_type='PersistentVMRole',
virtual_network_name=None,
resource_extension_references=None,
provision_guest_agent=None,
vm_image_name=None,
media_location=None,
dns_servers=None,
reserved_ip_name=None):
'''
Provisions a virtual machine based on the supplied configuration.
service_name:
Name of the hosted service.
deployment_name:
The name for the deployment. The deployment name must be unique
among other deployments for the hosted service.
deployment_slot:
The environment to which the hosted service is deployed. Valid
values are: staging, production
label:
Specifies an identifier for the deployment. The label can be up to
100 characters long. The label can be used for tracking purposes.
role_name:
The name of the role.
system_config:
Contains the metadata required to provision a virtual machine from
a Windows or Linux OS image. Use an instance of
WindowsConfigurationSet or LinuxConfigurationSet.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine. If you are creating a Virtual
Machine by using a VM Image, this parameter is not used.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under. Use an instance of ConfigurationSet.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine
allocation in the Windows Azure environment. Virtual machines
specified in the same availability set are allocated to different
nodes to maximize availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall,Small,Medium,Large,
ExtraLarge,A5,A6,A7,A8,A9,Basic_A0,Basic_A1,Basic_A2,Basic_A3,
Basic_A4,Standard_D1,Standard_D2,Standard_D3,Standard_D4,
Standard_D11,Standard_D12,Standard_D13,Standard_D14,Standard_G1,
Standard_G2,Sandard_G3,Standard_G4,Standard_G5. The specified
value must be compatible with the disk selected in the
OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
virtual_network_name:
Specifies the name of an existing virtual network to which the
deployment will belong.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
be installed on the Virtual Machine. This element is used if
provision_guest_agent is set to True. Use an iterable of instances
of ResourceExtensionReference.
provision_guest_agent:
Optional. Indicates whether the VM Agent is installed on the
Virtual Machine. To run a resource extension in a Virtual Machine,
this service must be installed.
vm_image_name:
Optional. Specifies the name of the VM Image that is to be used to
create the Virtual Machine. If this is specified, the
system_config and network_config parameters are not used.
media_location:
Optional. Required if the Virtual Machine is being created from a
published VM Image. Specifies the location of the VHD file that is
created when VMImageName specifies a published VM Image.
dns_servers:
Optional. List of DNS servers (use DnsServer class) to associate
with the Virtual Machine.
reserved_ip_name:
Optional. Specifies the name of a reserved IP address that is to be
assigned to the deployment. You must run create_reserved_ip_address
before you can assign the address to the deployment using this
element.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('deployment_slot', deployment_slot)
_validate_not_none('label', label)
_validate_not_none('role_name', role_name)
return self._perform_post(
self._get_deployment_path_using_name(service_name),
_XmlSerializer.virtual_machine_deployment_to_xml(
deployment_name,
deployment_slot,
label,
role_name,
system_config,
os_virtual_hard_disk,
role_type,
network_config,
availability_set_name,
data_virtual_hard_disks,
role_size,
virtual_network_name,
resource_extension_references,
provision_guest_agent,
vm_image_name,
media_location,
dns_servers,
reserved_ip_name),
as_async=True)
|
[
"Provisions",
"a",
"virtual",
"machine",
"based",
"on",
"the",
"supplied",
"configuration",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1322-L1444
|
[
"def",
"create_virtual_machine_deployment",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"deployment_slot",
",",
"label",
",",
"role_name",
",",
"system_config",
",",
"os_virtual_hard_disk",
",",
"network_config",
"=",
"None",
",",
"availability_set_name",
"=",
"None",
",",
"data_virtual_hard_disks",
"=",
"None",
",",
"role_size",
"=",
"None",
",",
"role_type",
"=",
"'PersistentVMRole'",
",",
"virtual_network_name",
"=",
"None",
",",
"resource_extension_references",
"=",
"None",
",",
"provision_guest_agent",
"=",
"None",
",",
"vm_image_name",
"=",
"None",
",",
"media_location",
"=",
"None",
",",
"dns_servers",
"=",
"None",
",",
"reserved_ip_name",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'deployment_slot'",
",",
"deployment_slot",
")",
"_validate_not_none",
"(",
"'label'",
",",
"label",
")",
"_validate_not_none",
"(",
"'role_name'",
",",
"role_name",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_deployment_path_using_name",
"(",
"service_name",
")",
",",
"_XmlSerializer",
".",
"virtual_machine_deployment_to_xml",
"(",
"deployment_name",
",",
"deployment_slot",
",",
"label",
",",
"role_name",
",",
"system_config",
",",
"os_virtual_hard_disk",
",",
"role_type",
",",
"network_config",
",",
"availability_set_name",
",",
"data_virtual_hard_disks",
",",
"role_size",
",",
"virtual_network_name",
",",
"resource_extension_references",
",",
"provision_guest_agent",
",",
"vm_image_name",
",",
"media_location",
",",
"dns_servers",
",",
"reserved_ip_name",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.add_role
|
Adds a virtual machine to an existing deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
system_config:
Contains the metadata required to provision a virtual machine from
a Windows or Linux OS image. Use an instance of
WindowsConfigurationSet or LinuxConfigurationSet.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine. If you are creating a Virtual
Machine by using a VM Image, this parameter is not used.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine allocation
in the Windows Azure environment. Virtual machines specified in the
same availability set are allocated to different nodes to maximize
availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall, Small, Medium, Large,
ExtraLarge. The specified value must be compatible with the disk
selected in the OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
be installed on the Virtual Machine. This element is used if
provision_guest_agent is set to True.
provision_guest_agent:
Optional. Indicates whether the VM Agent is installed on the
Virtual Machine. To run a resource extension in a Virtual Machine,
this service must be installed.
vm_image_name:
Optional. Specifies the name of the VM Image that is to be used to
create the Virtual Machine. If this is specified, the
system_config and network_config parameters are not used.
media_location:
Optional. Required if the Virtual Machine is being created from a
published VM Image. Specifies the location of the VHD file that is
created when VMImageName specifies a published VM Image.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def add_role(self, service_name, deployment_name, role_name, system_config,
os_virtual_hard_disk, network_config=None,
availability_set_name=None, data_virtual_hard_disks=None,
role_size=None, role_type='PersistentVMRole',
resource_extension_references=None,
provision_guest_agent=None, vm_image_name=None,
media_location=None):
'''
Adds a virtual machine to an existing deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
system_config:
Contains the metadata required to provision a virtual machine from
a Windows or Linux OS image. Use an instance of
WindowsConfigurationSet or LinuxConfigurationSet.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine. If you are creating a Virtual
Machine by using a VM Image, this parameter is not used.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine allocation
in the Windows Azure environment. Virtual machines specified in the
same availability set are allocated to different nodes to maximize
availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall, Small, Medium, Large,
ExtraLarge. The specified value must be compatible with the disk
selected in the OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
be installed on the Virtual Machine. This element is used if
provision_guest_agent is set to True.
provision_guest_agent:
Optional. Indicates whether the VM Agent is installed on the
Virtual Machine. To run a resource extension in a Virtual Machine,
this service must be installed.
vm_image_name:
Optional. Specifies the name of the VM Image that is to be used to
create the Virtual Machine. If this is specified, the
system_config and network_config parameters are not used.
media_location:
Optional. Required if the Virtual Machine is being created from a
published VM Image. Specifies the location of the VHD file that is
created when VMImageName specifies a published VM Image.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
return self._perform_post(
self._get_role_path(service_name, deployment_name),
_XmlSerializer.add_role_to_xml(
role_name,
system_config,
os_virtual_hard_disk,
role_type,
network_config,
availability_set_name,
data_virtual_hard_disks,
role_size,
resource_extension_references,
provision_guest_agent,
vm_image_name,
media_location),
as_async=True)
|
def add_role(self, service_name, deployment_name, role_name, system_config,
os_virtual_hard_disk, network_config=None,
availability_set_name=None, data_virtual_hard_disks=None,
role_size=None, role_type='PersistentVMRole',
resource_extension_references=None,
provision_guest_agent=None, vm_image_name=None,
media_location=None):
'''
Adds a virtual machine to an existing deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
system_config:
Contains the metadata required to provision a virtual machine from
a Windows or Linux OS image. Use an instance of
WindowsConfigurationSet or LinuxConfigurationSet.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine. If you are creating a Virtual
Machine by using a VM Image, this parameter is not used.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine allocation
in the Windows Azure environment. Virtual machines specified in the
same availability set are allocated to different nodes to maximize
availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall, Small, Medium, Large,
ExtraLarge. The specified value must be compatible with the disk
selected in the OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
be installed on the Virtual Machine. This element is used if
provision_guest_agent is set to True.
provision_guest_agent:
Optional. Indicates whether the VM Agent is installed on the
Virtual Machine. To run a resource extension in a Virtual Machine,
this service must be installed.
vm_image_name:
Optional. Specifies the name of the VM Image that is to be used to
create the Virtual Machine. If this is specified, the
system_config and network_config parameters are not used.
media_location:
Optional. Required if the Virtual Machine is being created from a
published VM Image. Specifies the location of the VHD file that is
created when VMImageName specifies a published VM Image.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
return self._perform_post(
self._get_role_path(service_name, deployment_name),
_XmlSerializer.add_role_to_xml(
role_name,
system_config,
os_virtual_hard_disk,
role_type,
network_config,
availability_set_name,
data_virtual_hard_disks,
role_size,
resource_extension_references,
provision_guest_agent,
vm_image_name,
media_location),
as_async=True)
|
[
"Adds",
"a",
"virtual",
"machine",
"to",
"an",
"existing",
"deployment",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1446-L1529
|
[
"def",
"add_role",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_name",
",",
"system_config",
",",
"os_virtual_hard_disk",
",",
"network_config",
"=",
"None",
",",
"availability_set_name",
"=",
"None",
",",
"data_virtual_hard_disks",
"=",
"None",
",",
"role_size",
"=",
"None",
",",
"role_type",
"=",
"'PersistentVMRole'",
",",
"resource_extension_references",
"=",
"None",
",",
"provision_guest_agent",
"=",
"None",
",",
"vm_image_name",
"=",
"None",
",",
"media_location",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_name'",
",",
"role_name",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_role_path",
"(",
"service_name",
",",
"deployment_name",
")",
",",
"_XmlSerializer",
".",
"add_role_to_xml",
"(",
"role_name",
",",
"system_config",
",",
"os_virtual_hard_disk",
",",
"role_type",
",",
"network_config",
",",
"availability_set_name",
",",
"data_virtual_hard_disks",
",",
"role_size",
",",
"resource_extension_references",
",",
"provision_guest_agent",
",",
"vm_image_name",
",",
"media_location",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.update_role
|
Updates the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine allocation
in the Windows Azure environment. Virtual machines specified in the
same availability set are allocated to different nodes to maximize
availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall, Small, Medium, Large,
ExtraLarge. The specified value must be compatible with the disk
selected in the OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
be installed on the Virtual Machine. This element is used if
provision_guest_agent is set to True.
provision_guest_agent:
Optional. Indicates whether the VM Agent is installed on the
Virtual Machine. To run a resource extension in a Virtual Machine,
this service must be installed.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def update_role(self, service_name, deployment_name, role_name,
os_virtual_hard_disk=None, network_config=None,
availability_set_name=None, data_virtual_hard_disks=None,
role_size=None, role_type='PersistentVMRole',
resource_extension_references=None,
provision_guest_agent=None):
'''
Updates the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine allocation
in the Windows Azure environment. Virtual machines specified in the
same availability set are allocated to different nodes to maximize
availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall, Small, Medium, Large,
ExtraLarge. The specified value must be compatible with the disk
selected in the OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
be installed on the Virtual Machine. This element is used if
provision_guest_agent is set to True.
provision_guest_agent:
Optional. Indicates whether the VM Agent is installed on the
Virtual Machine. To run a resource extension in a Virtual Machine,
this service must be installed.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
return self._perform_put(
self._get_role_path(service_name, deployment_name, role_name),
_XmlSerializer.update_role_to_xml(
role_name,
os_virtual_hard_disk,
role_type,
network_config,
availability_set_name,
data_virtual_hard_disks,
role_size,
resource_extension_references,
provision_guest_agent),
as_async=True)
|
def update_role(self, service_name, deployment_name, role_name,
os_virtual_hard_disk=None, network_config=None,
availability_set_name=None, data_virtual_hard_disks=None,
role_size=None, role_type='PersistentVMRole',
resource_extension_references=None,
provision_guest_agent=None):
'''
Updates the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine allocation
in the Windows Azure environment. Virtual machines specified in the
same availability set are allocated to different nodes to maximize
availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall, Small, Medium, Large,
ExtraLarge. The specified value must be compatible with the disk
selected in the OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
be installed on the Virtual Machine. This element is used if
provision_guest_agent is set to True.
provision_guest_agent:
Optional. Indicates whether the VM Agent is installed on the
Virtual Machine. To run a resource extension in a Virtual Machine,
this service must be installed.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
return self._perform_put(
self._get_role_path(service_name, deployment_name, role_name),
_XmlSerializer.update_role_to_xml(
role_name,
os_virtual_hard_disk,
role_type,
network_config,
availability_set_name,
data_virtual_hard_disks,
role_size,
resource_extension_references,
provision_guest_agent),
as_async=True)
|
[
"Updates",
"the",
"specified",
"virtual",
"machine",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1531-L1597
|
[
"def",
"update_role",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_name",
",",
"os_virtual_hard_disk",
"=",
"None",
",",
"network_config",
"=",
"None",
",",
"availability_set_name",
"=",
"None",
",",
"data_virtual_hard_disks",
"=",
"None",
",",
"role_size",
"=",
"None",
",",
"role_type",
"=",
"'PersistentVMRole'",
",",
"resource_extension_references",
"=",
"None",
",",
"provision_guest_agent",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_name'",
",",
"role_name",
")",
"return",
"self",
".",
"_perform_put",
"(",
"self",
".",
"_get_role_path",
"(",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
",",
"_XmlSerializer",
".",
"update_role_to_xml",
"(",
"role_name",
",",
"os_virtual_hard_disk",
",",
"role_type",
",",
"network_config",
",",
"availability_set_name",
",",
"data_virtual_hard_disks",
",",
"role_size",
",",
"resource_extension_references",
",",
"provision_guest_agent",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_role
|
Deletes the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
complete:
True if all OS/data disks and the source blobs for the disks should
also be deleted from storage.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_role(self, service_name, deployment_name, role_name, complete = False):
'''
Deletes the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
complete:
True if all OS/data disks and the source blobs for the disks should
also be deleted from storage.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
path = self._get_role_path(service_name, deployment_name, role_name)
if complete == True:
path = path +'?comp=media'
return self._perform_delete(path,
as_async=True)
|
def delete_role(self, service_name, deployment_name, role_name, complete = False):
'''
Deletes the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
complete:
True if all OS/data disks and the source blobs for the disks should
also be deleted from storage.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
path = self._get_role_path(service_name, deployment_name, role_name)
if complete == True:
path = path +'?comp=media'
return self._perform_delete(path,
as_async=True)
|
[
"Deletes",
"the",
"specified",
"virtual",
"machine",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1599-L1623
|
[
"def",
"delete_role",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_name",
",",
"complete",
"=",
"False",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_name'",
",",
"role_name",
")",
"path",
"=",
"self",
".",
"_get_role_path",
"(",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
"if",
"complete",
"==",
"True",
":",
"path",
"=",
"path",
"+",
"'?comp=media'",
"return",
"self",
".",
"_perform_delete",
"(",
"path",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.capture_role
|
The Capture Role operation captures a virtual machine image to your
image gallery. From the captured image, you can create additional
customized virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
post_capture_action:
Specifies the action after capture operation completes. Possible
values are: Delete, Reprovision.
target_image_name:
Specifies the image name of the captured virtual machine.
target_image_label:
Specifies the friendly name of the captured virtual machine.
provisioning_configuration:
Use an instance of WindowsConfigurationSet or LinuxConfigurationSet.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def capture_role(self, service_name, deployment_name, role_name,
post_capture_action, target_image_name,
target_image_label, provisioning_configuration=None):
'''
The Capture Role operation captures a virtual machine image to your
image gallery. From the captured image, you can create additional
customized virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
post_capture_action:
Specifies the action after capture operation completes. Possible
values are: Delete, Reprovision.
target_image_name:
Specifies the image name of the captured virtual machine.
target_image_label:
Specifies the friendly name of the captured virtual machine.
provisioning_configuration:
Use an instance of WindowsConfigurationSet or LinuxConfigurationSet.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
_validate_not_none('post_capture_action', post_capture_action)
_validate_not_none('target_image_name', target_image_name)
_validate_not_none('target_image_label', target_image_label)
return self._perform_post(
self._get_role_instance_operations_path(
service_name, deployment_name, role_name),
_XmlSerializer.capture_role_to_xml(
post_capture_action,
target_image_name,
target_image_label,
provisioning_configuration),
as_async=True)
|
def capture_role(self, service_name, deployment_name, role_name,
post_capture_action, target_image_name,
target_image_label, provisioning_configuration=None):
'''
The Capture Role operation captures a virtual machine image to your
image gallery. From the captured image, you can create additional
customized virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
post_capture_action:
Specifies the action after capture operation completes. Possible
values are: Delete, Reprovision.
target_image_name:
Specifies the image name of the captured virtual machine.
target_image_label:
Specifies the friendly name of the captured virtual machine.
provisioning_configuration:
Use an instance of WindowsConfigurationSet or LinuxConfigurationSet.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
_validate_not_none('post_capture_action', post_capture_action)
_validate_not_none('target_image_name', target_image_name)
_validate_not_none('target_image_label', target_image_label)
return self._perform_post(
self._get_role_instance_operations_path(
service_name, deployment_name, role_name),
_XmlSerializer.capture_role_to_xml(
post_capture_action,
target_image_name,
target_image_label,
provisioning_configuration),
as_async=True)
|
[
"The",
"Capture",
"Role",
"operation",
"captures",
"a",
"virtual",
"machine",
"image",
"to",
"your",
"image",
"gallery",
".",
"From",
"the",
"captured",
"image",
"you",
"can",
"create",
"additional",
"customized",
"virtual",
"machines",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1625-L1663
|
[
"def",
"capture_role",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_name",
",",
"post_capture_action",
",",
"target_image_name",
",",
"target_image_label",
",",
"provisioning_configuration",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_name'",
",",
"role_name",
")",
"_validate_not_none",
"(",
"'post_capture_action'",
",",
"post_capture_action",
")",
"_validate_not_none",
"(",
"'target_image_name'",
",",
"target_image_name",
")",
"_validate_not_none",
"(",
"'target_image_label'",
",",
"target_image_label",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_role_instance_operations_path",
"(",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
",",
"_XmlSerializer",
".",
"capture_role_to_xml",
"(",
"post_capture_action",
",",
"target_image_name",
",",
"target_image_label",
",",
"provisioning_configuration",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.start_role
|
Starts the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def start_role(self, service_name, deployment_name, role_name):
'''
Starts the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
return self._perform_post(
self._get_role_instance_operations_path(
service_name, deployment_name, role_name),
_XmlSerializer.start_role_operation_to_xml(),
as_async=True)
|
def start_role(self, service_name, deployment_name, role_name):
'''
Starts the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
return self._perform_post(
self._get_role_instance_operations_path(
service_name, deployment_name, role_name),
_XmlSerializer.start_role_operation_to_xml(),
as_async=True)
|
[
"Starts",
"the",
"specified",
"virtual",
"machine",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1665-L1683
|
[
"def",
"start_role",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_name'",
",",
"role_name",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_role_instance_operations_path",
"(",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
",",
"_XmlSerializer",
".",
"start_role_operation_to_xml",
"(",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.start_roles
|
Starts the specified virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_names:
The names of the roles, as an enumerable of strings.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def start_roles(self, service_name, deployment_name, role_names):
'''
Starts the specified virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_names:
The names of the roles, as an enumerable of strings.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_names', role_names)
return self._perform_post(
self._get_roles_operations_path(service_name, deployment_name),
_XmlSerializer.start_roles_operation_to_xml(role_names),
as_async=True)
|
def start_roles(self, service_name, deployment_name, role_names):
'''
Starts the specified virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_names:
The names of the roles, as an enumerable of strings.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_names', role_names)
return self._perform_post(
self._get_roles_operations_path(service_name, deployment_name),
_XmlSerializer.start_roles_operation_to_xml(role_names),
as_async=True)
|
[
"Starts",
"the",
"specified",
"virtual",
"machines",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1685-L1702
|
[
"def",
"start_roles",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_names",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_names'",
",",
"role_names",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_roles_operations_path",
"(",
"service_name",
",",
"deployment_name",
")",
",",
"_XmlSerializer",
".",
"start_roles_operation_to_xml",
"(",
"role_names",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.restart_role
|
Restarts the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def restart_role(self, service_name, deployment_name, role_name):
'''
Restarts the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
return self._perform_post(
self._get_role_instance_operations_path(
service_name, deployment_name, role_name),
_XmlSerializer.restart_role_operation_to_xml(
),
as_async=True)
|
def restart_role(self, service_name, deployment_name, role_name):
'''
Restarts the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
return self._perform_post(
self._get_role_instance_operations_path(
service_name, deployment_name, role_name),
_XmlSerializer.restart_role_operation_to_xml(
),
as_async=True)
|
[
"Restarts",
"the",
"specified",
"virtual",
"machine",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1704-L1723
|
[
"def",
"restart_role",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_name'",
",",
"role_name",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_role_instance_operations_path",
"(",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
",",
"_XmlSerializer",
".",
"restart_role_operation_to_xml",
"(",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.shutdown_role
|
Shuts down the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
post_shutdown_action:
Specifies how the Virtual Machine should be shut down. Values are:
Stopped
Shuts down the Virtual Machine but retains the compute
resources. You will continue to be billed for the resources
that the stopped machine uses.
StoppedDeallocated
Shuts down the Virtual Machine and releases the compute
resources. You are not billed for the compute resources that
this Virtual Machine uses. If a static Virtual Network IP
address is assigned to the Virtual Machine, it is reserved.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def shutdown_role(self, service_name, deployment_name, role_name,
post_shutdown_action='Stopped'):
'''
Shuts down the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
post_shutdown_action:
Specifies how the Virtual Machine should be shut down. Values are:
Stopped
Shuts down the Virtual Machine but retains the compute
resources. You will continue to be billed for the resources
that the stopped machine uses.
StoppedDeallocated
Shuts down the Virtual Machine and releases the compute
resources. You are not billed for the compute resources that
this Virtual Machine uses. If a static Virtual Network IP
address is assigned to the Virtual Machine, it is reserved.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
_validate_not_none('post_shutdown_action', post_shutdown_action)
return self._perform_post(
self._get_role_instance_operations_path(
service_name, deployment_name, role_name),
_XmlSerializer.shutdown_role_operation_to_xml(post_shutdown_action),
as_async=True)
|
def shutdown_role(self, service_name, deployment_name, role_name,
post_shutdown_action='Stopped'):
'''
Shuts down the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
post_shutdown_action:
Specifies how the Virtual Machine should be shut down. Values are:
Stopped
Shuts down the Virtual Machine but retains the compute
resources. You will continue to be billed for the resources
that the stopped machine uses.
StoppedDeallocated
Shuts down the Virtual Machine and releases the compute
resources. You are not billed for the compute resources that
this Virtual Machine uses. If a static Virtual Network IP
address is assigned to the Virtual Machine, it is reserved.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
_validate_not_none('post_shutdown_action', post_shutdown_action)
return self._perform_post(
self._get_role_instance_operations_path(
service_name, deployment_name, role_name),
_XmlSerializer.shutdown_role_operation_to_xml(post_shutdown_action),
as_async=True)
|
[
"Shuts",
"down",
"the",
"specified",
"virtual",
"machine",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1725-L1756
|
[
"def",
"shutdown_role",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_name",
",",
"post_shutdown_action",
"=",
"'Stopped'",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_name'",
",",
"role_name",
")",
"_validate_not_none",
"(",
"'post_shutdown_action'",
",",
"post_shutdown_action",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_role_instance_operations_path",
"(",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
",",
"_XmlSerializer",
".",
"shutdown_role_operation_to_xml",
"(",
"post_shutdown_action",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.shutdown_roles
|
Shuts down the specified virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_names:
The names of the roles, as an enumerable of strings.
post_shutdown_action:
Specifies how the Virtual Machine should be shut down. Values are:
Stopped
Shuts down the Virtual Machine but retains the compute
resources. You will continue to be billed for the resources
that the stopped machine uses.
StoppedDeallocated
Shuts down the Virtual Machine and releases the compute
resources. You are not billed for the compute resources that
this Virtual Machine uses. If a static Virtual Network IP
address is assigned to the Virtual Machine, it is reserved.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def shutdown_roles(self, service_name, deployment_name, role_names,
post_shutdown_action='Stopped'):
'''
Shuts down the specified virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_names:
The names of the roles, as an enumerable of strings.
post_shutdown_action:
Specifies how the Virtual Machine should be shut down. Values are:
Stopped
Shuts down the Virtual Machine but retains the compute
resources. You will continue to be billed for the resources
that the stopped machine uses.
StoppedDeallocated
Shuts down the Virtual Machine and releases the compute
resources. You are not billed for the compute resources that
this Virtual Machine uses. If a static Virtual Network IP
address is assigned to the Virtual Machine, it is reserved.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_names', role_names)
_validate_not_none('post_shutdown_action', post_shutdown_action)
return self._perform_post(
self._get_roles_operations_path(service_name, deployment_name),
_XmlSerializer.shutdown_roles_operation_to_xml(
role_names, post_shutdown_action),
as_async=True)
|
def shutdown_roles(self, service_name, deployment_name, role_names,
post_shutdown_action='Stopped'):
'''
Shuts down the specified virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_names:
The names of the roles, as an enumerable of strings.
post_shutdown_action:
Specifies how the Virtual Machine should be shut down. Values are:
Stopped
Shuts down the Virtual Machine but retains the compute
resources. You will continue to be billed for the resources
that the stopped machine uses.
StoppedDeallocated
Shuts down the Virtual Machine and releases the compute
resources. You are not billed for the compute resources that
this Virtual Machine uses. If a static Virtual Network IP
address is assigned to the Virtual Machine, it is reserved.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_names', role_names)
_validate_not_none('post_shutdown_action', post_shutdown_action)
return self._perform_post(
self._get_roles_operations_path(service_name, deployment_name),
_XmlSerializer.shutdown_roles_operation_to_xml(
role_names, post_shutdown_action),
as_async=True)
|
[
"Shuts",
"down",
"the",
"specified",
"virtual",
"machines",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1758-L1789
|
[
"def",
"shutdown_roles",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_names",
",",
"post_shutdown_action",
"=",
"'Stopped'",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_names'",
",",
"role_names",
")",
"_validate_not_none",
"(",
"'post_shutdown_action'",
",",
"post_shutdown_action",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_roles_operations_path",
"(",
"service_name",
",",
"deployment_name",
")",
",",
"_XmlSerializer",
".",
"shutdown_roles_operation_to_xml",
"(",
"role_names",
",",
"post_shutdown_action",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.add_dns_server
|
Adds a DNS server definition to an existing deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Specifies the name of the DNS server.
address:
Specifies the IP address of the DNS server.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def add_dns_server(self, service_name, deployment_name, dns_server_name, address):
'''
Adds a DNS server definition to an existing deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Specifies the name of the DNS server.
address:
Specifies the IP address of the DNS server.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('dns_server_name', dns_server_name)
_validate_not_none('address', address)
return self._perform_post(
self._get_dns_server_path(service_name, deployment_name),
_XmlSerializer.dns_server_to_xml(dns_server_name, address),
as_async=True)
|
def add_dns_server(self, service_name, deployment_name, dns_server_name, address):
'''
Adds a DNS server definition to an existing deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Specifies the name of the DNS server.
address:
Specifies the IP address of the DNS server.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('dns_server_name', dns_server_name)
_validate_not_none('address', address)
return self._perform_post(
self._get_dns_server_path(service_name, deployment_name),
_XmlSerializer.dns_server_to_xml(dns_server_name, address),
as_async=True)
|
[
"Adds",
"a",
"DNS",
"server",
"definition",
"to",
"an",
"existing",
"deployment",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1791-L1811
|
[
"def",
"add_dns_server",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"dns_server_name",
",",
"address",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'dns_server_name'",
",",
"dns_server_name",
")",
"_validate_not_none",
"(",
"'address'",
",",
"address",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_dns_server_path",
"(",
"service_name",
",",
"deployment_name",
")",
",",
"_XmlSerializer",
".",
"dns_server_to_xml",
"(",
"dns_server_name",
",",
"address",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.update_dns_server
|
Updates the ip address of a DNS server.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Specifies the name of the DNS server.
address:
Specifies the IP address of the DNS server.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def update_dns_server(self, service_name, deployment_name, dns_server_name, address):
'''
Updates the ip address of a DNS server.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Specifies the name of the DNS server.
address:
Specifies the IP address of the DNS server.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('dns_server_name', dns_server_name)
_validate_not_none('address', address)
return self._perform_put(
self._get_dns_server_path(service_name,
deployment_name,
dns_server_name),
_XmlSerializer.dns_server_to_xml(dns_server_name, address),
as_async=True)
|
def update_dns_server(self, service_name, deployment_name, dns_server_name, address):
'''
Updates the ip address of a DNS server.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Specifies the name of the DNS server.
address:
Specifies the IP address of the DNS server.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('dns_server_name', dns_server_name)
_validate_not_none('address', address)
return self._perform_put(
self._get_dns_server_path(service_name,
deployment_name,
dns_server_name),
_XmlSerializer.dns_server_to_xml(dns_server_name, address),
as_async=True)
|
[
"Updates",
"the",
"ip",
"address",
"of",
"a",
"DNS",
"server",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1813-L1835
|
[
"def",
"update_dns_server",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"dns_server_name",
",",
"address",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'dns_server_name'",
",",
"dns_server_name",
")",
"_validate_not_none",
"(",
"'address'",
",",
"address",
")",
"return",
"self",
".",
"_perform_put",
"(",
"self",
".",
"_get_dns_server_path",
"(",
"service_name",
",",
"deployment_name",
",",
"dns_server_name",
")",
",",
"_XmlSerializer",
".",
"dns_server_to_xml",
"(",
"dns_server_name",
",",
"address",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_dns_server
|
Deletes a DNS server from a deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Name of the DNS server that you want to delete.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_dns_server(self, service_name, deployment_name, dns_server_name):
'''
Deletes a DNS server from a deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Name of the DNS server that you want to delete.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('dns_server_name', dns_server_name)
return self._perform_delete(
self._get_dns_server_path(service_name,
deployment_name,
dns_server_name),
as_async=True)
|
def delete_dns_server(self, service_name, deployment_name, dns_server_name):
'''
Deletes a DNS server from a deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Name of the DNS server that you want to delete.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('dns_server_name', dns_server_name)
return self._perform_delete(
self._get_dns_server_path(service_name,
deployment_name,
dns_server_name),
as_async=True)
|
[
"Deletes",
"a",
"DNS",
"server",
"from",
"a",
"deployment",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1837-L1855
|
[
"def",
"delete_dns_server",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"dns_server_name",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'dns_server_name'",
",",
"dns_server_name",
")",
"return",
"self",
".",
"_perform_delete",
"(",
"self",
".",
"_get_dns_server_path",
"(",
"service_name",
",",
"deployment_name",
",",
"dns_server_name",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.list_resource_extension_versions
|
Lists the versions of a resource extension that are available to add
to a Virtual Machine.
publisher_name:
Name of the resource extension publisher.
extension_name:
Name of the resource extension.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def list_resource_extension_versions(self, publisher_name, extension_name):
'''
Lists the versions of a resource extension that are available to add
to a Virtual Machine.
publisher_name:
Name of the resource extension publisher.
extension_name:
Name of the resource extension.
'''
return self._perform_get(self._get_resource_extension_versions_path(
publisher_name, extension_name),
ResourceExtensions)
|
def list_resource_extension_versions(self, publisher_name, extension_name):
'''
Lists the versions of a resource extension that are available to add
to a Virtual Machine.
publisher_name:
Name of the resource extension publisher.
extension_name:
Name of the resource extension.
'''
return self._perform_get(self._get_resource_extension_versions_path(
publisher_name, extension_name),
ResourceExtensions)
|
[
"Lists",
"the",
"versions",
"of",
"a",
"resource",
"extension",
"that",
"are",
"available",
"to",
"add",
"to",
"a",
"Virtual",
"Machine",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1865-L1877
|
[
"def",
"list_resource_extension_versions",
"(",
"self",
",",
"publisher_name",
",",
"extension_name",
")",
":",
"return",
"self",
".",
"_perform_get",
"(",
"self",
".",
"_get_resource_extension_versions_path",
"(",
"publisher_name",
",",
"extension_name",
")",
",",
"ResourceExtensions",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.replicate_vm_image
|
Replicate a VM image to multiple target locations. This operation
is only for publishers. You have to be registered as image publisher
with Microsoft Azure to be able to call this.
vm_image_name:
Specifies the name of the VM Image that is to be used for
replication
regions:
Specified a list of regions to replicate the image to
Note: The regions in the request body are not additive. If a VM
Image has already been replicated to Regions A, B, and C, and
a request is made to replicate to Regions A and D, the VM
Image will remain in Region A, will be replicated in Region D,
and will be unreplicated from Regions B and C
offer:
Specifies the publisher defined name of the offer. The allowed
characters are uppercase or lowercase letters, digit,
hypen(-), period (.).The maximum allowed length is 64 characters.
sku:
Specifies the publisher defined name of the Sku. The allowed
characters are uppercase or lowercase letters, digit,
hypen(-), period (.). The maximum allowed length is 64 characters.
version:
Specifies the publisher defined version of the image.
The allowed characters are digit and period.
Format: <MajorVersion>.<MinorVersion>.<Patch>
Example: '1.0.0' or '1.1.0' The 3 version number to
follow standard of most of the RPs. See http://semver.org
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def replicate_vm_image(self, vm_image_name, regions, offer, sku, version):
'''
Replicate a VM image to multiple target locations. This operation
is only for publishers. You have to be registered as image publisher
with Microsoft Azure to be able to call this.
vm_image_name:
Specifies the name of the VM Image that is to be used for
replication
regions:
Specified a list of regions to replicate the image to
Note: The regions in the request body are not additive. If a VM
Image has already been replicated to Regions A, B, and C, and
a request is made to replicate to Regions A and D, the VM
Image will remain in Region A, will be replicated in Region D,
and will be unreplicated from Regions B and C
offer:
Specifies the publisher defined name of the offer. The allowed
characters are uppercase or lowercase letters, digit,
hypen(-), period (.).The maximum allowed length is 64 characters.
sku:
Specifies the publisher defined name of the Sku. The allowed
characters are uppercase or lowercase letters, digit,
hypen(-), period (.). The maximum allowed length is 64 characters.
version:
Specifies the publisher defined version of the image.
The allowed characters are digit and period.
Format: <MajorVersion>.<MinorVersion>.<Patch>
Example: '1.0.0' or '1.1.0' The 3 version number to
follow standard of most of the RPs. See http://semver.org
'''
_validate_not_none('vm_image_name', vm_image_name)
_validate_not_none('regions', regions)
_validate_not_none('offer', offer)
_validate_not_none('sku', sku)
_validate_not_none('version', version)
return self._perform_put(
self._get_replication_path_using_vm_image_name(vm_image_name),
_XmlSerializer.replicate_image_to_xml(
regions,
offer,
sku,
version
),
as_async=True,
x_ms_version='2015-04-01'
)
|
def replicate_vm_image(self, vm_image_name, regions, offer, sku, version):
'''
Replicate a VM image to multiple target locations. This operation
is only for publishers. You have to be registered as image publisher
with Microsoft Azure to be able to call this.
vm_image_name:
Specifies the name of the VM Image that is to be used for
replication
regions:
Specified a list of regions to replicate the image to
Note: The regions in the request body are not additive. If a VM
Image has already been replicated to Regions A, B, and C, and
a request is made to replicate to Regions A and D, the VM
Image will remain in Region A, will be replicated in Region D,
and will be unreplicated from Regions B and C
offer:
Specifies the publisher defined name of the offer. The allowed
characters are uppercase or lowercase letters, digit,
hypen(-), period (.).The maximum allowed length is 64 characters.
sku:
Specifies the publisher defined name of the Sku. The allowed
characters are uppercase or lowercase letters, digit,
hypen(-), period (.). The maximum allowed length is 64 characters.
version:
Specifies the publisher defined version of the image.
The allowed characters are digit and period.
Format: <MajorVersion>.<MinorVersion>.<Patch>
Example: '1.0.0' or '1.1.0' The 3 version number to
follow standard of most of the RPs. See http://semver.org
'''
_validate_not_none('vm_image_name', vm_image_name)
_validate_not_none('regions', regions)
_validate_not_none('offer', offer)
_validate_not_none('sku', sku)
_validate_not_none('version', version)
return self._perform_put(
self._get_replication_path_using_vm_image_name(vm_image_name),
_XmlSerializer.replicate_image_to_xml(
regions,
offer,
sku,
version
),
as_async=True,
x_ms_version='2015-04-01'
)
|
[
"Replicate",
"a",
"VM",
"image",
"to",
"multiple",
"target",
"locations",
".",
"This",
"operation",
"is",
"only",
"for",
"publishers",
".",
"You",
"have",
"to",
"be",
"registered",
"as",
"image",
"publisher",
"with",
"Microsoft",
"Azure",
"to",
"be",
"able",
"to",
"call",
"this",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1880-L1927
|
[
"def",
"replicate_vm_image",
"(",
"self",
",",
"vm_image_name",
",",
"regions",
",",
"offer",
",",
"sku",
",",
"version",
")",
":",
"_validate_not_none",
"(",
"'vm_image_name'",
",",
"vm_image_name",
")",
"_validate_not_none",
"(",
"'regions'",
",",
"regions",
")",
"_validate_not_none",
"(",
"'offer'",
",",
"offer",
")",
"_validate_not_none",
"(",
"'sku'",
",",
"sku",
")",
"_validate_not_none",
"(",
"'version'",
",",
"version",
")",
"return",
"self",
".",
"_perform_put",
"(",
"self",
".",
"_get_replication_path_using_vm_image_name",
"(",
"vm_image_name",
")",
",",
"_XmlSerializer",
".",
"replicate_image_to_xml",
"(",
"regions",
",",
"offer",
",",
"sku",
",",
"version",
")",
",",
"as_async",
"=",
"True",
",",
"x_ms_version",
"=",
"'2015-04-01'",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.unreplicate_vm_image
|
Unreplicate a VM image from all regions This operation
is only for publishers. You have to be registered as image publisher
with Microsoft Azure to be able to call this
vm_image_name:
Specifies the name of the VM Image that is to be used for
unreplication. The VM Image Name should be the user VM Image,
not the published name of the VM Image.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def unreplicate_vm_image(self, vm_image_name):
'''
Unreplicate a VM image from all regions This operation
is only for publishers. You have to be registered as image publisher
with Microsoft Azure to be able to call this
vm_image_name:
Specifies the name of the VM Image that is to be used for
unreplication. The VM Image Name should be the user VM Image,
not the published name of the VM Image.
'''
_validate_not_none('vm_image_name', vm_image_name)
return self._perform_put(
self._get_unreplication_path_using_vm_image_name(vm_image_name),
None,
as_async=True,
x_ms_version='2015-04-01'
)
|
def unreplicate_vm_image(self, vm_image_name):
'''
Unreplicate a VM image from all regions This operation
is only for publishers. You have to be registered as image publisher
with Microsoft Azure to be able to call this
vm_image_name:
Specifies the name of the VM Image that is to be used for
unreplication. The VM Image Name should be the user VM Image,
not the published name of the VM Image.
'''
_validate_not_none('vm_image_name', vm_image_name)
return self._perform_put(
self._get_unreplication_path_using_vm_image_name(vm_image_name),
None,
as_async=True,
x_ms_version='2015-04-01'
)
|
[
"Unreplicate",
"a",
"VM",
"image",
"from",
"all",
"regions",
"This",
"operation",
"is",
"only",
"for",
"publishers",
".",
"You",
"have",
"to",
"be",
"registered",
"as",
"image",
"publisher",
"with",
"Microsoft",
"Azure",
"to",
"be",
"able",
"to",
"call",
"this"
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1929-L1948
|
[
"def",
"unreplicate_vm_image",
"(",
"self",
",",
"vm_image_name",
")",
":",
"_validate_not_none",
"(",
"'vm_image_name'",
",",
"vm_image_name",
")",
"return",
"self",
".",
"_perform_put",
"(",
"self",
".",
"_get_unreplication_path_using_vm_image_name",
"(",
"vm_image_name",
")",
",",
"None",
",",
"as_async",
"=",
"True",
",",
"x_ms_version",
"=",
"'2015-04-01'",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.share_vm_image
|
Share an already replicated OS image. This operation is only for
publishers. You have to be registered as image publisher with Windows
Azure to be able to call this.
vm_image_name:
The name of the virtual machine image to share
permission:
The sharing permission: public, msdn, or private
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def share_vm_image(self, vm_image_name, permission):
'''
Share an already replicated OS image. This operation is only for
publishers. You have to be registered as image publisher with Windows
Azure to be able to call this.
vm_image_name:
The name of the virtual machine image to share
permission:
The sharing permission: public, msdn, or private
'''
_validate_not_none('vm_image_name', vm_image_name)
_validate_not_none('permission', permission)
path = self._get_sharing_path_using_vm_image_name(vm_image_name)
query = '&permission=' + permission
path = path + '?' + query.lstrip('&')
return self._perform_put(
path, None, as_async=True, x_ms_version='2015-04-01'
)
|
def share_vm_image(self, vm_image_name, permission):
'''
Share an already replicated OS image. This operation is only for
publishers. You have to be registered as image publisher with Windows
Azure to be able to call this.
vm_image_name:
The name of the virtual machine image to share
permission:
The sharing permission: public, msdn, or private
'''
_validate_not_none('vm_image_name', vm_image_name)
_validate_not_none('permission', permission)
path = self._get_sharing_path_using_vm_image_name(vm_image_name)
query = '&permission=' + permission
path = path + '?' + query.lstrip('&')
return self._perform_put(
path, None, as_async=True, x_ms_version='2015-04-01'
)
|
[
"Share",
"an",
"already",
"replicated",
"OS",
"image",
".",
"This",
"operation",
"is",
"only",
"for",
"publishers",
".",
"You",
"have",
"to",
"be",
"registered",
"as",
"image",
"publisher",
"with",
"Windows",
"Azure",
"to",
"be",
"able",
"to",
"call",
"this",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1950-L1970
|
[
"def",
"share_vm_image",
"(",
"self",
",",
"vm_image_name",
",",
"permission",
")",
":",
"_validate_not_none",
"(",
"'vm_image_name'",
",",
"vm_image_name",
")",
"_validate_not_none",
"(",
"'permission'",
",",
"permission",
")",
"path",
"=",
"self",
".",
"_get_sharing_path_using_vm_image_name",
"(",
"vm_image_name",
")",
"query",
"=",
"'&permission='",
"+",
"permission",
"path",
"=",
"path",
"+",
"'?'",
"+",
"query",
".",
"lstrip",
"(",
"'&'",
")",
"return",
"self",
".",
"_perform_put",
"(",
"path",
",",
"None",
",",
"as_async",
"=",
"True",
",",
"x_ms_version",
"=",
"'2015-04-01'",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.capture_vm_image
|
Creates a copy of the operating system virtual hard disk (VHD) and all
of the data VHDs that are associated with the Virtual Machine, saves
the VHD copies in the same storage location as the original VHDs, and
registers the copies as a VM Image in the image repository that is
associated with the specified subscription.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
options:
An instance of CaptureRoleAsVMImage class.
options.os_state:
Required. Specifies the state of the operating system in the image.
Possible values are: Generalized, Specialized
A Virtual Machine that is fully configured and running contains a
Specialized operating system. A Virtual Machine on which the
Sysprep command has been run with the generalize option contains a
Generalized operating system. If you capture an image from a
generalized Virtual Machine, the machine is deleted after the image
is captured. It is recommended that all Virtual Machines are shut
down before capturing an image.
options.vm_image_name:
Required. Specifies the name of the VM Image.
options.vm_image_label:
Required. Specifies the label of the VM Image.
options.description:
Optional. Specifies the description of the VM Image.
options.language:
Optional. Specifies the language of the VM Image.
options.image_family:
Optional. Specifies a value that can be used to group VM Images.
options.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def capture_vm_image(self, service_name, deployment_name, role_name, options):
'''
Creates a copy of the operating system virtual hard disk (VHD) and all
of the data VHDs that are associated with the Virtual Machine, saves
the VHD copies in the same storage location as the original VHDs, and
registers the copies as a VM Image in the image repository that is
associated with the specified subscription.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
options:
An instance of CaptureRoleAsVMImage class.
options.os_state:
Required. Specifies the state of the operating system in the image.
Possible values are: Generalized, Specialized
A Virtual Machine that is fully configured and running contains a
Specialized operating system. A Virtual Machine on which the
Sysprep command has been run with the generalize option contains a
Generalized operating system. If you capture an image from a
generalized Virtual Machine, the machine is deleted after the image
is captured. It is recommended that all Virtual Machines are shut
down before capturing an image.
options.vm_image_name:
Required. Specifies the name of the VM Image.
options.vm_image_label:
Required. Specifies the label of the VM Image.
options.description:
Optional. Specifies the description of the VM Image.
options.language:
Optional. Specifies the language of the VM Image.
options.image_family:
Optional. Specifies a value that can be used to group VM Images.
options.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
_validate_not_none('options', options)
_validate_not_none('options.os_state', options.os_state)
_validate_not_none('options.vm_image_name', options.vm_image_name)
_validate_not_none('options.vm_image_label', options.vm_image_label)
return self._perform_post(
self._get_capture_vm_image_path(service_name, deployment_name, role_name),
_XmlSerializer.capture_vm_image_to_xml(options),
as_async=True)
|
def capture_vm_image(self, service_name, deployment_name, role_name, options):
'''
Creates a copy of the operating system virtual hard disk (VHD) and all
of the data VHDs that are associated with the Virtual Machine, saves
the VHD copies in the same storage location as the original VHDs, and
registers the copies as a VM Image in the image repository that is
associated with the specified subscription.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
options:
An instance of CaptureRoleAsVMImage class.
options.os_state:
Required. Specifies the state of the operating system in the image.
Possible values are: Generalized, Specialized
A Virtual Machine that is fully configured and running contains a
Specialized operating system. A Virtual Machine on which the
Sysprep command has been run with the generalize option contains a
Generalized operating system. If you capture an image from a
generalized Virtual Machine, the machine is deleted after the image
is captured. It is recommended that all Virtual Machines are shut
down before capturing an image.
options.vm_image_name:
Required. Specifies the name of the VM Image.
options.vm_image_label:
Required. Specifies the label of the VM Image.
options.description:
Optional. Specifies the description of the VM Image.
options.language:
Optional. Specifies the language of the VM Image.
options.image_family:
Optional. Specifies a value that can be used to group VM Images.
options.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
_validate_not_none('role_name', role_name)
_validate_not_none('options', options)
_validate_not_none('options.os_state', options.os_state)
_validate_not_none('options.vm_image_name', options.vm_image_name)
_validate_not_none('options.vm_image_label', options.vm_image_label)
return self._perform_post(
self._get_capture_vm_image_path(service_name, deployment_name, role_name),
_XmlSerializer.capture_vm_image_to_xml(options),
as_async=True)
|
[
"Creates",
"a",
"copy",
"of",
"the",
"operating",
"system",
"virtual",
"hard",
"disk",
"(",
"VHD",
")",
"and",
"all",
"of",
"the",
"data",
"VHDs",
"that",
"are",
"associated",
"with",
"the",
"Virtual",
"Machine",
"saves",
"the",
"VHD",
"copies",
"in",
"the",
"same",
"storage",
"location",
"as",
"the",
"original",
"VHDs",
"and",
"registers",
"the",
"copies",
"as",
"a",
"VM",
"Image",
"in",
"the",
"image",
"repository",
"that",
"is",
"associated",
"with",
"the",
"specified",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L1972-L2022
|
[
"def",
"capture_vm_image",
"(",
"self",
",",
"service_name",
",",
"deployment_name",
",",
"role_name",
",",
"options",
")",
":",
"_validate_not_none",
"(",
"'service_name'",
",",
"service_name",
")",
"_validate_not_none",
"(",
"'deployment_name'",
",",
"deployment_name",
")",
"_validate_not_none",
"(",
"'role_name'",
",",
"role_name",
")",
"_validate_not_none",
"(",
"'options'",
",",
"options",
")",
"_validate_not_none",
"(",
"'options.os_state'",
",",
"options",
".",
"os_state",
")",
"_validate_not_none",
"(",
"'options.vm_image_name'",
",",
"options",
".",
"vm_image_name",
")",
"_validate_not_none",
"(",
"'options.vm_image_label'",
",",
"options",
".",
"vm_image_label",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_capture_vm_image_path",
"(",
"service_name",
",",
"deployment_name",
",",
"role_name",
")",
",",
"_XmlSerializer",
".",
"capture_vm_image_to_xml",
"(",
"options",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.create_vm_image
|
Creates a VM Image in the image repository that is associated with the
specified subscription using a specified set of virtual hard disks.
vm_image:
An instance of VMImage class.
vm_image.name: Required. Specifies the name of the image.
vm_image.label: Required. Specifies an identifier for the image.
vm_image.description: Optional. Specifies the description of the image.
vm_image.os_disk_configuration:
Required. Specifies configuration information for the operating
system disk that is associated with the image.
vm_image.os_disk_configuration.host_caching:
Optional. Specifies the caching behavior of the operating system disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.os_disk_configuration.os_state:
Required. Specifies the state of the operating system in the image.
Possible values are: Generalized, Specialized
A Virtual Machine that is fully configured and running contains a
Specialized operating system. A Virtual Machine on which the
Sysprep command has been run with the generalize option contains a
Generalized operating system.
vm_image.os_disk_configuration.os:
Required. Specifies the operating system type of the image.
vm_image.os_disk_configuration.media_link:
Required. Specifies the location of the blob in Windows Azure
storage. The blob location belongs to a storage account in the
subscription specified by the <subscription-id> value in the
operation call.
vm_image.data_disk_configurations:
Optional. Specifies configuration information for the data disks
that are associated with the image. A VM Image might not have data
disks associated with it.
vm_image.data_disk_configurations[].host_caching:
Optional. Specifies the caching behavior of the data disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations[].lun:
Optional if the lun for the disk is 0. Specifies the Logical Unit
Number (LUN) for the data disk.
vm_image.data_disk_configurations[].media_link:
Required. Specifies the location of the blob in Windows Azure
storage. The blob location belongs to a storage account in the
subscription specified by the <subscription-id> value in the
operation call.
vm_image.data_disk_configurations[].logical_size_in_gb:
Required. Specifies the size, in GB, of the data disk.
vm_image.language: Optional. Specifies the language of the image.
vm_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
vm_image.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
vm_image.eula:
Optional. Specifies the End User License Agreement that is
associated with the image. The value for this element is a string,
but it is recommended that the value be a URL that points to a EULA.
vm_image.icon_uri:
Optional. Specifies the URI to the icon that is displayed for the
image in the Management Portal.
vm_image.small_icon_uri:
Optional. Specifies the URI to the small icon that is displayed for
the image in the Management Portal.
vm_image.privacy_uri:
Optional. Specifies the URI that points to a document that contains
the privacy policy related to the image.
vm_image.published_date:
Optional. Specifies the date when the image was added to the image
repository.
vm_image.show_in_gui:
Optional. Indicates whether the VM Images should be listed in the
portal.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def create_vm_image(self, vm_image):
'''
Creates a VM Image in the image repository that is associated with the
specified subscription using a specified set of virtual hard disks.
vm_image:
An instance of VMImage class.
vm_image.name: Required. Specifies the name of the image.
vm_image.label: Required. Specifies an identifier for the image.
vm_image.description: Optional. Specifies the description of the image.
vm_image.os_disk_configuration:
Required. Specifies configuration information for the operating
system disk that is associated with the image.
vm_image.os_disk_configuration.host_caching:
Optional. Specifies the caching behavior of the operating system disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.os_disk_configuration.os_state:
Required. Specifies the state of the operating system in the image.
Possible values are: Generalized, Specialized
A Virtual Machine that is fully configured and running contains a
Specialized operating system. A Virtual Machine on which the
Sysprep command has been run with the generalize option contains a
Generalized operating system.
vm_image.os_disk_configuration.os:
Required. Specifies the operating system type of the image.
vm_image.os_disk_configuration.media_link:
Required. Specifies the location of the blob in Windows Azure
storage. The blob location belongs to a storage account in the
subscription specified by the <subscription-id> value in the
operation call.
vm_image.data_disk_configurations:
Optional. Specifies configuration information for the data disks
that are associated with the image. A VM Image might not have data
disks associated with it.
vm_image.data_disk_configurations[].host_caching:
Optional. Specifies the caching behavior of the data disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations[].lun:
Optional if the lun for the disk is 0. Specifies the Logical Unit
Number (LUN) for the data disk.
vm_image.data_disk_configurations[].media_link:
Required. Specifies the location of the blob in Windows Azure
storage. The blob location belongs to a storage account in the
subscription specified by the <subscription-id> value in the
operation call.
vm_image.data_disk_configurations[].logical_size_in_gb:
Required. Specifies the size, in GB, of the data disk.
vm_image.language: Optional. Specifies the language of the image.
vm_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
vm_image.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
vm_image.eula:
Optional. Specifies the End User License Agreement that is
associated with the image. The value for this element is a string,
but it is recommended that the value be a URL that points to a EULA.
vm_image.icon_uri:
Optional. Specifies the URI to the icon that is displayed for the
image in the Management Portal.
vm_image.small_icon_uri:
Optional. Specifies the URI to the small icon that is displayed for
the image in the Management Portal.
vm_image.privacy_uri:
Optional. Specifies the URI that points to a document that contains
the privacy policy related to the image.
vm_image.published_date:
Optional. Specifies the date when the image was added to the image
repository.
vm_image.show_in_gui:
Optional. Indicates whether the VM Images should be listed in the
portal.
'''
_validate_not_none('vm_image', vm_image)
_validate_not_none('vm_image.name', vm_image.name)
_validate_not_none('vm_image.label', vm_image.label)
_validate_not_none('vm_image.os_disk_configuration.os_state',
vm_image.os_disk_configuration.os_state)
_validate_not_none('vm_image.os_disk_configuration.os',
vm_image.os_disk_configuration.os)
_validate_not_none('vm_image.os_disk_configuration.media_link',
vm_image.os_disk_configuration.media_link)
return self._perform_post(
self._get_vm_image_path(),
_XmlSerializer.create_vm_image_to_xml(vm_image),
as_async=True)
|
def create_vm_image(self, vm_image):
'''
Creates a VM Image in the image repository that is associated with the
specified subscription using a specified set of virtual hard disks.
vm_image:
An instance of VMImage class.
vm_image.name: Required. Specifies the name of the image.
vm_image.label: Required. Specifies an identifier for the image.
vm_image.description: Optional. Specifies the description of the image.
vm_image.os_disk_configuration:
Required. Specifies configuration information for the operating
system disk that is associated with the image.
vm_image.os_disk_configuration.host_caching:
Optional. Specifies the caching behavior of the operating system disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.os_disk_configuration.os_state:
Required. Specifies the state of the operating system in the image.
Possible values are: Generalized, Specialized
A Virtual Machine that is fully configured and running contains a
Specialized operating system. A Virtual Machine on which the
Sysprep command has been run with the generalize option contains a
Generalized operating system.
vm_image.os_disk_configuration.os:
Required. Specifies the operating system type of the image.
vm_image.os_disk_configuration.media_link:
Required. Specifies the location of the blob in Windows Azure
storage. The blob location belongs to a storage account in the
subscription specified by the <subscription-id> value in the
operation call.
vm_image.data_disk_configurations:
Optional. Specifies configuration information for the data disks
that are associated with the image. A VM Image might not have data
disks associated with it.
vm_image.data_disk_configurations[].host_caching:
Optional. Specifies the caching behavior of the data disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations[].lun:
Optional if the lun for the disk is 0. Specifies the Logical Unit
Number (LUN) for the data disk.
vm_image.data_disk_configurations[].media_link:
Required. Specifies the location of the blob in Windows Azure
storage. The blob location belongs to a storage account in the
subscription specified by the <subscription-id> value in the
operation call.
vm_image.data_disk_configurations[].logical_size_in_gb:
Required. Specifies the size, in GB, of the data disk.
vm_image.language: Optional. Specifies the language of the image.
vm_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
vm_image.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
vm_image.eula:
Optional. Specifies the End User License Agreement that is
associated with the image. The value for this element is a string,
but it is recommended that the value be a URL that points to a EULA.
vm_image.icon_uri:
Optional. Specifies the URI to the icon that is displayed for the
image in the Management Portal.
vm_image.small_icon_uri:
Optional. Specifies the URI to the small icon that is displayed for
the image in the Management Portal.
vm_image.privacy_uri:
Optional. Specifies the URI that points to a document that contains
the privacy policy related to the image.
vm_image.published_date:
Optional. Specifies the date when the image was added to the image
repository.
vm_image.show_in_gui:
Optional. Indicates whether the VM Images should be listed in the
portal.
'''
_validate_not_none('vm_image', vm_image)
_validate_not_none('vm_image.name', vm_image.name)
_validate_not_none('vm_image.label', vm_image.label)
_validate_not_none('vm_image.os_disk_configuration.os_state',
vm_image.os_disk_configuration.os_state)
_validate_not_none('vm_image.os_disk_configuration.os',
vm_image.os_disk_configuration.os)
_validate_not_none('vm_image.os_disk_configuration.media_link',
vm_image.os_disk_configuration.media_link)
return self._perform_post(
self._get_vm_image_path(),
_XmlSerializer.create_vm_image_to_xml(vm_image),
as_async=True)
|
[
"Creates",
"a",
"VM",
"Image",
"in",
"the",
"image",
"repository",
"that",
"is",
"associated",
"with",
"the",
"specified",
"subscription",
"using",
"a",
"specified",
"set",
"of",
"virtual",
"hard",
"disks",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L2024-L2109
|
[
"def",
"create_vm_image",
"(",
"self",
",",
"vm_image",
")",
":",
"_validate_not_none",
"(",
"'vm_image'",
",",
"vm_image",
")",
"_validate_not_none",
"(",
"'vm_image.name'",
",",
"vm_image",
".",
"name",
")",
"_validate_not_none",
"(",
"'vm_image.label'",
",",
"vm_image",
".",
"label",
")",
"_validate_not_none",
"(",
"'vm_image.os_disk_configuration.os_state'",
",",
"vm_image",
".",
"os_disk_configuration",
".",
"os_state",
")",
"_validate_not_none",
"(",
"'vm_image.os_disk_configuration.os'",
",",
"vm_image",
".",
"os_disk_configuration",
".",
"os",
")",
"_validate_not_none",
"(",
"'vm_image.os_disk_configuration.media_link'",
",",
"vm_image",
".",
"os_disk_configuration",
".",
"media_link",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_vm_image_path",
"(",
")",
",",
"_XmlSerializer",
".",
"create_vm_image_to_xml",
"(",
"vm_image",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.delete_vm_image
|
Deletes the specified VM Image from the image repository that is
associated with the specified subscription.
vm_image_name:
The name of the image.
delete_vhd:
Deletes the underlying vhd blob in Azure storage.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def delete_vm_image(self, vm_image_name, delete_vhd=False):
'''
Deletes the specified VM Image from the image repository that is
associated with the specified subscription.
vm_image_name:
The name of the image.
delete_vhd:
Deletes the underlying vhd blob in Azure storage.
'''
_validate_not_none('vm_image_name', vm_image_name)
path = self._get_vm_image_path(vm_image_name)
if delete_vhd:
path += '?comp=media'
return self._perform_delete(path, as_async=True)
|
def delete_vm_image(self, vm_image_name, delete_vhd=False):
'''
Deletes the specified VM Image from the image repository that is
associated with the specified subscription.
vm_image_name:
The name of the image.
delete_vhd:
Deletes the underlying vhd blob in Azure storage.
'''
_validate_not_none('vm_image_name', vm_image_name)
path = self._get_vm_image_path(vm_image_name)
if delete_vhd:
path += '?comp=media'
return self._perform_delete(path, as_async=True)
|
[
"Deletes",
"the",
"specified",
"VM",
"Image",
"from",
"the",
"image",
"repository",
"that",
"is",
"associated",
"with",
"the",
"specified",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L2111-L2125
|
[
"def",
"delete_vm_image",
"(",
"self",
",",
"vm_image_name",
",",
"delete_vhd",
"=",
"False",
")",
":",
"_validate_not_none",
"(",
"'vm_image_name'",
",",
"vm_image_name",
")",
"path",
"=",
"self",
".",
"_get_vm_image_path",
"(",
"vm_image_name",
")",
"if",
"delete_vhd",
":",
"path",
"+=",
"'?comp=media'",
"return",
"self",
".",
"_perform_delete",
"(",
"path",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.list_vm_images
|
Retrieves a list of the VM Images from the image repository that is
associated with the specified subscription.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def list_vm_images(self, location=None, publisher=None, category=None):
'''
Retrieves a list of the VM Images from the image repository that is
associated with the specified subscription.
'''
path = self._get_vm_image_path()
query = ''
if location:
query += '&location=' + location
if publisher:
query += '&publisher=' + publisher
if category:
query += '&category=' + category
if query:
path = path + '?' + query.lstrip('&')
return self._perform_get(path, VMImages)
|
def list_vm_images(self, location=None, publisher=None, category=None):
'''
Retrieves a list of the VM Images from the image repository that is
associated with the specified subscription.
'''
path = self._get_vm_image_path()
query = ''
if location:
query += '&location=' + location
if publisher:
query += '&publisher=' + publisher
if category:
query += '&category=' + category
if query:
path = path + '?' + query.lstrip('&')
return self._perform_get(path, VMImages)
|
[
"Retrieves",
"a",
"list",
"of",
"the",
"VM",
"Images",
"from",
"the",
"image",
"repository",
"that",
"is",
"associated",
"with",
"the",
"specified",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L2127-L2142
|
[
"def",
"list_vm_images",
"(",
"self",
",",
"location",
"=",
"None",
",",
"publisher",
"=",
"None",
",",
"category",
"=",
"None",
")",
":",
"path",
"=",
"self",
".",
"_get_vm_image_path",
"(",
")",
"query",
"=",
"''",
"if",
"location",
":",
"query",
"+=",
"'&location='",
"+",
"location",
"if",
"publisher",
":",
"query",
"+=",
"'&publisher='",
"+",
"publisher",
"if",
"category",
":",
"query",
"+=",
"'&category='",
"+",
"category",
"if",
"query",
":",
"path",
"=",
"path",
"+",
"'?'",
"+",
"query",
".",
"lstrip",
"(",
"'&'",
")",
"return",
"self",
".",
"_perform_get",
"(",
"path",
",",
"VMImages",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.update_vm_image
|
Updates a VM Image in the image repository that is associated with the
specified subscription.
vm_image_name:
Name of image to update.
vm_image:
An instance of VMImage class.
vm_image.label: Optional. Specifies an identifier for the image.
vm_image.os_disk_configuration:
Required. Specifies configuration information for the operating
system disk that is associated with the image.
vm_image.os_disk_configuration.host_caching:
Optional. Specifies the caching behavior of the operating system disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations:
Optional. Specifies configuration information for the data disks
that are associated with the image. A VM Image might not have data
disks associated with it.
vm_image.data_disk_configurations[].name:
Required. Specifies the name of the data disk.
vm_image.data_disk_configurations[].host_caching:
Optional. Specifies the caching behavior of the data disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations[].lun:
Optional if the lun for the disk is 0. Specifies the Logical Unit
Number (LUN) for the data disk.
vm_image.description: Optional. Specifies the description of the image.
vm_image.language: Optional. Specifies the language of the image.
vm_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
vm_image.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
vm_image.eula:
Optional. Specifies the End User License Agreement that is
associated with the image. The value for this element is a string,
but it is recommended that the value be a URL that points to a EULA.
vm_image.icon_uri:
Optional. Specifies the URI to the icon that is displayed for the
image in the Management Portal.
vm_image.small_icon_uri:
Optional. Specifies the URI to the small icon that is displayed for
the image in the Management Portal.
vm_image.privacy_uri:
Optional. Specifies the URI that points to a document that contains
the privacy policy related to the image.
vm_image.published_date:
Optional. Specifies the date when the image was added to the image
repository.
vm_image.show_in_gui:
Optional. Indicates whether the VM Images should be listed in the
portal.
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def update_vm_image(self, vm_image_name, vm_image):
'''
Updates a VM Image in the image repository that is associated with the
specified subscription.
vm_image_name:
Name of image to update.
vm_image:
An instance of VMImage class.
vm_image.label: Optional. Specifies an identifier for the image.
vm_image.os_disk_configuration:
Required. Specifies configuration information for the operating
system disk that is associated with the image.
vm_image.os_disk_configuration.host_caching:
Optional. Specifies the caching behavior of the operating system disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations:
Optional. Specifies configuration information for the data disks
that are associated with the image. A VM Image might not have data
disks associated with it.
vm_image.data_disk_configurations[].name:
Required. Specifies the name of the data disk.
vm_image.data_disk_configurations[].host_caching:
Optional. Specifies the caching behavior of the data disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations[].lun:
Optional if the lun for the disk is 0. Specifies the Logical Unit
Number (LUN) for the data disk.
vm_image.description: Optional. Specifies the description of the image.
vm_image.language: Optional. Specifies the language of the image.
vm_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
vm_image.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
vm_image.eula:
Optional. Specifies the End User License Agreement that is
associated with the image. The value for this element is a string,
but it is recommended that the value be a URL that points to a EULA.
vm_image.icon_uri:
Optional. Specifies the URI to the icon that is displayed for the
image in the Management Portal.
vm_image.small_icon_uri:
Optional. Specifies the URI to the small icon that is displayed for
the image in the Management Portal.
vm_image.privacy_uri:
Optional. Specifies the URI that points to a document that contains
the privacy policy related to the image.
vm_image.published_date:
Optional. Specifies the date when the image was added to the image
repository.
vm_image.show_in_gui:
Optional. Indicates whether the VM Images should be listed in the
portal.
'''
_validate_not_none('vm_image_name', vm_image_name)
_validate_not_none('vm_image', vm_image)
return self._perform_put(self._get_vm_image_path(vm_image_name),
_XmlSerializer.update_vm_image_to_xml(vm_image),
as_async=True)
|
def update_vm_image(self, vm_image_name, vm_image):
'''
Updates a VM Image in the image repository that is associated with the
specified subscription.
vm_image_name:
Name of image to update.
vm_image:
An instance of VMImage class.
vm_image.label: Optional. Specifies an identifier for the image.
vm_image.os_disk_configuration:
Required. Specifies configuration information for the operating
system disk that is associated with the image.
vm_image.os_disk_configuration.host_caching:
Optional. Specifies the caching behavior of the operating system disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations:
Optional. Specifies configuration information for the data disks
that are associated with the image. A VM Image might not have data
disks associated with it.
vm_image.data_disk_configurations[].name:
Required. Specifies the name of the data disk.
vm_image.data_disk_configurations[].host_caching:
Optional. Specifies the caching behavior of the data disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations[].lun:
Optional if the lun for the disk is 0. Specifies the Logical Unit
Number (LUN) for the data disk.
vm_image.description: Optional. Specifies the description of the image.
vm_image.language: Optional. Specifies the language of the image.
vm_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
vm_image.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
vm_image.eula:
Optional. Specifies the End User License Agreement that is
associated with the image. The value for this element is a string,
but it is recommended that the value be a URL that points to a EULA.
vm_image.icon_uri:
Optional. Specifies the URI to the icon that is displayed for the
image in the Management Portal.
vm_image.small_icon_uri:
Optional. Specifies the URI to the small icon that is displayed for
the image in the Management Portal.
vm_image.privacy_uri:
Optional. Specifies the URI that points to a document that contains
the privacy policy related to the image.
vm_image.published_date:
Optional. Specifies the date when the image was added to the image
repository.
vm_image.show_in_gui:
Optional. Indicates whether the VM Images should be listed in the
portal.
'''
_validate_not_none('vm_image_name', vm_image_name)
_validate_not_none('vm_image', vm_image)
return self._perform_put(self._get_vm_image_path(vm_image_name),
_XmlSerializer.update_vm_image_to_xml(vm_image),
as_async=True)
|
[
"Updates",
"a",
"VM",
"Image",
"in",
"the",
"image",
"repository",
"that",
"is",
"associated",
"with",
"the",
"specified",
"subscription",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L2144-L2203
|
[
"def",
"update_vm_image",
"(",
"self",
",",
"vm_image_name",
",",
"vm_image",
")",
":",
"_validate_not_none",
"(",
"'vm_image_name'",
",",
"vm_image_name",
")",
"_validate_not_none",
"(",
"'vm_image'",
",",
"vm_image",
")",
"return",
"self",
".",
"_perform_put",
"(",
"self",
".",
"_get_vm_image_path",
"(",
"vm_image_name",
")",
",",
"_XmlSerializer",
".",
"update_vm_image_to_xml",
"(",
"vm_image",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.add_os_image
|
Adds an OS image that is currently stored in a storage account in your
subscription to the image repository.
label:
Specifies the friendly name of the image.
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the image is located. The blob location must
belong to a storage account in the subscription specified by the
<subscription-id> value in the operation call. Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
name:
Specifies a name for the OS image that Windows Azure uses to
identify the image when creating one or more virtual machines.
os:
The operating system type of the OS image. Possible values are:
Linux, Windows
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def add_os_image(self, label, media_link, name, os):
'''
Adds an OS image that is currently stored in a storage account in your
subscription to the image repository.
label:
Specifies the friendly name of the image.
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the image is located. The blob location must
belong to a storage account in the subscription specified by the
<subscription-id> value in the operation call. Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
name:
Specifies a name for the OS image that Windows Azure uses to
identify the image when creating one or more virtual machines.
os:
The operating system type of the OS image. Possible values are:
Linux, Windows
'''
_validate_not_none('label', label)
_validate_not_none('media_link', media_link)
_validate_not_none('name', name)
_validate_not_none('os', os)
return self._perform_post(self._get_image_path(),
_XmlSerializer.os_image_to_xml(
label, media_link, name, os),
as_async=True)
|
def add_os_image(self, label, media_link, name, os):
'''
Adds an OS image that is currently stored in a storage account in your
subscription to the image repository.
label:
Specifies the friendly name of the image.
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the image is located. The blob location must
belong to a storage account in the subscription specified by the
<subscription-id> value in the operation call. Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
name:
Specifies a name for the OS image that Windows Azure uses to
identify the image when creating one or more virtual machines.
os:
The operating system type of the OS image. Possible values are:
Linux, Windows
'''
_validate_not_none('label', label)
_validate_not_none('media_link', media_link)
_validate_not_none('name', name)
_validate_not_none('os', os)
return self._perform_post(self._get_image_path(),
_XmlSerializer.os_image_to_xml(
label, media_link, name, os),
as_async=True)
|
[
"Adds",
"an",
"OS",
"image",
"that",
"is",
"currently",
"stored",
"in",
"a",
"storage",
"account",
"in",
"your",
"subscription",
"to",
"the",
"image",
"repository",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L2228-L2255
|
[
"def",
"add_os_image",
"(",
"self",
",",
"label",
",",
"media_link",
",",
"name",
",",
"os",
")",
":",
"_validate_not_none",
"(",
"'label'",
",",
"label",
")",
"_validate_not_none",
"(",
"'media_link'",
",",
"media_link",
")",
"_validate_not_none",
"(",
"'name'",
",",
"name",
")",
"_validate_not_none",
"(",
"'os'",
",",
"os",
")",
"return",
"self",
".",
"_perform_post",
"(",
"self",
".",
"_get_image_path",
"(",
")",
",",
"_XmlSerializer",
".",
"os_image_to_xml",
"(",
"label",
",",
"media_link",
",",
"name",
",",
"os",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.update_os_image
|
Updates an OS image that in your image repository.
image_name:
The name of the image to update.
label:
Specifies the friendly name of the image to be updated. You cannot
use this operation to update images provided by the Windows Azure
platform.
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the image is located. The blob location must
belong to a storage account in the subscription specified by the
<subscription-id> value in the operation call. Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
name:
Specifies a name for the OS image that Windows Azure uses to
identify the image when creating one or more VM Roles.
os:
The operating system type of the OS image. Possible values are:
Linux, Windows
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def update_os_image(self, image_name, label, media_link, name, os):
'''
Updates an OS image that in your image repository.
image_name:
The name of the image to update.
label:
Specifies the friendly name of the image to be updated. You cannot
use this operation to update images provided by the Windows Azure
platform.
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the image is located. The blob location must
belong to a storage account in the subscription specified by the
<subscription-id> value in the operation call. Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
name:
Specifies a name for the OS image that Windows Azure uses to
identify the image when creating one or more VM Roles.
os:
The operating system type of the OS image. Possible values are:
Linux, Windows
'''
_validate_not_none('image_name', image_name)
_validate_not_none('label', label)
_validate_not_none('media_link', media_link)
_validate_not_none('name', name)
_validate_not_none('os', os)
return self._perform_put(self._get_image_path(image_name),
_XmlSerializer.os_image_to_xml(
label, media_link, name, os),
as_async=True)
|
def update_os_image(self, image_name, label, media_link, name, os):
'''
Updates an OS image that in your image repository.
image_name:
The name of the image to update.
label:
Specifies the friendly name of the image to be updated. You cannot
use this operation to update images provided by the Windows Azure
platform.
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the image is located. The blob location must
belong to a storage account in the subscription specified by the
<subscription-id> value in the operation call. Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
name:
Specifies a name for the OS image that Windows Azure uses to
identify the image when creating one or more VM Roles.
os:
The operating system type of the OS image. Possible values are:
Linux, Windows
'''
_validate_not_none('image_name', image_name)
_validate_not_none('label', label)
_validate_not_none('media_link', media_link)
_validate_not_none('name', name)
_validate_not_none('os', os)
return self._perform_put(self._get_image_path(image_name),
_XmlSerializer.os_image_to_xml(
label, media_link, name, os),
as_async=True)
|
[
"Updates",
"an",
"OS",
"image",
"that",
"in",
"your",
"image",
"repository",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L2257-L2288
|
[
"def",
"update_os_image",
"(",
"self",
",",
"image_name",
",",
"label",
",",
"media_link",
",",
"name",
",",
"os",
")",
":",
"_validate_not_none",
"(",
"'image_name'",
",",
"image_name",
")",
"_validate_not_none",
"(",
"'label'",
",",
"label",
")",
"_validate_not_none",
"(",
"'media_link'",
",",
"media_link",
")",
"_validate_not_none",
"(",
"'name'",
",",
"name",
")",
"_validate_not_none",
"(",
"'os'",
",",
"os",
")",
"return",
"self",
".",
"_perform_put",
"(",
"self",
".",
"_get_image_path",
"(",
"image_name",
")",
",",
"_XmlSerializer",
".",
"os_image_to_xml",
"(",
"label",
",",
"media_link",
",",
"name",
",",
"os",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
test
|
ServiceManagementService.update_os_image_from_image_reference
|
Updates metadata elements from a given OS image reference.
image_name:
The name of the image to update.
os_image:
An instance of OSImage class.
os_image.label: Optional. Specifies an identifier for the image.
os_image.description: Optional. Specifies the description of the image.
os_image.language: Optional. Specifies the language of the image.
os_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
os_image.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
os_image.eula:
Optional. Specifies the End User License Agreement that is
associated with the image. The value for this element is a string,
but it is recommended that the value be a URL that points to a EULA.
os_image.icon_uri:
Optional. Specifies the URI to the icon that is displayed for the
image in the Management Portal.
os_image.small_icon_uri:
Optional. Specifies the URI to the small icon that is displayed for
the image in the Management Portal.
os_image.privacy_uri:
Optional. Specifies the URI that points to a document that contains
the privacy policy related to the image.
os_image.published_date:
Optional. Specifies the date when the image was added to the image
repository.
os.image.media_link:
Required: Specifies the location of the blob in Windows Azure
blob store where the media for the image is located. The blob
location must belong to a storage account in the subscription
specified by the <subscription-id> value in the operation call.
Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
os_image.name:
Specifies a name for the OS image that Windows Azure uses to
identify the image when creating one or more VM Roles.
os_image.os:
The operating system type of the OS image. Possible values are:
Linux, Windows
|
azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py
|
def update_os_image_from_image_reference(self, image_name, os_image):
'''
Updates metadata elements from a given OS image reference.
image_name:
The name of the image to update.
os_image:
An instance of OSImage class.
os_image.label: Optional. Specifies an identifier for the image.
os_image.description: Optional. Specifies the description of the image.
os_image.language: Optional. Specifies the language of the image.
os_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
os_image.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
os_image.eula:
Optional. Specifies the End User License Agreement that is
associated with the image. The value for this element is a string,
but it is recommended that the value be a URL that points to a EULA.
os_image.icon_uri:
Optional. Specifies the URI to the icon that is displayed for the
image in the Management Portal.
os_image.small_icon_uri:
Optional. Specifies the URI to the small icon that is displayed for
the image in the Management Portal.
os_image.privacy_uri:
Optional. Specifies the URI that points to a document that contains
the privacy policy related to the image.
os_image.published_date:
Optional. Specifies the date when the image was added to the image
repository.
os.image.media_link:
Required: Specifies the location of the blob in Windows Azure
blob store where the media for the image is located. The blob
location must belong to a storage account in the subscription
specified by the <subscription-id> value in the operation call.
Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
os_image.name:
Specifies a name for the OS image that Windows Azure uses to
identify the image when creating one or more VM Roles.
os_image.os:
The operating system type of the OS image. Possible values are:
Linux, Windows
'''
_validate_not_none('image_name', image_name)
_validate_not_none('os_image', os_image)
return self._perform_put(self._get_image_path(image_name),
_XmlSerializer.update_os_image_to_xml(os_image), as_async=True
)
|
def update_os_image_from_image_reference(self, image_name, os_image):
'''
Updates metadata elements from a given OS image reference.
image_name:
The name of the image to update.
os_image:
An instance of OSImage class.
os_image.label: Optional. Specifies an identifier for the image.
os_image.description: Optional. Specifies the description of the image.
os_image.language: Optional. Specifies the language of the image.
os_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
os_image.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
os_image.eula:
Optional. Specifies the End User License Agreement that is
associated with the image. The value for this element is a string,
but it is recommended that the value be a URL that points to a EULA.
os_image.icon_uri:
Optional. Specifies the URI to the icon that is displayed for the
image in the Management Portal.
os_image.small_icon_uri:
Optional. Specifies the URI to the small icon that is displayed for
the image in the Management Portal.
os_image.privacy_uri:
Optional. Specifies the URI that points to a document that contains
the privacy policy related to the image.
os_image.published_date:
Optional. Specifies the date when the image was added to the image
repository.
os.image.media_link:
Required: Specifies the location of the blob in Windows Azure
blob store where the media for the image is located. The blob
location must belong to a storage account in the subscription
specified by the <subscription-id> value in the operation call.
Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
os_image.name:
Specifies a name for the OS image that Windows Azure uses to
identify the image when creating one or more VM Roles.
os_image.os:
The operating system type of the OS image. Possible values are:
Linux, Windows
'''
_validate_not_none('image_name', image_name)
_validate_not_none('os_image', os_image)
return self._perform_put(self._get_image_path(image_name),
_XmlSerializer.update_os_image_to_xml(os_image), as_async=True
)
|
[
"Updates",
"metadata",
"elements",
"from",
"a",
"given",
"OS",
"image",
"reference",
"."
] |
Azure/azure-sdk-for-python
|
python
|
https://github.com/Azure/azure-sdk-for-python/blob/d7306fde32f60a293a7567678692bdad31e4b667/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementservice.py#L2290-L2340
|
[
"def",
"update_os_image_from_image_reference",
"(",
"self",
",",
"image_name",
",",
"os_image",
")",
":",
"_validate_not_none",
"(",
"'image_name'",
",",
"image_name",
")",
"_validate_not_none",
"(",
"'os_image'",
",",
"os_image",
")",
"return",
"self",
".",
"_perform_put",
"(",
"self",
".",
"_get_image_path",
"(",
"image_name",
")",
",",
"_XmlSerializer",
".",
"update_os_image_to_xml",
"(",
"os_image",
")",
",",
"as_async",
"=",
"True",
")"
] |
d7306fde32f60a293a7567678692bdad31e4b667
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.