Partager via


NodeInfo Class

Information about a node in Service Fabric cluster.

Constructor

NodeInfo(*, name: str = None, ip_address_or_fqdn: str = None, type: str = None, code_version: str = None, config_version: str = None, node_status=None, node_up_time_in_seconds: str = None, health_state=None, is_seed_node: bool = None, upgrade_domain: str = None, fault_domain: str = None, id=None, instance_id: str = None, node_deactivation_info=None, is_stopped: bool = None, node_down_time_in_seconds: str = None, node_up_at=None, node_down_at=None, node_tags=None, is_node_by_node_upgrade_in_progress: bool = None, infrastructure_placement_id: str = None, **kwargs)

Parameters

Name Description
name
Required
str

The name of a Service Fabric node.

ip_address_or_fqdn
Required
str

The IP address or fully qualified domain name of the node.

type
Required
str

The type of the node.

code_version
Required
str

The version of Service Fabric binaries that the node is running.

config_version
Required
str

The version of Service Fabric cluster manifest that the node is using.

node_status
Required

The status of the node. Possible values include: 'Invalid', 'Up', 'Down', 'Enabling', 'Disabling', 'Disabled', 'Unknown', 'Removed'

node_up_time_in_seconds
Required
str

Time in seconds since the node has been in NodeStatus Up. Value zero indicates that the node is not Up.

health_state
Required

The health state of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'

is_seed_node
Required

Indicates if the node is a seed node or not. Returns true if the node is a seed node, otherwise false. A quorum of seed nodes are required for proper operation of Service Fabric cluster.

upgrade_domain
Required
str

The upgrade domain of the node.

fault_domain
Required
str

The fault domain of the node.

id
Required

An internal ID used by Service Fabric to uniquely identify a node. Node Id is deterministically generated from node name.

instance_id
Required
str

The ID representing the node instance. While the ID of the node is deterministically generated from the node name and remains same across restarts, the InstanceId changes every time node restarts.

node_deactivation_info
Required

Information about the node deactivation. This information is valid for a node that is undergoing deactivation or has already been deactivated.

is_stopped
Required

Indicates if the node is stopped by calling stop node API or not. Returns true if the node is stopped, otherwise false.

node_down_time_in_seconds
Required
str

Time in seconds since the node has been in NodeStatus Down. Value zero indicates node is not NodeStatus Down.

node_up_at
Required

Date time in UTC when the node came up. If the node has never been up then this value will be zero date time.

node_down_at
Required

Date time in UTC when the node went down. If node has never been down then this value will be zero date time.

node_tags
Required

List that contains tags, which will be applied to the nodes.

is_node_by_node_upgrade_in_progress
Required

Indicates if a node-by-node upgrade is currently being performed on this node.

infrastructure_placement_id
Required
str

PlacementID used by the InfrastructureService.

Keyword-Only Parameters

Name Description
name
Default value: None
ip_address_or_fqdn
Default value: None
type
Default value: None
code_version
Default value: None
config_version
Default value: None
node_status
Default value: None
node_up_time_in_seconds
Default value: None
health_state
Default value: None
is_seed_node
Default value: None
upgrade_domain
Default value: None
fault_domain
Default value: None
id
Default value: None
instance_id
Default value: None
node_deactivation_info
Default value: None
is_stopped
Default value: None
node_down_time_in_seconds
Default value: None
node_up_at
Default value: None
node_down_at
Default value: None
node_tags
Default value: None
is_node_by_node_upgrade_in_progress
Default value: None
infrastructure_placement_id
Default value: None

Methods

as_dict

Return a dict that can be JSONify using json.dump.

Advanced usage might optionally use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains 'type' with the msrest type and 'key' with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

deserialize

Parse a str using the RestAPI syntax and return a model.

enable_additional_properties_sending
from_dict

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

is_xml_model
serialize

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

validate

Validate this model recursively and return a list of ValidationError.

as_dict

Return a dict that can be JSONify using json.dump.

Advanced usage might optionally use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains 'type' with the msrest type and 'key' with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Parameters

Name Description
key_transformer
<xref:function>

A key transformer function.

keep_readonly
Default value: True

Returns

Type Description

A dict JSON compatible object

deserialize

Parse a str using the RestAPI syntax and return a model.

deserialize(data, content_type=None)

Parameters

Name Description
data
Required
str

A str using RestAPI structure. JSON by default.

content_type
str

JSON by default, set application/xml if XML.

Default value: None

Returns

Type Description

An instance of this model

Exceptions

Type Description
DeserializationError if something went wrong

enable_additional_properties_sending

enable_additional_properties_sending()

from_dict

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

from_dict(data, key_extractors=None, content_type=None)

Parameters

Name Description
data
Required

A dict using RestAPI structure

content_type
str

JSON by default, set application/xml if XML.

Default value: None
key_extractors
Default value: None

Returns

Type Description

An instance of this model

Exceptions

Type Description
DeserializationError if something went wrong

is_xml_model

is_xml_model()

serialize

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

serialize(keep_readonly=False, **kwargs)

Parameters

Name Description
keep_readonly

If you want to serialize the readonly attributes

Default value: False

Returns

Type Description

A dict JSON compatible object

validate

Validate this model recursively and return a list of ValidationError.

validate()

Returns

Type Description

A list of validation error