Full Code of Azure/azure-linux-extensions for AI

master 7572dd33197a cached
991 files
6.8 MB
1.8M tokens
8724 symbols
1 requests
Download .txt
Showing preview only (7,341K chars total). Download the full file or copy to clipboard to get everything.
Repository: Azure/azure-linux-extensions
Branch: master
Commit: 7572dd33197a
Files: 991
Total size: 6.8 MB

Directory structure:
gitextract_55atar1w/

├── .gitattributes
├── .gitignore
├── .gitmodules
├── .vscode/
│   └── launch.json
├── AzureEnhancedMonitor/
│   ├── README.md
│   ├── bin/
│   │   ├── pack.sh
│   │   └── setup.sh
│   ├── clib/
│   │   ├── .gitignore
│   │   ├── Makefile
│   │   ├── include/
│   │   │   └── azureperf.h
│   │   ├── src/
│   │   │   ├── apmetric.c
│   │   │   └── azureperf.c
│   │   └── test/
│   │       ├── cases/
│   │       │   └── positive_case
│   │       ├── codegen.py
│   │       ├── counter_names
│   │       └── runtest.c
│   ├── ext/
│   │   ├── .gitignore
│   │   ├── HandlerManifest.json
│   │   ├── aem.py
│   │   ├── handler.py
│   │   ├── installer.py
│   │   ├── references
│   │   └── test/
│   │       ├── env.py
│   │       ├── storage_metrics
│   │       ├── test_aem.py
│   │       └── test_installer.py
│   ├── hvinfo/
│   │   ├── .gitignore
│   │   ├── Makefile
│   │   └── src/
│   │       └── hvinfo.c
│   └── nodejs/
│       ├── package.json
│       └── setaem.js
├── AzureMonitorAgent/
│   ├── .gitignore
│   ├── HandlerManifest.json
│   ├── README.md
│   ├── agent.py
│   ├── agent.version
│   ├── ama_tst/
│   │   ├── AMA-Troubleshooting-Tool.md
│   │   ├── __init__.py
│   │   ├── ama_troubleshooter.sh
│   │   └── modules/
│   │       ├── __init__.py
│   │       ├── connect/
│   │       │   ├── __init__.py
│   │       │   ├── check_endpts.py
│   │       │   ├── check_imds.py
│   │       │   └── connect.py
│   │       ├── custom_logs/
│   │       │   ├── __init__.py
│   │       │   ├── check_clconf.py
│   │       │   └── custom_logs.py
│   │       ├── error_codes.py
│   │       ├── errors.py
│   │       ├── general_health/
│   │       │   ├── __init__.py
│   │       │   ├── check_status.py
│   │       │   └── general_health.py
│   │       ├── helpers.py
│   │       ├── high_cpu_mem/
│   │       │   ├── __init__.py
│   │       │   ├── check_logrot.py
│   │       │   ├── check_usage.py
│   │       │   └── high_cpu_mem.py
│   │       ├── install/
│   │       │   ├── __init__.py
│   │       │   ├── check_ama.py
│   │       │   ├── check_os.py
│   │       │   ├── check_pkgs.py
│   │       │   ├── install.py
│   │       │   └── supported_distros.py
│   │       ├── logcollector.py
│   │       ├── main.py
│   │       ├── metrics_troubleshooter/
│   │       │   ├── __init__.py
│   │       │   └── metrics_troubleshooter.py
│   │       └── syslog_tst/
│   │           ├── __init__.py
│   │           ├── check_conf.py
│   │           ├── check_rsysng.py
│   │           └── syslog.py
│   ├── apply_version.sh
│   ├── azuremonitoragentextension.logrotate
│   ├── manifest.xml
│   ├── packaging.sh
│   ├── references
│   ├── services/
│   │   ├── metrics-extension-cmv1.service
│   │   ├── metrics-extension-cmv2.service
│   │   └── metrics-extension-otlp.service
│   ├── shim.sh
│   └── update_version.sh
├── CODEOWNERS
├── Common/
│   ├── WALinuxAgent-2.0.14/
│   │   └── waagent
│   ├── WALinuxAgent-2.0.16/
│   │   └── waagent
│   ├── libpsutil/
│   │   ├── py2.6-glibc-2.12-pre/
│   │   │   └── psutil/
│   │   │       ├── __init__.py
│   │   │       ├── _common.py
│   │   │       ├── _compat.py
│   │   │       ├── _psbsd.py
│   │   │       ├── _pslinux.py
│   │   │       ├── _psosx.py
│   │   │       ├── _psposix.py
│   │   │       ├── _pssunos.py
│   │   │       └── _pswindows.py
│   │   └── py2.7-glibc-2.12+/
│   │       └── psutil/
│   │           ├── __init__.py
│   │           ├── _common.py
│   │           ├── _compat.py
│   │           ├── _psbsd.py
│   │           ├── _pslinux.py
│   │           ├── _psosx.py
│   │           ├── _psposix.py
│   │           ├── _pssunos.py
│   │           └── _pswindows.py
│   └── waagentloader.py
├── CustomScript/
│   ├── CHANGELOG.md
│   ├── HandlerManifest.json
│   ├── README.md
│   ├── azure/
│   │   ├── __init__.py
│   │   ├── azure.pyproj
│   │   ├── http/
│   │   │   ├── __init__.py
│   │   │   ├── batchclient.py
│   │   │   ├── httpclient.py
│   │   │   └── winhttp.py
│   │   ├── servicebus/
│   │   │   ├── __init__.py
│   │   │   └── servicebusservice.py
│   │   ├── servicemanagement/
│   │   │   ├── __init__.py
│   │   │   ├── servicebusmanagementservice.py
│   │   │   ├── servicemanagementclient.py
│   │   │   ├── servicemanagementservice.py
│   │   │   ├── sqldatabasemanagementservice.py
│   │   │   └── websitemanagementservice.py
│   │   └── storage/
│   │       ├── __init__.py
│   │       ├── blobservice.py
│   │       ├── cloudstorageaccount.py
│   │       ├── queueservice.py
│   │       ├── sharedaccesssignature.py
│   │       ├── storageclient.py
│   │       └── tableservice.py
│   ├── customscript.py
│   ├── manifest.xml
│   ├── references
│   ├── shim.sh
│   └── test/
│       ├── HandlerEnvironment.json
│       ├── MockUtil.py
│       ├── create_test_blob.py
│       ├── env.py
│       ├── run_all.sh
│       ├── test_blob_download.py
│       ├── test_file_download.py
│       ├── test_preprocess_file.py
│       ├── test_uri_utils.py
│       └── timeout.sh
├── DSC/
│   ├── HandlerManifest.json
│   ├── Makefile
│   ├── README.md
│   ├── azure/
│   │   ├── __init__.py
│   │   ├── azure.pyproj
│   │   ├── http/
│   │   │   ├── __init__.py
│   │   │   ├── batchclient.py
│   │   │   ├── httpclient.py
│   │   │   └── winhttp.py
│   │   ├── servicebus/
│   │   │   ├── __init__.py
│   │   │   └── servicebusservice.py
│   │   ├── servicemanagement/
│   │   │   ├── __init__.py
│   │   │   ├── servicebusmanagementservice.py
│   │   │   ├── servicemanagementclient.py
│   │   │   ├── servicemanagementservice.py
│   │   │   ├── sqldatabasemanagementservice.py
│   │   │   └── websitemanagementservice.py
│   │   └── storage/
│   │       ├── __init__.py
│   │       ├── blobservice.py
│   │       ├── cloudstorageaccount.py
│   │       ├── queueservice.py
│   │       ├── sharedaccesssignature.py
│   │       ├── storageclient.py
│   │       └── tableservice.py
│   ├── curlhttpclient.py
│   ├── dsc.py
│   ├── extension_shim.sh
│   ├── httpclient.py
│   ├── httpclientfactory.py
│   ├── manifest.xml
│   ├── packages/
│   │   ├── dsc-1.2.4-0.ssl_100.x64.deb
│   │   ├── dsc-1.2.4-0.ssl_100.x64.rpm
│   │   ├── dsc-1.2.4-0.ssl_110.x64.deb
│   │   ├── dsc-1.2.4-0.ssl_110.x64.rpm
│   │   ├── omi-1.7.3-0.ssl_100.ulinux.s.x64.deb
│   │   ├── omi-1.7.3-0.ssl_100.ulinux.s.x64.rpm
│   │   ├── omi-1.7.3-0.ssl_100.ulinux.x64.deb
│   │   ├── omi-1.7.3-0.ssl_100.ulinux.x64.rpm
│   │   ├── omi-1.7.3-0.ssl_110.ulinux.s.x64.deb
│   │   ├── omi-1.7.3-0.ssl_110.ulinux.s.x64.rpm
│   │   ├── omi-1.7.3-0.ssl_110.ulinux.x64.deb
│   │   └── omi-1.7.3-0.ssl_110.ulinux.x64.rpm
│   ├── serializerfactory.py
│   ├── subprocessfactory.py
│   ├── test/
│   │   ├── MockUtil.py
│   │   ├── env.py
│   │   ├── mof/
│   │   │   ├── azureautomation.df.meta.mof
│   │   │   ├── dscnode.nxFile.meta.mof
│   │   │   ├── dscnode.nxFile.meta.push.mof
│   │   │   └── localhost.nxFile.mof
│   │   ├── status/
│   │   │   └── 0.status
│   │   ├── test_apply_meta_mof.py
│   │   ├── test_apply_mof.py
│   │   ├── test_compare_pkg_version.py
│   │   ├── test_download_file.py
│   │   ├── test_node_extension_properties.py
│   │   ├── test_register.py
│   │   └── test_status_update.py
│   ├── urllib2httpclient.py
│   └── urllib3httpclient.py
├── Diagnostic/
│   ├── ChangeLogs
│   ├── DistroSpecific.py
│   ├── HandlerManifest.json
│   ├── Makefile
│   ├── Providers/
│   │   ├── Builtin.py
│   │   └── __init__.py
│   ├── README.md
│   ├── Utils/
│   │   ├── LadDiagnosticUtil.py
│   │   ├── ProviderUtil.py
│   │   ├── XmlUtil.py
│   │   ├── __init__.py
│   │   ├── imds_util.py
│   │   ├── lad_exceptions.py
│   │   ├── lad_ext_settings.py
│   │   ├── lad_logging_config.py
│   │   ├── mdsd_xml_templates.py
│   │   ├── misc_helpers.py
│   │   └── omsagent_util.py
│   ├── __init__.py
│   ├── decrypt_protected_settings.sh
│   ├── diagnostic.py
│   ├── lad_config_all.py
│   ├── lad_mdsd.te
│   ├── license.txt
│   ├── manifest.xml
│   ├── mdsd/
│   │   ├── CMakeLists.txt
│   │   ├── Dockerfile
│   │   ├── LICENSE.txt
│   │   ├── README.md
│   │   ├── SampleConfig-LAD-SAS.xml
│   │   ├── azure.list
│   │   ├── buildcmake.sh
│   │   ├── lad-mdsd/
│   │   │   ├── Makefile.in.version
│   │   │   ├── README.txt
│   │   │   ├── changelog
│   │   │   ├── copyright
│   │   │   ├── deb/
│   │   │   │   ├── Makefile
│   │   │   │   └── control
│   │   │   └── rpm/
│   │   │       └── Makefile
│   │   ├── mdscommands/
│   │   │   ├── BinaryWriter.hh
│   │   │   ├── BodyOnlyXmlParser.cc
│   │   │   ├── BodyOnlyXmlParser.hh
│   │   │   ├── CMakeLists.txt
│   │   │   ├── CmdListXmlParser.cc
│   │   │   ├── CmdListXmlParser.hh
│   │   │   ├── CmdXmlCommon.cc
│   │   │   ├── CmdXmlCommon.hh
│   │   │   ├── CmdXmlElement.cc
│   │   │   ├── CmdXmlElement.hh
│   │   │   ├── CmdXmlParser.cc
│   │   │   ├── CmdXmlParser.hh
│   │   │   ├── ConfigUpdateCmd.cc
│   │   │   ├── ConfigUpdateCmd.hh
│   │   │   ├── DirectoryIter.cc
│   │   │   ├── DirectoryIter.hh
│   │   │   ├── EventData.cc
│   │   │   ├── EventData.hh
│   │   │   ├── EventEntry.cc
│   │   │   ├── EventEntry.hh
│   │   │   ├── EventHubCmd.cc
│   │   │   ├── EventHubCmd.hh
│   │   │   ├── EventHubPublisher.cc
│   │   │   ├── EventHubPublisher.hh
│   │   │   ├── EventHubType.cc
│   │   │   ├── EventHubType.hh
│   │   │   ├── EventHubUploader.cc
│   │   │   ├── EventHubUploader.hh
│   │   │   ├── EventHubUploaderId.cc
│   │   │   ├── EventHubUploaderId.hh
│   │   │   ├── EventHubUploaderMgr.cc
│   │   │   ├── EventHubUploaderMgr.hh
│   │   │   ├── EventPersistMgr.cc
│   │   │   ├── EventPersistMgr.hh
│   │   │   ├── MdsBlobReader.cc
│   │   │   ├── MdsBlobReader.hh
│   │   │   ├── MdsCmdLogger.hh
│   │   │   ├── MdsException.cc
│   │   │   ├── MdsException.hh
│   │   │   ├── PersistFiles.cc
│   │   │   ├── PersistFiles.hh
│   │   │   ├── PublisherStatus.cc
│   │   │   ├── PublisherStatus.hh
│   │   │   └── commands.xsd
│   │   ├── mdsd/
│   │   │   ├── Batch.cc
│   │   │   ├── Batch.hh
│   │   │   ├── CMakeLists.txt
│   │   │   ├── CanonicalEntity.cc
│   │   │   ├── CanonicalEntity.hh
│   │   │   ├── CfgContext.cc
│   │   │   ├── CfgContext.hh
│   │   │   ├── CfgCtxAccounts.cc
│   │   │   ├── CfgCtxAccounts.hh
│   │   │   ├── CfgCtxDerived.cc
│   │   │   ├── CfgCtxDerived.hh
│   │   │   ├── CfgCtxEnvelope.cc
│   │   │   ├── CfgCtxEnvelope.hh
│   │   │   ├── CfgCtxError.cc
│   │   │   ├── CfgCtxError.hh
│   │   │   ├── CfgCtxEtw.cc
│   │   │   ├── CfgCtxEtw.hh
│   │   │   ├── CfgCtxEventAnnotations.cc
│   │   │   ├── CfgCtxEventAnnotations.hh
│   │   │   ├── CfgCtxEvents.cc
│   │   │   ├── CfgCtxEvents.hh
│   │   │   ├── CfgCtxExtensions.cc
│   │   │   ├── CfgCtxExtensions.hh
│   │   │   ├── CfgCtxHeartBeats.cc
│   │   │   ├── CfgCtxHeartBeats.hh
│   │   │   ├── CfgCtxImports.cc
│   │   │   ├── CfgCtxImports.hh
│   │   │   ├── CfgCtxManagement.cc
│   │   │   ├── CfgCtxManagement.hh
│   │   │   ├── CfgCtxMdsdEvents.cc
│   │   │   ├── CfgCtxMdsdEvents.hh
│   │   │   ├── CfgCtxMonMgmt.cc
│   │   │   ├── CfgCtxMonMgmt.hh
│   │   │   ├── CfgCtxOMI.cc
│   │   │   ├── CfgCtxOMI.hh
│   │   │   ├── CfgCtxParser.cc
│   │   │   ├── CfgCtxParser.hh
│   │   │   ├── CfgCtxRoot.cc
│   │   │   ├── CfgCtxRoot.hh
│   │   │   ├── CfgCtxSchemas.cc
│   │   │   ├── CfgCtxSchemas.hh
│   │   │   ├── CfgCtxSources.cc
│   │   │   ├── CfgCtxSources.hh
│   │   │   ├── CfgCtxSvcBusAccts.cc
│   │   │   ├── CfgCtxSvcBusAccts.hh
│   │   │   ├── CfgEventAnnotationType.hh
│   │   │   ├── CfgOboDirectConfig.hh
│   │   │   ├── CmdLineConverter.cc
│   │   │   ├── CmdLineConverter.hh
│   │   │   ├── ConfigParser.cc
│   │   │   ├── ConfigParser.hh
│   │   │   ├── Constants.cc
│   │   │   ├── Constants.hh
│   │   │   ├── Credentials.cc
│   │   │   ├── Credentials.hh
│   │   │   ├── DaemonConf.cc
│   │   │   ├── DaemonConf.hh
│   │   │   ├── DerivedEvent.cc
│   │   │   ├── DerivedEvent.hh
│   │   │   ├── Engine.cc
│   │   │   ├── Engine.hh
│   │   │   ├── EtwEvent.cc
│   │   │   ├── EtwEvent.hh
│   │   │   ├── EventJSON.cc
│   │   │   ├── EventJSON.hh
│   │   │   ├── ExtensionMgmt.cc
│   │   │   ├── ExtensionMgmt.hh
│   │   │   ├── FileSink.cc
│   │   │   ├── FileSink.hh
│   │   │   ├── IMdsSink.cc
│   │   │   ├── IMdsSink.hh
│   │   │   ├── ITask.cc
│   │   │   ├── ITask.hh
│   │   │   ├── IdentityColumns.hh
│   │   │   ├── LADQuery.cc
│   │   │   ├── LADQuery.hh
│   │   │   ├── LinuxMdsConfig.xsd
│   │   │   ├── Listener.cc
│   │   │   ├── Listener.hh
│   │   │   ├── LocalSink.cc
│   │   │   ├── LocalSink.hh
│   │   │   ├── MdsBlobOutputter.hh
│   │   │   ├── MdsEntityName.cc
│   │   │   ├── MdsEntityName.hh
│   │   │   ├── MdsSchemaMetadata.cc
│   │   │   ├── MdsSchemaMetadata.hh
│   │   │   ├── MdsValue.cc
│   │   │   ├── MdsValue.hh
│   │   │   ├── MdsdConfig.cc
│   │   │   ├── MdsdConfig.hh
│   │   │   ├── MdsdExtension.hh
│   │   │   ├── MdsdMetrics.cc
│   │   │   ├── MdsdMetrics.hh
│   │   │   ├── Memcheck.cc
│   │   │   ├── OMIQuery.cc
│   │   │   ├── OMIQuery.hh
│   │   │   ├── OmiTask.cc
│   │   │   ├── OmiTask.hh
│   │   │   ├── PipeStages.cc
│   │   │   ├── PipeStages.hh
│   │   │   ├── Pipeline.cc
│   │   │   ├── Pipeline.hh
│   │   │   ├── PoolMgmt.hh
│   │   │   ├── Priority.cc
│   │   │   ├── Priority.hh
│   │   │   ├── ProtocolHandlerBase.cc
│   │   │   ├── ProtocolHandlerBase.hh
│   │   │   ├── ProtocolHandlerBond.cc
│   │   │   ├── ProtocolHandlerBond.hh
│   │   │   ├── ProtocolHandlerJSON.cc
│   │   │   ├── ProtocolHandlerJSON.hh
│   │   │   ├── ProtocolListener.cc
│   │   │   ├── ProtocolListener.hh
│   │   │   ├── ProtocolListenerBond.cc
│   │   │   ├── ProtocolListenerBond.hh
│   │   │   ├── ProtocolListenerDynamicJSON.cc
│   │   │   ├── ProtocolListenerDynamicJSON.hh
│   │   │   ├── ProtocolListenerJSON.cc
│   │   │   ├── ProtocolListenerJSON.hh
│   │   │   ├── ProtocolListenerMgr.cc
│   │   │   ├── ProtocolListenerMgr.hh
│   │   │   ├── ProtocolListenerTcpJSON.cc
│   │   │   ├── ProtocolListenerTcpJSON.hh
│   │   │   ├── RowIndex.cc
│   │   │   ├── RowIndex.hh
│   │   │   ├── SaxParserBase.cc
│   │   │   ├── SaxParserBase.hh
│   │   │   ├── SchemaCache.cc
│   │   │   ├── SchemaCache.hh
│   │   │   ├── Signals.c
│   │   │   ├── StoreType.cc
│   │   │   ├── StoreType.hh
│   │   │   ├── StreamListener.cc
│   │   │   ├── StreamListener.hh
│   │   │   ├── Subscription.cc
│   │   │   ├── Subscription.hh
│   │   │   ├── TableColumn.cc
│   │   │   ├── TableColumn.hh
│   │   │   ├── TableSchema.cc
│   │   │   ├── TableSchema.hh
│   │   │   ├── TermHandler.cc
│   │   │   ├── Version.cc
│   │   │   ├── Version.hh
│   │   │   ├── XJsonBlobBlockCountsMgr.cc
│   │   │   ├── XJsonBlobBlockCountsMgr.hh
│   │   │   ├── XJsonBlobRequest.cc
│   │   │   ├── XJsonBlobRequest.hh
│   │   │   ├── XJsonBlobSink.cc
│   │   │   ├── XJsonBlobSink.hh
│   │   │   ├── XTableConst.cc
│   │   │   ├── XTableConst.hh
│   │   │   ├── XTableHelper.cc
│   │   │   ├── XTableHelper.hh
│   │   │   ├── XTableRequest.cc
│   │   │   ├── XTableRequest.hh
│   │   │   ├── XTableSink.cc
│   │   │   ├── XTableSink.hh
│   │   │   ├── cJSON.c
│   │   │   ├── cJSON.h
│   │   │   ├── cryptutil.cc
│   │   │   ├── cryptutil.hh
│   │   │   ├── fdelt_chk.c
│   │   │   ├── mdsautokey.h
│   │   │   ├── mdsd.cc
│   │   │   └── wrap_memcpy.c
│   │   ├── mdsd.8
│   │   ├── mdsdcfg/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── EventPubCfg.cc
│   │   │   ├── EventPubCfg.hh
│   │   │   ├── EventSinkCfgInfo.hh
│   │   │   ├── EventType.hh
│   │   │   ├── MdsdEventCfg.cc
│   │   │   └── MdsdEventCfg.hh
│   │   ├── mdsdinput/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── MdsdInputMessageBuilder.cpp
│   │   │   ├── MdsdInputMessageBuilder.h
│   │   │   ├── MdsdInputMessageDecoder.h
│   │   │   ├── MdsdInputMessageIO.cpp
│   │   │   ├── MdsdInputMessageIO.h
│   │   │   ├── MdsdInputSchemaCache.cpp
│   │   │   ├── MdsdInputSchemaCache.h
│   │   │   ├── mdsd_input.bond
│   │   │   ├── mdsd_input_apply.cpp
│   │   │   ├── mdsd_input_apply.h
│   │   │   ├── mdsd_input_reflection.h
│   │   │   ├── mdsd_input_types.cpp
│   │   │   └── mdsd_input_types.h
│   │   ├── mdsdlog/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── Logger.cc
│   │   │   ├── Logger.hh
│   │   │   ├── Trace.cc
│   │   │   └── Trace.hh
│   │   ├── mdsdutil/
│   │   │   ├── AzureUtility.cc
│   │   │   ├── AzureUtility.hh
│   │   │   ├── CMakeLists.txt
│   │   │   ├── Crypto.cc
│   │   │   ├── Crypto.hh
│   │   │   ├── HttpProxySetup.cc
│   │   │   ├── HttpProxySetup.hh
│   │   │   ├── MdsTime.cc
│   │   │   ├── MdsTime.hh
│   │   │   ├── OpensslCert.cc
│   │   │   ├── OpensslCert.hh
│   │   │   ├── OpensslCertStore.cc
│   │   │   ├── OpensslCertStore.hh
│   │   │   ├── Utility.cc
│   │   │   └── Utility.hh
│   │   ├── mdsrest/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── GcsJsonData.cc
│   │   │   ├── GcsJsonData.hh
│   │   │   ├── GcsJsonParser.cc
│   │   │   ├── GcsJsonParser.hh
│   │   │   ├── GcsServiceInfo.cc
│   │   │   ├── GcsServiceInfo.hh
│   │   │   ├── GcsUtil.cc
│   │   │   ├── GcsUtil.hh
│   │   │   ├── MdsConst.hh
│   │   │   ├── MdsRest.cc
│   │   │   ├── MdsRest.hh
│   │   │   └── MdsRestException.hh
│   │   └── parseglibc.py
│   ├── mocks/
│   │   ├── Readme.txt
│   │   ├── __init__.py
│   │   ├── crypt.py
│   │   ├── fcntl.py
│   │   └── pwd.py
│   ├── run_unittests.sh
│   ├── services/
│   │   ├── mdsd-lde.service
│   │   ├── metrics-extension.service
│   │   └── metrics-sourcer.service
│   ├── shim.sh
│   ├── tests/
│   │   ├── .gitignore
│   │   ├── __init__.py
│   │   ├── lad_2_3_compatible_portal_pub_settings.json
│   │   ├── test_LadDiagnosticUtil.py
│   │   ├── test_builtin.py
│   │   ├── test_commonActions.py
│   │   ├── test_lad_config_all.py
│   │   ├── test_lad_ext_settings.py
│   │   ├── test_lad_logging_config.py
│   │   ├── var_lib_waagent/
│   │   │   └── lad_dir/
│   │   │       └── config/
│   │   │           ├── lad_settings_logging.json
│   │   │           └── lad_settings_metric.json
│   │   └── watchertests.py
│   ├── virtual-machines-linux-diagnostic-extension-v3.md
│   └── watcherutil.py
├── LAD-AMA-Common/
│   ├── metrics_ext_utils/
│   │   ├── __init__.py
│   │   ├── metrics_common_utils.py
│   │   ├── metrics_constants.py
│   │   └── metrics_ext_handler.py
│   └── telegraf_utils/
│       ├── __init__.py
│       ├── telegraf_config_handler.py
│       └── telegraf_name_map.py
├── LICENSE.txt
├── Makefile
├── OSPatching/
│   ├── HandlerManifest.json
│   ├── README.md
│   ├── azure/
│   │   ├── __init__.py
│   │   ├── azure.pyproj
│   │   ├── http/
│   │   │   ├── __init__.py
│   │   │   ├── batchclient.py
│   │   │   ├── httpclient.py
│   │   │   └── winhttp.py
│   │   ├── servicebus/
│   │   │   ├── __init__.py
│   │   │   └── servicebusservice.py
│   │   ├── servicemanagement/
│   │   │   ├── __init__.py
│   │   │   ├── servicebusmanagementservice.py
│   │   │   ├── servicemanagementclient.py
│   │   │   ├── servicemanagementservice.py
│   │   │   ├── sqldatabasemanagementservice.py
│   │   │   └── websitemanagementservice.py
│   │   └── storage/
│   │       ├── __init__.py
│   │       ├── blobservice.py
│   │       ├── cloudstorageaccount.py
│   │       ├── queueservice.py
│   │       ├── sharedaccesssignature.py
│   │       ├── storageclient.py
│   │       └── tableservice.py
│   ├── check.py
│   ├── handler.py
│   ├── manifest.xml
│   ├── oneoff/
│   │   └── __init__.py
│   ├── patch/
│   │   ├── AbstractPatching.py
│   │   ├── ConfigOptions.py
│   │   ├── OraclePatching.py
│   │   ├── SuSEPatching.py
│   │   ├── UbuntuPatching.py
│   │   ├── __init__.py
│   │   ├── centosPatching.py
│   │   └── redhatPatching.py
│   ├── references
│   ├── scheduled/
│   │   ├── __init__.py
│   │   └── history
│   └── test/
│       ├── FakePatching.py
│       ├── FakePatching2.py
│       ├── FakePatching3.py
│       ├── HandlerEnvironment.json
│       ├── README.txt
│       ├── check.py
│       ├── config/
│       │   └── 0.settings
│       ├── default.settings
│       ├── handler.py
│       ├── oneoff/
│       │   └── __init__.py
│       ├── prepare_settings.py
│       ├── scheduled/
│       │   ├── __init__.py
│       │   └── history
│       ├── test.crt
│       ├── test.prv
│       ├── test_handler_1.py
│       ├── test_handler_2.py
│       └── test_handler_3.py
├── OmsAgent/
│   ├── .gitignore
│   ├── HandlerManifest.json
│   ├── ImportGPGkey.sh
│   ├── README.md
│   ├── apply_version.sh
│   ├── extension-test/
│   │   ├── README.md
│   │   ├── oms_extension_tests.py
│   │   ├── omsfiles/
│   │   │   ├── apache_access.log
│   │   │   ├── custom.log
│   │   │   ├── customlog.conf
│   │   │   ├── error.log
│   │   │   ├── mysql-slow.log
│   │   │   ├── mysql.log
│   │   │   ├── oms_extension_run_script.py
│   │   │   ├── perf.conf
│   │   │   └── rsyslog-oms.conf
│   │   ├── parameters.json
│   │   └── verify_e2e.py
│   ├── keys/
│   │   ├── dscgpgkey.asc
│   │   └── msgpgkey.asc
│   ├── manifest.xml
│   ├── omsagent.py
│   ├── omsagent.version
│   ├── omsagent_shim.sh
│   ├── packaging.sh
│   ├── references
│   ├── test/
│   │   ├── MockUtil.py
│   │   ├── env.py
│   │   └── test_install.py
│   ├── update_version.sh
│   └── watcherutil.py
├── RDMAUpdate/
│   ├── MANIFEST.in
│   ├── RDMAUpdate.pyproj
│   ├── README.txt
│   ├── enableit.js
│   ├── main/
│   │   ├── CommandExecuter.py
│   │   ├── Common.py
│   │   ├── CronUtil.py
│   │   ├── RDMALogger.py
│   │   ├── RdmaException.py
│   │   ├── SecondStageMarkConfig.py
│   │   ├── Utils/
│   │   │   ├── HandlerUtil.py
│   │   │   ├── WAAgentUtil.py
│   │   │   └── __init__.py
│   │   ├── __init__.py
│   │   ├── handle.py
│   │   └── patch/
│   │       ├── AbstractPatching.py
│   │       ├── OraclePatching.py
│   │       ├── SuSEPatching.py
│   │       ├── UbuntuPatching.py
│   │       ├── __init__.py
│   │       ├── centosPatching.py
│   │       └── redhatPatching.py
│   ├── references
│   ├── setup.py
│   ├── test/
│   │   └── update_rdma_driver.py
│   └── test.ps1
├── README.md
├── SECURITY.md
├── SampleExtension/
│   ├── HandlerManifest.json
│   ├── disable.py
│   ├── enable.py
│   ├── install.py
│   ├── references
│   ├── uninstall.py
│   └── update.py
├── TestHandlerLinux/
│   ├── HandlerManifest.json
│   ├── bin/
│   │   ├── #heartbeat.py#
│   │   ├── disable.py
│   │   ├── enable.py
│   │   ├── heartbeat.py
│   │   ├── service.py
│   │   └── update.py
│   ├── installer/
│   │   ├── install.py
│   │   └── uninstall.py
│   ├── manifest.xml
│   ├── references
│   └── resources/
│       ├── HandlerUtil.py
│       └── mypydoc.py
├── Utils/
│   ├── HandlerUtil.py
│   ├── LogUtil.py
│   ├── ScriptUtil.py
│   ├── WAAgentUtil.py
│   ├── __init__.py
│   ├── constants.py
│   ├── crypt_fallback.py
│   ├── distroutils.py
│   ├── extensionutils.py
│   ├── handlerutil2.py
│   ├── logger.py
│   ├── ovfutils.py
│   └── test/
│       ├── MockUtil.py
│       ├── env.py
│       ├── mock.sh
│       ├── mock_sshd_config
│       ├── non_latin_characters.txt
│       ├── ovf-env-empty.xml
│       ├── ovf-env.xml
│       ├── place_vmaccess_on_local_machine.sh
│       ├── test_encode.py
│       ├── test_extensionutils_code_injection.py
│       ├── test_logutil.py
│       ├── test_null_protected_settings.py
│       ├── test_ovf_utils.py
│       ├── test_redacted_settings.py
│       └── test_scriptutil.py
├── VMAccess/
│   ├── CHANGELOG.md
│   ├── HandlerManifest.json
│   ├── README.md
│   ├── extension_noop.sh
│   ├── extension_shim.sh
│   ├── manifest.xml
│   ├── references
│   ├── resources/
│   │   ├── SuSE_default
│   │   ├── Ubuntu_default
│   │   ├── centos_default
│   │   ├── debian_default
│   │   ├── default
│   │   ├── fedora_default
│   │   └── redhat_default
│   ├── test/
│   │   ├── env.py
│   │   ├── test_iptable_rules.py
│   │   ├── test_reset_account.py
│   │   └── test_reset_sshd_config.py
│   └── vmaccess.py
├── VMBackup/
│   ├── .gitignore
│   ├── HandlerManifest.json
│   ├── MANIFEST.in
│   ├── README.txt
│   ├── VMBackup.pyproj
│   ├── debughelper/
│   │   ├── README.md
│   │   ├── checkMounts.go
│   │   ├── go.mod
│   │   ├── go.sum
│   │   ├── main.go
│   │   └── run.go
│   ├── main/
│   │   ├── ExtensionErrorCodeHelper.py
│   │   ├── HttpUtil.py
│   │   ├── IaaSExtensionSnapshotService/
│   │   │   ├── README.md
│   │   │   ├── SnapshotServiceConstants.py
│   │   │   ├── SnapshotServiceContracts.py
│   │   │   ├── __init__.py
│   │   │   └── service_metadata.json
│   │   ├── LogSeverity.json
│   │   ├── MachineIdentity.py
│   │   ├── PluginHost.py
│   │   ├── ScriptRunner.py
│   │   ├── Utils/
│   │   │   ├── DiskUtil.py
│   │   │   ├── Event.py
│   │   │   ├── EventLoggerUtil.py
│   │   │   ├── HandlerUtil.py
│   │   │   ├── HostSnapshotObjects.py
│   │   │   ├── LogHelper.py
│   │   │   ├── ResourceDiskUtil.py
│   │   │   ├── SizeCalculation.py
│   │   │   ├── Status.py
│   │   │   ├── StringHelper.py
│   │   │   ├── WAAgentUtil.py
│   │   │   ├── __init__.py
│   │   │   └── dhcpUtils.py
│   │   ├── VMSnapshotPluginHost.conf
│   │   ├── WaagentLib.py
│   │   ├── __init__.py
│   │   ├── backuplogger.py
│   │   ├── blobwriter.py
│   │   ├── common.py
│   │   ├── dhcpHandler.py
│   │   ├── freezesnapshotter.py
│   │   ├── fsfreezer.py
│   │   ├── guestsnapshotter.py
│   │   ├── handle.py
│   │   ├── handle.sh
│   │   ├── handle_host_daemon.py
│   │   ├── handle_host_daemon.sh
│   │   ├── hostsnapshotter.py
│   │   ├── mounts.py
│   │   ├── parameterparser.py
│   │   ├── patch/
│   │   │   ├── AbstractPatching.py
│   │   │   ├── DefaultPatching.py
│   │   │   ├── FreeBSDPatching.py
│   │   │   ├── KaliPatching.py
│   │   │   ├── NSBSDPatching.py
│   │   │   ├── SuSEPatching.py
│   │   │   ├── UbuntuPatching.py
│   │   │   ├── __init__.py
│   │   │   ├── centosPatching.py
│   │   │   ├── debianPatching.py
│   │   │   ├── oraclePatching.py
│   │   │   └── redhatPatching.py
│   │   ├── safefreeze/
│   │   │   ├── Makefile
│   │   │   └── src/
│   │   │       └── safefreeze.c
│   │   ├── safefreezeArm64/
│   │   │   ├── Makefile
│   │   │   ├── bin/
│   │   │   │   └── safefreeze
│   │   │   └── src/
│   │   │       └── safefreeze.c
│   │   ├── taskidentity.py
│   │   ├── tempPlugin/
│   │   │   ├── VMSnapshotScriptPluginConfig.json
│   │   │   ├── postScript.sh
│   │   │   ├── preScript.sh
│   │   │   └── vmbackup.conf
│   │   └── workloadPatch/
│   │       ├── CustomScripts/
│   │       │   └── customscript.sql
│   │       ├── DefaultScripts/
│   │       │   ├── logbackup.sql
│   │       │   ├── postMysqlMaster.sql
│   │       │   ├── postMysqlSlave.sql
│   │       │   ├── postOracleMaster.sql
│   │       │   ├── postPostgresMaster.sql
│   │       │   ├── preMysqlMaster.sql
│   │       │   ├── preMysqlSlave.sql
│   │       │   ├── preOracleMaster.sql
│   │       │   ├── prePostgresMaster.sql
│   │       │   └── timeoutDaemon.sh
│   │       ├── LogBackupPatch.py
│   │       ├── WorkloadPatch.py
│   │       ├── WorkloadUtils/
│   │       │   ├── OracleLogBackup.py
│   │       │   ├── OracleLogRestore.py
│   │       │   └── workload.conf
│   │       └── __init__.py
│   ├── manifest.xml
│   ├── mkstub.py
│   ├── references
│   ├── setup.py
│   └── test/
│       ├── handle.py
│       └── install_python2.6.sh
├── VMEncryption/
│   ├── .vscode/
│   │   └── settings.json
│   ├── MANIFEST.in
│   ├── ReleaseNotes.txt
│   ├── Test-AzureRmVMDiskEncryptionExtension.ps1
│   ├── Test-AzureRmVMDiskEncryptionExtensionDiskFormat.ps1
│   ├── UpgradeLog.htm
│   ├── VMEncryption.pyproj
│   ├── extension_shim.sh
│   ├── lint_output.txt
│   ├── main/
│   │   ├── BackupLogger.py
│   │   ├── BekUtil.py
│   │   ├── CommandExecutor.py
│   │   ├── Common.py
│   │   ├── ConfigUtil.py
│   │   ├── DecryptionMarkConfig.py
│   │   ├── DiskUtil.py
│   │   ├── EncryptionConfig.py
│   │   ├── EncryptionEnvironment.py
│   │   ├── EncryptionMarkConfig.py
│   │   ├── ExtensionParameter.py
│   │   ├── HttpUtil.py
│   │   ├── KeyVaultUtil.py
│   │   ├── MachineIdentity.py
│   │   ├── OnGoingItemConfig.py
│   │   ├── ProcessLock.py
│   │   ├── ResourceDiskUtil.py
│   │   ├── SupportedOS.json
│   │   ├── TokenUtil.py
│   │   ├── TransactionalCopyTask.py
│   │   ├── Utils/
│   │   │   ├── HandlerUtil.py
│   │   │   ├── WAAgentUtil.py
│   │   │   └── __init__.py
│   │   ├── __init__.py
│   │   ├── check_util.py
│   │   ├── handle.py
│   │   ├── oscrypto/
│   │   │   ├── 91ade/
│   │   │   │   ├── 50-udev-ade.rules
│   │   │   │   ├── cryptroot-ask-ade.sh
│   │   │   │   ├── module-setup.sh
│   │   │   │   └── parse-crypt-ade.sh
│   │   │   ├── OSEncryptionState.py
│   │   │   ├── OSEncryptionStateMachine.py
│   │   │   ├── __init__.py
│   │   │   ├── centos_68/
│   │   │   │   ├── CentOS68EncryptionStateMachine.py
│   │   │   │   ├── __init__.py
│   │   │   │   ├── encryptpatches/
│   │   │   │   │   └── centos_68_dracut.patch
│   │   │   │   └── encryptstates/
│   │   │   │       ├── EncryptBlockDeviceState.py
│   │   │   │       ├── PatchBootSystemState.py
│   │   │   │       ├── PrereqState.py
│   │   │   │       ├── SelinuxState.py
│   │   │   │       ├── SplitRootPartitionState.py
│   │   │   │       ├── StripdownState.py
│   │   │   │       ├── UnmountOldrootState.py
│   │   │   │       └── __init__.py
│   │   │   ├── rhel_68/
│   │   │   │   ├── RHEL68EncryptionStateMachine.py
│   │   │   │   ├── __init__.py
│   │   │   │   ├── encryptpatches/
│   │   │   │   │   └── rhel_68_dracut.patch
│   │   │   │   └── encryptstates/
│   │   │   │       ├── EncryptBlockDeviceState.py
│   │   │   │       ├── PatchBootSystemState.py
│   │   │   │       ├── PrereqState.py
│   │   │   │       ├── SelinuxState.py
│   │   │   │       ├── StripdownState.py
│   │   │   │       ├── UnmountOldrootState.py
│   │   │   │       └── __init__.py
│   │   │   ├── rhel_72/
│   │   │   │   ├── RHEL72EncryptionStateMachine.py
│   │   │   │   ├── __init__.py
│   │   │   │   └── encryptstates/
│   │   │   │       ├── EncryptBlockDeviceState.py
│   │   │   │       ├── PatchBootSystemState.py
│   │   │   │       ├── PrereqState.py
│   │   │   │       ├── SelinuxState.py
│   │   │   │       ├── StripdownState.py
│   │   │   │       ├── UnmountOldrootState.py
│   │   │   │       └── __init__.py
│   │   │   ├── rhel_72_lvm/
│   │   │   │   ├── RHEL72LVMEncryptionStateMachine.py
│   │   │   │   ├── __init__.py
│   │   │   │   └── encryptstates/
│   │   │   │       ├── EncryptBlockDeviceState.py
│   │   │   │       ├── PatchBootSystemState.py
│   │   │   │       ├── PrereqState.py
│   │   │   │       ├── SelinuxState.py
│   │   │   │       ├── StripdownState.py
│   │   │   │       ├── UnmountOldrootState.py
│   │   │   │       └── __init__.py
│   │   │   ├── ubuntu_1404/
│   │   │   │   ├── Ubuntu1404EncryptionStateMachine.py
│   │   │   │   ├── __init__.py
│   │   │   │   ├── encryptpatches/
│   │   │   │   │   └── ubuntu_1404_initramfs.patch
│   │   │   │   ├── encryptscripts/
│   │   │   │   │   ├── azure_crypt_key.sh
│   │   │   │   │   └── inject_luks_header.sh
│   │   │   │   └── encryptstates/
│   │   │   │       ├── EncryptBlockDeviceState.py
│   │   │   │       ├── PatchBootSystemState.py
│   │   │   │       ├── PrereqState.py
│   │   │   │       ├── SelinuxState.py
│   │   │   │       ├── SplitRootPartitionState.py
│   │   │   │       ├── StripdownState.py
│   │   │   │       ├── UnmountOldrootState.py
│   │   │   │       └── __init__.py
│   │   │   └── ubuntu_1604/
│   │   │       ├── Ubuntu1604EncryptionStateMachine.py
│   │   │       ├── __init__.py
│   │   │       ├── encryptpatches/
│   │   │       │   └── ubuntu_1604_initramfs.patch
│   │   │       ├── encryptscripts/
│   │   │       │   ├── azure_crypt_key.sh
│   │   │       │   └── inject_luks_header.sh
│   │   │       └── encryptstates/
│   │   │           ├── EncryptBlockDeviceState.py
│   │   │           ├── PatchBootSystemState.py
│   │   │           ├── PrereqState.py
│   │   │           ├── SelinuxState.py
│   │   │           ├── SplitRootPartitionState.py
│   │   │           ├── StripdownState.py
│   │   │           ├── UnmountOldrootState.py
│   │   │           └── __init__.py
│   │   └── patch/
│   │       ├── AbstractPatching.py
│   │       ├── SuSEPatching.py
│   │       ├── UbuntuPatching.py
│   │       ├── __init__.py
│   │       ├── centosPatching.py
│   │       ├── debianPatching.py
│   │       ├── oraclePatching.py
│   │       └── redhatPatching.py
│   ├── references
│   ├── requirements.txt
│   ├── setup.py
│   └── test/
│       ├── __init__.py
│       ├── console_logger.py
│       ├── test_check_util.py
│       ├── test_command_executor.py
│       ├── test_disk_util.py
│       ├── test_handler_util.py
│       ├── test_resource_disk_util.py
│       └── test_utils.py
├── docs/
│   ├── advanced-topics.md
│   ├── contribution-guide.md
│   ├── design-details.md
│   ├── document.md
│   ├── handler-registration.md
│   ├── overview.md
│   ├── sample-extension.md
│   ├── test.md
│   └── utils.md
├── go.mod
├── go.sum
├── registration-scripts/
│   ├── api/
│   │   ├── add-extension.sh
│   │   ├── check-request-status.sh
│   │   ├── del-extension.sh
│   │   ├── get-extension.sh
│   │   ├── get-subscription.sh
│   │   ├── list-extension.sh
│   │   ├── params
│   │   └── update-extension.sh
│   ├── bin/
│   │   ├── add.sh
│   │   ├── blob/
│   │   │   ├── list.sh
│   │   │   └── upload.sh
│   │   ├── check.sh
│   │   ├── del.sh
│   │   ├── get.sh
│   │   ├── list.sh
│   │   ├── subscription.sh
│   │   └── update.sh
│   ├── create_zip.sh
│   ├── mooncake/
│   │   └── sample-extension-1.0.xml
│   └── public/
│       └── sample-extension-1.0.xml
├── script/
│   ├── 0.settings
│   ├── HandlerEnvironment.json
│   ├── create_zip.sh
│   ├── mkstub.sh
│   ├── ovf-env.xml
│   ├── set_env.sh
│   ├── test.crt
│   └── test.prv
└── ui-extension-packages/
    ├── microsoft.custom-script-linux/
    │   ├── Artifacts/
    │   │   ├── CreateUiDefinition.json
    │   │   └── MainTemplate.json
    │   ├── Manifest.json
    │   ├── Strings/
    │   │   └── resources.resjson
    │   └── UiDefinition.json
    └── microsoft.custom-script-linux-arm/
        ├── Artifacts/
        │   ├── CreateUiDefinition.json
        │   └── MainTemplate.json
        ├── Manifest.json
        ├── Strings/
        │   └── resources.resjson
        └── UiDefinition.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitattributes
================================================
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs     diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following 
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln       merge=binary
#*.csproj    merge=binary
#*.vbproj    merge=binary
#*.vcxproj   merge=binary
#*.vcproj    merge=binary
#*.dbproj    merge=binary
#*.fsproj    merge=binary
#*.lsproj    merge=binary
#*.wixproj   merge=binary
#*.modelproj merge=binary
#*.sqlproj   merge=binary
#*.wwaproj   merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg   binary
#*.png   binary
#*.gif   binary

###############################################################################
# diff behavior for common document formats
# 
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the 
# entries below.
###############################################################################
#*.doc   diff=astextplain
#*.DOC   diff=astextplain
#*.docx  diff=astextplain
#*.DOCX  diff=astextplain
#*.dot   diff=astextplain
#*.DOT   diff=astextplain
#*.pdf   diff=astextplain
#*.PDF   diff=astextplain
#*.rtf   diff=astextplain
#*.RTF   diff=astextplain


================================================
FILE: .gitignore
================================================
DSC/DSC.zip

compiled / optimized / DLL files
__pycache__/
*.py[cod]
*/.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Editor
*~

# PyCharm
.idea/
.idea_modules/

# PyInstaller
#  Usually these files are written by a python script from a template 
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log
!OmsAgent/extension-test/omsfiles/*.log
oms*.zip

# Sphinx documentation
docs/_build/

# PyBuilder
target/*


# mac osx specific files
.DS_Store

### VirtualEnv template
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
.Python
pyvenv.cfg
.venv
pip-selfcheck.json

# virtualenv
venv/
ENV/

# dotenv
.env

# pyenv
.python-version

# VMBackup package ignors
VMBackup/dist
VMBackup/dist/*
VMBackup/azure-sdk
VMBackup/azure-sdk/*
VMBackup/main/azure/*
VMBackup/MANIFEST
#VMBackup/*.pyproj
VMBackup/*.pyproj.user
VMBackup/*.suo
VMBackup/main/safefreeze/bin/*

# CustomScript ignors
CustomScript/test/download/0/stdout
CustomScript/test/download/0/errout
*node_modules/

# VMEncryption ignores
VMEncryption/main/azure/*

# Common
Common/psutil/build/*
Common/psutil/dist/*
Common/psutil/psutil.egg-info/*
VMBackup/.vs/VMBackup/v14/.suo
RDMAUpdate/RDMAUpdate.pyproj.user
*.sln
RDMAUpdate/VMBackup.pyproj.user
VMBackup/.vs/config/applicationhost.config
RDMAUpdate/.vs/VMBackup/v14/.suo

# Handler Registration ignores
*.pem
RDMAUpdate/.vs/RDMAUpdate/v14/.suo

# Visual Studio directory
.vs/

# Ignore HandlerManifest updates
VMEncryption/HandlerManifest.json
VMEncryption/AzureDiskEncryptionForLinux*.xml
VMEncryption/ADEForLinux*.xml
VMEncryption/MANIFEST



================================================
FILE: .gitmodules
================================================
[submodule "Common/azure-sdk-for-python"]
	path = Common/azure-sdk-for-python
	url = https://github.com/Azure/azure-sdk-for-python.git
[submodule "Common/psutil"]
	path = Common/psutil
	url = https://github.com/giampaolo/psutil.git
[submodule "VMEncryption/transitions"]
	path = VMEncryption/transitions
	url = https://github.com/tyarkoni/transitions.git


================================================
FILE: .vscode/launch.json
================================================
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: test_encode.py",
            "type": "python",
            "request": "launch",
            "program": "test_encode.py",
            "console": "integratedTerminal",
            "justMyCode": true,
            "cwd": "${workspaceFolder}/Utils/test",
            "env" : {
                "PYTHONPATH": "${workspaceFolder}"
            }
        }
    ]
}

================================================
FILE: AzureEnhancedMonitor/README.md
================================================
# How to enable Azure Enhanced Monitoring on Linux VM

This is an instruction about how to enable Azure Enhanced Monitoring(AEM) on Azure Linux VM. 

## Install Azure CLI

First of all, you need to to install [Azure CLI][azure-cli]

**NOTE** This feature is currently on developing. You need to install it from github by running the following command.
```
npm -g install git+https://github.com/yuezh/azure-xplat-cli.git#dev
```

## Configure Azure Enhanced Monitoring

1. Login with your Azure account

    ```
    azure login
    ```
2. Switch to azure resource management mode

    ```
    azure config mode arm
    ```
3. Enable Azure Enhanced Monitoring

    ```
    azure vm enable-aem <resource-group-name> <vm-name>
    ```  
4. Verify that the Azure Enhanced Monitoring is active on the Azure Linux VM. Check if the file  /var/lib/AzureEnhancedMonitor/PerfCounters exists. If exists, display information collected by AEM with:

    ```
    cat /var/lib/AzureEnhancedMonitor/PerfCounters
    ```
    Then you will get output like:
    
    ```
    2;cpu;Current Hw Frequency;;0;2194.659;MHz;60;1444036656;saplnxmon;
    2;cpu;Max Hw Frequency;;0;2194.659;MHz;0;1444036656;saplnxmon;
    …
    …
    ```

[azure-cli]: https://azure.microsoft.com/en-us/documentation/articles/xplat-cli/


================================================
FILE: AzureEnhancedMonitor/bin/pack.sh
================================================
#!/bin/bash
proj_name="aem"
proj_version="1.0"

proj_full_name="$proj_name-$proj_version"

script=$(dirname $0)
root=$script/..
cd $root
root=`pwd`

build_dir=$root/build
target_dir=$build_dir/$proj_full_name

mkdir -p $build_dir
mkdir -p $target_dir

cd $root/clib
make clean

cp -r $root/nodejs $build_dir
cd $build_dir/nodejs
npm pack

cp -r $root/clib $target_dir
cp $build_dir/nodejs/*.tgz $target_dir
cp $root/bin/setup.sh $target_dir
chmod +x $root/bin/setup.sh

#install.sh is a self-extracting script.
#The begin of this file is sh script while the end is a tar
echo "#!/bin/bash"                              >  $build_dir/install.sh
echo "#"                                        >> $build_dir/install.sh
echo "#Auto-generated. Do NOT edit this file."  >> $build_dir/install.sh
echo "#"                                        >> $build_dir/install.sh
echo "root=\$(dirname \$0)"                     >> $build_dir/install.sh
echo "cd \$root"                                >> $build_dir/install.sh
echo "root=\`pwd\`"                             >> $build_dir/install.sh
echo "if [ -d $proj_full_name ]; then"          >> $build_dir/install.sh
echo "    echo \"[INFO]Remove old package...\"" >> $build_dir/install.sh
echo "    rm $proj_full_name -rf"               >> $build_dir/install.sh
echo "fi"                                       >> $build_dir/install.sh
echo "echo \"[INFO]Unpacking...\""              >> $build_dir/install.sh
echo "sed -e '1,/^exit$/d' "\$0" | tar xzf -"   >> $build_dir/install.sh
echo "$proj_full_name/setup.sh"                 >> $build_dir/install.sh
echo "exit"                                     >> $build_dir/install.sh
cd $build_dir
tar czf - $proj_full_name                       >> $build_dir/install.sh
chmod +x $build_dir/install.sh


cp -r $root/clib $build_dir
cd $build_dir
tar czf clib.tar.gz clib/



================================================
FILE: AzureEnhancedMonitor/bin/setup.sh
================================================
#!/bin/bash

install_log=`pwd`/install.log
root=$(dirname $0)
cd $root
root=`pwd`

if [[ $EUID -ne 0 ]]; then
    echo "[ERROR]This script must be run as root" 1>&2
    exit 1
fi

function install_nodejs_tarball()
{
    version="v0.10.37"
    node_version="node-$version-linux-x64"
    src="$root/$node_version"
    target="/usr/local"

    echo "[INFO]Installing nodejs from http://nodejs.org/dist/$version/${node_version}.tar.gz"
    if [ -f ${src}.tar.gz ]; then
        rm ${src}.tar.gz -f
    fi
    if [ -d ${src} ]; then
        rm ${src} -rf
    fi
    wget http://nodejs.org/dist/$version/${node_version}.tar.gz 1>>$install_log 2>&1
    tar -zxf ${node_version}.tar.gz  1>>$install_log 2>&1

    echo "[INFO]Install nodejs to $target"
    if [ -f $target/bin/node ]; then
        rm $target/bin/node -f
    fi
    cp $src/bin/node $target/bin/node
    
    echo "[INFO]Create link to $target/bin/node"
    if [ -f /usr/bin/node ]; then
        rm /usr/bin/node -f
    fi
    ln -s $target/bin/node /usr/bin/node
   
    echo "[INFO]Install npm"
    curl -sL https://www.npmjs.org/install.sh | sh 1>>$install_log 2>&1

}

function install_nodejs()
{
    echo "[INFO]Installing nodejs and npm"
    if [ "$(type apt-get 2>/dev/null)" != "" ] ; then
        curl -sL https://deb.nodesource.com/setup | bash - 1>>$install_log 2>&1
        apt-get -y install nodejs 1>>$install_log 2>&1
    elif [ "$(type yum 2>/dev/null)" != "" ] ; then
        curl -sL https://rpm.nodesource.com/setup | bash - 1>>$install_log 2>&1
        yum -y install nodejs 1>>$install_log 2>&1
    else
        install_nodejs_tarball 
    fi
    if [ ! $? ]; then
        echo "[ERROR]Install nodejs and npm failed. See $install_log."
        exit 1
    fi
}

echo "[INFO]Checking dependency..."
echo "" > $install_log
if [ "$(type node 2>/dev/null)" == "" ]; then
    install_nodejs
fi
echo "[INFO]  nodejs version: $(node --version)"

if [ "$(type npm 2>/dev/null)" == "" ]; then
    install_nodejs
fi
echo "[INFO]  npm version: $(npm -version)"

if [ "$(type azure 2> /dev/null)" == "" ]; then
    echo "[INFO]Installing azure-cli"
    npm install -g azure-cli 1>>$install_log 2>&1
    if [ ! $? ]; then
        echo "[ERROR]Install azure-cli failed. See $install_log."
        exit 1
    fi
fi
echo "[INFO]  azure-cli version: $(azure --version)"

npm_pkg="azure-linux-tools-1.0.0.tgz"
echo "[INFO]Installing Azure Enhanced Monitor tools..."
if [ -f ./$npm_pkg ]; then
    npm install -g ./$npm_pkg 1>>$install_log 2>&1
    if [ ! $? ]; then
        echo "[ERROR]Install Azure Enhanced Monitor tools failed. See $install_log."
        exit 1
    fi
else
    echo "[ERROR] Couldn't find npm package $npm_pkg"
    exit 1
fi

echo "[INFO]Finished."


================================================
FILE: AzureEnhancedMonitor/clib/.gitignore
================================================
bin/*


================================================
FILE: AzureEnhancedMonitor/clib/Makefile
================================================
CC := gcc
SRCDIR := src
LIBDIR := lib
INCDIR := include
BUILDDIR := build
TARGET := $(LIBDIR)/libazureperf.so

SRCEXT := c
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
CFLAGS := -g -fPIC
LDFLAGS := -shared
INC := -I $(INCDIR)
LIB := -L $(LIBDIR)

all : $(TARGET)

$(TARGET): $(OBJECTS)
	@echo "Linking..."
	$(CC) $^ $(LDFLAGS) -o $(TARGET) $(LIB)

$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
	@mkdir -p $(BUILDDIR)
	@echo "Compiling..."
	$(CC) $(CFLAGS) $(INC) -c -o $@ $<

clean:
	@echo "Cleaning..."
	$(RM) -r $(BUILDDIR) $(TARGET)

test: $(OBJECTS)
	@echo "Run test"
	$(CC) test/runtest.c $^ $(INC) -L $(LIBDIR) -lazureperf -o bin/runtest
	bin/runtest

install:
	mkdir -p /usr/lib/azureperf
	cp $(TARGET) /usr/lib/azureperf
	echo "/usr/lib/azureperf" > /etc/ld.so.conf.d/azureperf.conf
	ldconfig
	cp $(INCDIR)/azureperf.h /usr/include

.PHONY: clean test


================================================
FILE: AzureEnhancedMonitor/clib/include/azureperf.h
================================================
//
// Copyright 2014 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef AZURE_PERF
#define AZURE_PERF

/*All the strings are utf-8 encoded*/

/*The max buf size for all string*/
#define STR_BUF_MAX         (256)

#define TYPE_NAME_MAX       (64)
#define PROPERTY_NAME_MAX   (128)
#define INSTANCE_NAME_MAX   (256)
#define STRING_VALUE_MAX    (256)
#define UNIT_NAME_MAX       (64)
#define MACHINE_NAME_MAX    (128)

#define PERF_COUNT_MAX      (128)

#define PERF_COUNTER_TYPE_INVALID	(0)
#define PERF_COUNTER_TYPE_INT		(1)
#define PERF_COUNTER_TYPE_DOUBLE	(2)
#define PERF_COUNTER_TYPE_LARGE	    (3)
#define PERF_COUNTER_TYPE_STRING	(4)

#define AP_ERR_PC_NOT_FOUND                 (-1)
#define AP_ERR_PC_BUF_OVERFLOW              (-2) 
#define AP_ERR_INVALID_COUNTER_TYPE         (-11)
#define AP_ERR_INVALID_TYPE_NAME            (-12)
#define AP_ERR_INVALID_PROPERTY_NAME        (-13)
#define AP_ERR_INVALID_INSTANCE_NAME        (-14)
#define AP_ERR_INVALID_IS_EMPTY_FLAG        (-15)
#define AP_ERR_INVALID_VALUE                (-15)
#define AP_ERR_INVALID_UNIT_NAME            (-16)
#define AP_ERR_INVALID_REFRESH_INTERVAL     (-17)
#define AP_ERR_INVALID_TIMESTAMP            (-18)
#define AP_ERR_INVALID_MACHINE_NAME         (-19)


typedef struct 
{
	int			    counter_typer;
	char			type_name[TYPE_NAME_MAX];
	char			property_name[PROPERTY_NAME_MAX];
	char			instance_name[STRING_VALUE_MAX];	
    int             is_empty;
    union {
        int         val_int;
        long long   val_large;
        double      val_double;
        char        val_str[STRING_VALUE_MAX];
    };
	char			unit_name[UNIT_NAME_MAX];
    unsigned int	refresh_interval;
	long long		timestamp;
	char			machine_name[MACHINE_NAME_MAX];	
    
} perf_counter;

typedef struct
{
    perf_counter    buf[PERF_COUNT_MAX]; 
    int             len; 
    int             err;
    char            *ap_file;
} ap_handler;

ap_handler* ap_open();

extern void ap_close(ap_handler* handler);

extern void ap_refresh(ap_handler* handler);

extern int ap_metric_all(ap_handler *handler, perf_counter *pc, size_t size);

//config\Cloud Provider
extern int ap_metric_config_cloud_provider(ap_handler *handler, perf_counter *pc, size_t size);

//config\CPU Over-Provisioning
extern int ap_metric_config_cpu_over_provisioning(ap_handler *handler, perf_counter *pc, size_t size);

//config\Memory Over-Provisioning
extern int ap_metric_config_memory_over_provisioning(ap_handler *handler, perf_counter *pc, size_t size);

//config\Data Provider Version
extern int ap_metric_config_data_provider_version(ap_handler *handler, perf_counter *pc, size_t size);

//config\Data Sources
extern int ap_metric_config_data_sources(ap_handler *handler, perf_counter *pc, size_t size);

//config\Instance Type
extern int ap_metric_config_instance_type(ap_handler *handler, perf_counter *pc, size_t size);

//config\Virtualization Solution
extern int ap_metric_config_virtualization_solution(ap_handler *handler, perf_counter *pc, size_t size);

//config\Virtualization Solution Version
extern int ap_metric_config_virtualization_solution_version(ap_handler *handler, perf_counter *pc, size_t size);

//cpu\Current Hw Frequency
extern int ap_metric_cpu_current_hw_frequency(ap_handler *handler, perf_counter *pc, size_t size);

//cpu\Max Hw Frequency
extern int ap_metric_cpu_max_hw_frequency(ap_handler *handler, perf_counter *pc, size_t size);

//cpu\Current VM Processing Power
extern int ap_metric_cpu_current_vm_processing_power(ap_handler *handler, perf_counter *pc, size_t size);

//cpu\Guaranteed VM Processing Power
extern int ap_metric_cpu_guaranteed_vm_processing_power(ap_handler *handler, perf_counter *pc, size_t size);

//cpu\Max. VM Processing Power
extern int ap_metric_cpu_max_vm_processing_power(ap_handler *handler, perf_counter *pc, size_t size);

//cpu\Number of Cores per CPU
extern int ap_metric_cpu_number_of_cores_per_cpu(ap_handler *handler, perf_counter *pc, size_t size);

//cpu\Number of Threads per Core
extern int ap_metric_cpu_number_of_threads_per_core(ap_handler *handler, perf_counter *pc, size_t size);

//cpu\Phys. Processing Power per vCPU
extern int ap_metric_cpu_phys_processing_power_per_vcpu(ap_handler *handler, perf_counter *pc, size_t size);

//cpu\Processor Type
extern int ap_metric_cpu_processor_type(ap_handler *handler, perf_counter *pc, size_t size);

#endif


================================================
FILE: AzureEnhancedMonitor/clib/src/apmetric.c
================================================
//
// Copyright 2014 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

//
// This file is auto-generated, don't modify it directly.
//

#include <stdlib.h> 
#include <azureperf.h> 

int ap_metric_config_cloud_provider(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "config", "Cloud Provider", size);
}

int ap_metric_config_cpu_over_provisioning(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "config", "CPU Over-Provisioning", size);
}

int ap_metric_config_memory_over_provisioning(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "config", "Memory Over-Provisioning", size);
}

int ap_metric_config_data_provider_version(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "config", "Data Provider Version", size);
}

int ap_metric_config_data_sources(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "config", "Data Sources", size);
}

int ap_metric_config_instance_type(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "config", "Instance Type", size);
}

int ap_metric_config_virtualization_solution(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "config", "Virtualization Solution", size);
}

int ap_metric_config_virtualization_solution_version(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "config", "Virtualization Solution Version", size);
}

int ap_metric_cpu_current_hw_frequency(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "Current Hw Frequency", size);
}

int ap_metric_cpu_max_hw_frequency(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "Max Hw Frequency", size);
}

int ap_metric_cpu_current_vm_processing_power(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "Current VM Processing Power", size);
}

int ap_metric_cpu_guaranteed_vm_processing_power(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "Guaranteed VM Processing Power", size);
}

int ap_metric_cpu_max_vm_processing_power(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "Max. VM Processing Power", size);
}

int ap_metric_cpu_number_of_cores_per_cpu(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "Number of Cores per CPU", size);
}

int ap_metric_cpu_number_of_threads_per_core(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "Number of Threads per Core", size);
}

int ap_metric_cpu_phys_processing_power_per_vcpu(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "Phys. Processing Power per vCPU", size);
}

int ap_metric_cpu_processor_type(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "Processor Type", size);
}

int ap_metric_cpu_reference_compute_unit(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "Reference Compute Unit", size);
}

int ap_metric_cpu_vcpu_mapping(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "vCPU Mapping", size);
}

int ap_metric_cpu_vm_processing_power_consumption(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "cpu", "VM Processing Power Consumption", size);
}

int ap_metric_memory_current_memory_assigned(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "memory", "Current Memory assigned", size);
}

int ap_metric_memory_guaranteed_memory_assigned(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "memory", "Guaranteed Memory assigned", size);
}

int ap_metric_memory_max_memory_assigned(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "memory", "Max Memory assigned", size);
}

int ap_metric_memory_vm_memory_consumption(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "memory", "VM Memory Consumption", size);
}

int ap_metric_network_adapter_id(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "network", "Adapter Id", size);
}

int ap_metric_network_mapping(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "network", "Mapping", size);
}

int ap_metric_network_min_network_bandwidth(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "network", "Minimum Network Bandwidth", size);
}

int ap_metric_network_max_network_bandwidth(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "network", "Maximum Network Bandwidth", size);
}

int ap_metric_network_network_read_bytes(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "network", "Network Read Bytes", size);
}

int ap_metric_network_network_write_bytes(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "network", "Network Write Bytes", size);
}

int ap_metric_network_packets_retransmitted(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "network", "Packets Retransmitted", size);
}

int ap_metric_config_last_hardware_change(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "config", "Last Hardware Change", size);
}

int ap_metric_storage_phys_disc_to_storage_mapping(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Phys. Disc to Storage Mapping", size);
}

int ap_metric_storage_storage_id(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage ID", size);
}

int ap_metric_storage_read_bytes(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage Read Bytes", size);
}

int ap_metric_storage_read_ops(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage Read Ops", size);
}

int ap_metric_storage_read_op_latency_e2e(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage Read Op Latency E2E msec", size);
}

int ap_metric_storage_read_op_latency_server(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage Read Op Latency Server msec", size);
}

int ap_metric_storage_read_throughput_e2e(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage Read Throughput E2E MB/sec", size);
}

int ap_metric_storage_write_bytes(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage Write Bytes", size);
}

int ap_metric_storage_write_ops(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage Write Ops", size);
}

int ap_metric_storage_write_op_latency_e2e(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage Write Op Latency E2E msec", size);
}

int ap_metric_storage_write_op_latency_server(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage Write Op Latency Server msec", size);
}

int ap_metric_storage_write_throughput_e2e(ap_handler *handler, perf_counter *pc, size_t size)
{
    if(handler->err)
    {
        return 0;
    }
    return get_metric(handler, pc, "storage", "Storage Write Throughput E2E MB/sec", size);
}



================================================
FILE: AzureEnhancedMonitor/clib/src/azureperf.c
================================================
//
// Copyright 2014 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <errno.h>
#include <azureperf.h> 

#define INTMIN(X, Y) (((X) < (Y)) ? (X) : (Y))
#define INTMAX(X, Y) (((X) > (Y)) ? (X) : (Y))

#define MATCH_SUCCESS       (1)
#define MATCH_FAILED        (0)
#define MATCH_EOF           (-1)
#define STRICT_MATCH        (1)
#define NON_STRICT_MATCH    (0)

static char FIELD_SEPRATOR = ';';
static char DEFAULT_AP_FILE[] = "/var/lib/AzureEnhancedMonitor/PerfCounters";

ap_handler* ap_open()
{
    ap_handler *handler = malloc(sizeof(ap_handler));
    handler->ap_file = DEFAULT_AP_FILE;
    memset(handler, 0, sizeof(ap_handler));
    return handler;
}

void ap_close(ap_handler *handler)
{
    free(handler);
}

int read_sperator(FILE *fp, int strict)
{
    int c;
    c = fgetc(fp);
    //In non-strict mode, Read and discard chars until EOF or FIELD_SEPRATOR
    while(strict == NON_STRICT_MATCH && c != EOF && c != FIELD_SEPRATOR)
    {
        c = fgetc(fp);
    }
    if(c == EOF)
    {
        return MATCH_EOF;
    }
    if(c != FIELD_SEPRATOR)
    {
        return MATCH_FAILED;
    }
    else
    {
        return MATCH_SUCCESS;
    }
}

int read_int(FILE *fp, int *val)
{
    int ret = EOF;
    ret = fscanf(fp, "%d", val);
    if(ret == EOF)
    {
        return MATCH_EOF;
    }
    if(ret != 1)
    {
        return MATCH_FAILED;
    }
    else
    {
        return read_sperator(fp, STRICT_MATCH);
    }
}

int read_int64(FILE *fp, long long *val)
{
    int ret = EOF;
    ret = fscanf(fp, "%Ld", val);
    if(ret == EOF)
    {
        return MATCH_EOF;
    }
    if(ret != 1)
    {
        return MATCH_FAILED;
    }
    else
    {
        return read_sperator(fp, STRICT_MATCH);
    } 
}

int read_double(FILE *fp, double *val)
{
    int ret = EOF;
    ret = fscanf(fp, "%lf", val);
    if(ret == EOF)
    {
        return MATCH_EOF;
    }
    if(ret != 1)
    {
        return MATCH_FAILED;
    }
    else
    {
        return read_sperator(fp, STRICT_MATCH);
    } 
}

int read_str(FILE *fp, char* str, int max_size)
{
    char buf[STR_BUF_MAX];
    int c = EOF;
    int i = 0;

    if(max_size > STR_BUF_MAX)
    {
        return MATCH_FAILED;
    }

    memset(buf, 0, STR_BUF_MAX);
    for(; i < max_size - 1; i++)
    {
        c = fgetc(fp);
        if(c == EOF)
        {
            return MATCH_EOF;
        }
        if(c == FIELD_SEPRATOR)
        {
            break;
        }
        buf[i] = c;
    }
    strncpy(str, buf, i);
    if(c == FIELD_SEPRATOR)
    {
        return MATCH_SUCCESS;
    }
    else//Reaches buf max, discard the rest part of string
    {
        return read_sperator(fp, NON_STRICT_MATCH); 
    }
}

void set_handler_err(ap_handler *handler, int err)
{
    handler->err = err;
}

int read_pc_from_file(ap_handler* handler, FILE *fp)
{
    int ret = MATCH_FAILED;
    perf_counter *pc;

    if(handler->len == PERF_COUNT_MAX)
    {
        handler->err = AP_ERR_PC_BUF_OVERFLOW; 
        goto EXIT; 
    }
    pc = &handler->buf[handler->len];

    ret = read_int(fp, &pc->counter_typer);
    if(ret == MATCH_EOF)
    {
        goto EXIT; 
    }
    if(ret != MATCH_SUCCESS)
    {
        set_handler_err(handler, AP_ERR_INVALID_COUNTER_TYPE);
        goto EXIT;
    }

    ret = read_str(fp, pc->type_name, TYPE_NAME_MAX);
    if(ret != MATCH_SUCCESS)
    {
        set_handler_err(handler, AP_ERR_INVALID_TYPE_NAME);
        goto EXIT;
    }

    ret = read_str(fp, pc->property_name, PROPERTY_NAME_MAX);
    if(ret != MATCH_SUCCESS)
    {
        set_handler_err(handler, AP_ERR_INVALID_PROPERTY_NAME);
        goto EXIT;
    }

    ret = read_str(fp, pc->instance_name, INSTANCE_NAME_MAX);
    if(ret != MATCH_SUCCESS)
    {
        set_handler_err(handler, AP_ERR_INVALID_INSTANCE_NAME);
        goto EXIT;
    }
    
    ret = read_int(fp, &pc->is_empty);
    if(ret != MATCH_SUCCESS)
    {
        set_handler_err(handler, AP_ERR_INVALID_IS_EMPTY_FLAG);
        goto EXIT;
    }

    if(!pc->is_empty)
    {
        switch(pc->counter_typer)
        {
            case PERF_COUNTER_TYPE_INT:
               ret = read_int(fp, &pc->val_int);
               break;
            case PERF_COUNTER_TYPE_LARGE:
               ret = read_int64(fp, &pc->val_large);
               break;
            case PERF_COUNTER_TYPE_DOUBLE:
               ret = read_double(fp, &pc->val_double);
               break;
            case PERF_COUNTER_TYPE_STRING:
               ret = read_str(fp, pc->val_str, STRING_VALUE_MAX);
               break;
        }
        if(ret != MATCH_SUCCESS)
        {
            set_handler_err(handler, AP_ERR_INVALID_VALUE);
            goto EXIT;
        }
    }
    else
    {
        ret = read_sperator(fp, NON_STRICT_MATCH);
        if(ret != MATCH_SUCCESS)
        {
            set_handler_err(handler, AP_ERR_INVALID_VALUE);
            goto EXIT;
        }
    }
    
    ret = read_str(fp, pc->unit_name, UNIT_NAME_MAX);
    if(ret != MATCH_SUCCESS)
    {
        set_handler_err(handler, AP_ERR_INVALID_UNIT_NAME);
        goto EXIT;
    }

    ret = read_int(fp, &pc->refresh_interval);
    if(ret != MATCH_SUCCESS)
    {
        set_handler_err(handler, AP_ERR_INVALID_REFRESH_INTERVAL);
        goto EXIT;
    }

    ret = read_int64(fp, &pc->timestamp);
    if(ret != MATCH_SUCCESS)
    {
        set_handler_err(handler, AP_ERR_INVALID_TIMESTAMP);
        goto EXIT;
    }

    ret = read_str(fp, pc->machine_name, MACHINE_NAME_MAX);
    if(ret != MATCH_SUCCESS)
    {
        set_handler_err(handler, AP_ERR_INVALID_MACHINE_NAME);
        goto EXIT;
    }

    handler->len++;

    //Discard line end if exits.
    fscanf(fp, "\n");
    
EXIT:
    return ret;
}

void ap_refresh(ap_handler *handler)
{
    FILE *fp = 0;
    perf_counter *next = 0;
   
    //Reset handler 
    memset(handler->buf, 0, sizeof(perf_counter) * PERF_COUNT_MAX);
    handler->len = 0;
   
    errno = 0;
    fp = fopen(handler->ap_file, "r");
    if(errno || 0 == fp){
        handler->err = errno;
        goto EXIT;  
    }
    
    while(read_pc_from_file(handler, fp) != EOF)
    {
        if(handler->err != 0)
        {
            goto EXIT;
        }
    }

EXIT:
    if(fp)
    {
        fclose(fp);
    }
}

int ap_metric_all(ap_handler *handler, perf_counter *all, size_t size)
{
    int size_to_cp = 0;
    if(handler->err)
    {
        return;
    }
    size_to_cp = INTMIN(handler->len, size);
    if(size_to_cp > 0)
    {
        memcpy(all, handler->buf, sizeof(perf_counter) * size_to_cp);
    }
    return size_to_cp;
}

int get_metric(ap_handler *handler, perf_counter *pc, 
        const char *type_name, const char* property_name, size_t size)
{
    int i = 0; 
    int found = 0;
    for(;i < handler->len && found < size; i++)
    {
        if(0 == strcmp(handler->buf[i].type_name, type_name) && 
                0 == strcmp(handler->buf[i].property_name, property_name))
        {
            memcpy(pc + found, &handler->buf[i], sizeof(perf_counter));
            found++;
        }
    }
    if(!found)
    {
        handler->err = AP_ERR_PC_NOT_FOUND;
    }
    return found;
}



================================================
FILE: AzureEnhancedMonitor/clib/test/cases/positive_case
================================================
2;cpu;Current Hw Frequency;;0;2194.507;MHz;60;1423450780;aem-suse11sp3;
2;cpu;Max Hw Frequency;;0;2194.507;MHz;0;1423450780;aem-suse11sp3;
1;cpu;Current VM Processing Power;;0;1;compute unit;0;1423450780;aem-suse11sp3;
1;cpu;Guaranteed VM Processing Power;;0;1;compute unit;0;1423450780;aem-suse11sp3;
1;cpu;Max. VM Processing Power;;0;1;compute unit;0;1423450780;aem-suse11sp3;
1;cpu;Number of Cores per CPU;;0;1;none;0;1423450780;aem-suse11sp3;
1;cpu;Number of Threads per Core;;0;1;none;0;1423450780;aem-suse11sp3;
2;cpu;Phys. Processing Power per vCPU;;0;1.0;none;0;1423450780;aem-suse11sp3;
4;cpu;Processor Type;;0;Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz, GenuineIntel;none;0;1423450780;aem-suse11sp3;
4;cpu;Reference Compute Unit;;0;Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz, GenuineIntel;none;0;1423450780;aem-suse11sp3;
4;cpu;vCPU Mapping;;0;core;none;0;1423450780;aem-suse11sp3;
2;cpu;VM Processing Power Consumption;;0;1.0;%;60;1423450480;aem-suse11sp3;
1;memory;Current Memory assigned;;0;1681;MB;0;1423450780;aem-suse11sp3;
1;memory;Guaranteed Memory assigned;;0;1681;MB;0;1423450780;aem-suse11sp3;
1;memory;Max Memory assigned;;0;1681;MB;0;1423450780;aem-suse11sp3;
2;memory;VM Memory Consumption;;0;10.0;%;60;1423450480;aem-suse11sp3;
4;network;Adapter Id;eth0;0;eth0;none;0;1423450780;aem-suse11sp3;
4;network;Mapping;eth0;0;00-0d-3a-20-7c-81;none;0;1423450780;aem-suse11sp3;
1;network;Minimum Network Bandwidth;eth0;0;1000;Mbit/s;0;1423450780;aem-suse11sp3;
1;network;Maximum Network Bandwidth;eth0;0;1000;Mbit/s;0;1423450780;aem-suse11sp3;
3;network;Network Read Bytes;;0;60676750;byte/s;0;1423450780;aem-suse11sp3;
3;network;Network Write Bytes;;0;11596695;byte/s;0;1423450780;aem-suse11sp3;
1;network;Packets Retransmitted;;0;279;packets/min;0;1423450780;aem-suse11sp3;
3;config;Last Hardware Change;;0;1423449729;posixtime;0;1423450780;aem-suse11sp3;
4;storage;Phys. Disc to Storage Mapping;/dev/sdb;0;not mapped to vhd;none;0;1423450780;aem-suse11sp3;
4;storage;Phys. Disc to Storage Mapping;/dev/sda;0;portalvhdsz0msmsvh2cnqj aem-suse11sp3-aem-suse11sp3-0-201502071338440211;none;0;1423450780;aem-suse11sp3;
4;storage;Storage ID;portalvhdsz0msmsvh2cnqj;0;portalvhdsz0msmsvh2cnqj;none;0;1423450781;aem-suse11sp3;
3;storage;Storage Read Bytes;portalvhdsz0msmsvh2cnqj;0;424198985;byte;60;1423450781;aem-suse11sp3;
1;storage;Storage Read Ops;portalvhdsz0msmsvh2cnqj;0;2183;none;60;1423450781;aem-suse11sp3;
2;storage;Storage Read Op Latency E2E msec;portalvhdsz0msmsvh2cnqj;0;64.7292721223;ms;60;1423450781;aem-suse11sp3;
2;storage;Storage Read Op Latency Server msec;portalvhdsz0msmsvh2cnqj;0;20.0522214489;ms;60;1423450781;aem-suse11sp3;
2;storage;Storage Read Throughput E2E MB/sec;portalvhdsz0msmsvh2cnqj;0;6.742461284;MB/s;60;1423450781;aem-suse11sp3;
3;storage;Storage Write Bytes;portalvhdsz0msmsvh2cnqj;0;208673771;byte;60;1423450781;aem-suse11sp3;
1;storage;Storage Write Ops;portalvhdsz0msmsvh2cnqj;0;3860;none;60;1423450781;aem-suse11sp3;
2;storage;Storage Write Op Latency E2E msec;portalvhdsz0msmsvh2cnqj;0;14.3150263047;ms;60;1423450781;aem-suse11sp3;
2;storage;Storage Write Op Latency Server msec;portalvhdsz0msmsvh2cnqj;0;14.0740937373;ms;60;1423450781;aem-suse11sp3;
2;storage;Storage Write Throughput E2E MB/sec;portalvhdsz0msmsvh2cnqj;0;3.31678026517;MB/s;60;1423450781;aem-suse11sp3;
4;config;Cloud Provider;;0;Microsoft Azure;none;0;1423450781;aem-suse11sp3;
4;config;CPU Over-Provisioning;;0;no;none;0;1423450781;aem-suse11sp3;
4;config;Memory Over-Provisioning;;0;no;none;0;1423450781;aem-suse11sp3;
4;config;Data Provider Version;;0;1.0.0;none;0;1423450781;aem-suse11sp3;
4;config;Data Sources;;0;lad;none;0;1423450781;aem-suse11sp3;
4;config;Instance Type;;0;Small;none;0;1423450781;aem-suse11sp3;
4;config;Virtualization Solution;;0;Microsoft Hv;none;0;1423450781;aem-suse11sp3;
4;config;Virtualization Solution Version;;0;6.3;none;0;1423450781;aem-suse11sp3;


================================================
FILE: AzureEnhancedMonitor/clib/test/codegen.py
================================================
#!/usr/bin/env python
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import re
import os

code_start="""\
//
// Copyright 2014 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

//
// This file is auto-generated, don't modify it directly.
//

#include <stdlib.h> 
#include <azureperf.h> 

"""

code_tmpl="""\
int ap_metric_{0}_{1}(ap_handler *handler, perf_counter *pc, size_t size)
{{
    if(handler->err)
    {{
        return 0;
    }}
    return get_metric(handler, pc, "{2}", "{3}", size);
}}

"""

head_tmpl="""\
//{0}\{1}
extern int ap_metric_{2}_{3}(ap_handler *handler, perf_counter *pc, size_t size);

"""

test_root = os.path.dirname(os.path.abspath(__file__))

if __name__ == "__main__":

    with open(os.path.join(test_root, "counter_names"), "r") as file_in, \
         open(os.path.join(test_root, "../src/apmetric.c"), "w") as file_out, \
         open(os.path.join(test_root, "../build/metric_def"), "w") as head_out:

        lines = file_in.read().split("\n")
        
        file_out.write(code_start)
        for line in lines:
            match = re.match("([^;]*);([^;]*);([^;]*)", line)
            if match is not None:
                type_name = match.group(1)
                prop_name = match.group(2)
                short_name = match.group(3)
                short_name = short_name.lower()
                short_name = short_name.replace(" ", "_")
                short_name = short_name.replace("-", "_")
                code_snippet = code_tmpl.format(type_name.lower(),
                                                short_name,
                                                type_name,
                                                prop_name)
                file_out.write(code_snippet)
                head_snippet = head_tmpl.format(type_name,
                                                prop_name,
                                                type_name.lower(),
                                                short_name)
                head_out.write(head_snippet)
                print("printf(\">>>>ap_metric_{0}_{1}\\n\");".format(type_name, short_name))
                print("ap_metric_{0}_{1}(handler, &pc, 1);".format(type_name, short_name))
                print("print_counter(&pc);")




================================================
FILE: AzureEnhancedMonitor/clib/test/counter_names
================================================
config;Cloud Provider;Cloud Provider
config;CPU Over-Provisioning;CPU Over-Provisioning
config;Memory Over-Provisioning;Memory Over-Provisioning
config;Data Provider Version;Data Provider Version
config;Data Sources;Data Sources
config;Instance Type;Instance Type
config;Virtualization Solution;Virtualization Solution
config;Virtualization Solution Version;Virtualization Solution Version
cpu;Current Hw Frequency;Current Hw Frequency
cpu;Max Hw Frequency;Max Hw Frequency
cpu;Current VM Processing Power;Current VM Processing Power
cpu;Guaranteed VM Processing Power;Guaranteed VM Processing Power
cpu;Max. VM Processing Power;Max VM Processing Power
cpu;Number of Cores per CPU;Number of Cores per CPU
cpu;Number of Threads per Core;Number of Threads per Core
cpu;Phys. Processing Power per vCPU;Phys Processing Power per vCPU
cpu;Processor Type;Processor Type
cpu;Reference Compute Unit;Reference Compute Unit
cpu;vCPU Mapping;vCPU Mapping
cpu;VM Processing Power Consumption;VM Processing Power Consumption
memory;Current Memory assigned;Current Memory assigned
memory;Guaranteed Memory assigned;Guaranteed Memory assigned
memory;Max Memory assigned;Max Memory assigned
memory;VM Memory Consumption;VM Memory Consumption
network;Adapter Id;Adapter Id
network;Mapping;Mapping
network;Minimum Network Bandwidth;Min Network Bandwidth
network;Maximum Network Bandwidth;Max Network Bandwidth
network;Network Read Bytes;Network Read Bytes
network;Network Write Bytes;Network Write Bytes
network;Packets Retransmitted;Packets Retransmitted
config;Last Hardware Change;Last Hardware Change
storage;Phys. Disc to Storage Mapping;Phys Disc to Storage Mapping
storage;Storage ID;Storage ID
storage;Storage Read Bytes;Read Bytes
storage;Storage Read Ops;Read Ops
storage;Storage Read Op Latency E2E msec;Read Op Latency E2E
storage;Storage Read Op Latency Server msec;Read Op Latency Server
storage;Storage Read Throughput E2E MB/sec;Read Throughput E2E
storage;Storage Write Bytes;Write Bytes
storage;Storage Write Ops;Write Ops
storage;Storage Write Op Latency E2E msec;Write Op Latency E2E
storage;Storage Write Op Latency Server msec;Write Op Latency Server
storage;Storage Write Throughput E2E MB/sec;Write Throughput E2E


================================================
FILE: AzureEnhancedMonitor/clib/test/runtest.c
================================================
//
// Copyright 2014 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#include <stdio.h>
#include <string.h>
#include <azureperf.h> 

static const char default_input[] = "./test/cases/positive_case";

int main(int argc, char ** argv)
{
    char* ap_file = (char*) default_input;
    if(argc == 2)
    {
        ap_file = argv[1];
    }
    printf("Parsing perf counters from: %s\n", ap_file);
    run_test(ap_file);
}

void print_counter(perf_counter *pc)
{
    printf("%-7s | %-24.24s | %-15.15s | ", pc->type_name, pc->property_name, 
            pc->instance_name);
    switch(pc->counter_typer)
    {
        case PERF_COUNTER_TYPE_INT:
            printf("%-30d", pc->val_int);
            break;
        case PERF_COUNTER_TYPE_LARGE:
            printf("%-30Ld", pc->val_large);
            break;
        case PERF_COUNTER_TYPE_DOUBLE:
            printf("%-30lf", pc->val_double);
            break;
        case PERF_COUNTER_TYPE_STRING:
        default:
            printf("%-30.30s", pc->val_str);
            break;
    }
    printf(" |\n");
}

int run_test(char* ap_file)
{
    int ret = 0;
    ap_handler *handler = 0;
    int i = 0;
    perf_counter pc;

    handler = ap_open();
    handler->ap_file = ap_file;
    ap_refresh(handler);
    if(handler->err)
    {
        ret = handler->err;
        printf("Error code:%d\n", handler->err);
        goto EXIT;
    }
    printf("Found counters:%d\n", handler->len);
    for(; i < handler->len; i++)
    {
        pc = handler->buf[i];
        print_counter(&pc);
        memset(&pc, 0 , sizeof(perf_counter));
    }

    printf(">>>>ap_metric_config_cloud_provider\n");
    ap_metric_config_cloud_provider(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_config_cpu_over_provisioning\n");
    ap_metric_config_cpu_over_provisioning(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_config_memory_over_provisioning\n");
    ap_metric_config_memory_over_provisioning(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_config_data_provider_version\n");
    ap_metric_config_data_provider_version(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_config_data_sources\n");
    ap_metric_config_data_sources(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_config_instance_type\n");
    ap_metric_config_instance_type(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_config_virtualization_solution\n");
    ap_metric_config_virtualization_solution(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_config_virtualization_solution_version\n");
    ap_metric_config_virtualization_solution_version(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_current_hw_frequency\n");
    ap_metric_cpu_current_hw_frequency(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_max_hw_frequency\n");
    ap_metric_cpu_max_hw_frequency(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_current_vm_processing_power\n");
    ap_metric_cpu_current_vm_processing_power(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_guaranteed_vm_processing_power\n");
    ap_metric_cpu_guaranteed_vm_processing_power(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_max_vm_processing_power\n");
    ap_metric_cpu_max_vm_processing_power(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_number_of_cores_per_cpu\n");
    ap_metric_cpu_number_of_cores_per_cpu(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_number_of_threads_per_core\n");
    ap_metric_cpu_number_of_threads_per_core(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_phys_processing_power_per_vcpu\n");
    ap_metric_cpu_phys_processing_power_per_vcpu(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_processor_type\n");
    ap_metric_cpu_processor_type(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_reference_compute_unit\n");
    ap_metric_cpu_reference_compute_unit(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_vcpu_mapping\n");
    ap_metric_cpu_vcpu_mapping(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_cpu_vm_processing_power_consumption\n");
    ap_metric_cpu_vm_processing_power_consumption(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_memory_current_memory_assigned\n");
    ap_metric_memory_current_memory_assigned(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_memory_guaranteed_memory_assigned\n");
    ap_metric_memory_guaranteed_memory_assigned(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_memory_max_memory_assigned\n");
    ap_metric_memory_max_memory_assigned(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_memory_vm_memory_consumption\n");
    ap_metric_memory_vm_memory_consumption(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_network_adapter_id\n");
    ap_metric_network_adapter_id(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_network_mapping\n");
    ap_metric_network_mapping(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_network_min_network_bandwidth\n");
    ap_metric_network_min_network_bandwidth(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_network_max_network_bandwidth\n");
    ap_metric_network_max_network_bandwidth(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_network_network_read_bytes\n");
    ap_metric_network_network_read_bytes(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_network_network_write_bytes\n");
    ap_metric_network_network_write_bytes(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_network_packets_retransmitted\n");
    ap_metric_network_packets_retransmitted(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_config_last_hardware_change\n");
    ap_metric_config_last_hardware_change(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_phys_disc_to_storage_mapping\n");
    ap_metric_storage_phys_disc_to_storage_mapping(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_storage_id\n");
    ap_metric_storage_storage_id(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_read_bytes\n");
    ap_metric_storage_read_bytes(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_read_ops\n");
    ap_metric_storage_read_ops(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_read_op_latency_e2e\n");
    ap_metric_storage_read_op_latency_e2e(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_read_op_latency_server\n");
    ap_metric_storage_read_op_latency_server(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_read_throughput_e2e\n");
    ap_metric_storage_read_throughput_e2e(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_write_bytes\n");
    ap_metric_storage_write_bytes(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_write_ops\n");
    ap_metric_storage_write_ops(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_write_op_latency_e2e\n");
    ap_metric_storage_write_op_latency_e2e(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_write_op_latency_server\n");
    ap_metric_storage_write_op_latency_server(handler, &pc, 1);
    print_counter(&pc);
    printf(">>>>ap_metric_storage_write_throughput_e2e\n");
    ap_metric_storage_write_throughput_e2e(handler, &pc, 1);
    print_counter(&pc);
    
EXIT:
    ap_close(handler);
    return ret;
}



================================================
FILE: AzureEnhancedMonitor/ext/.gitignore
================================================
bin/*
.ropeproject/


================================================
FILE: AzureEnhancedMonitor/ext/HandlerManifest.json
================================================
[{
  "name": "AzureEnhancedMonitor",
  "version": 1.0,
  "handlerManifest": {
    "installCommand": "installer.py",
    "uninstallCommand": "handler.py uninstall",
    "updateCommand": "handler.py update",
    "enableCommand": "handler.py enable",
    "disableCommand": "handler.py disable",
    "rebootAfterInstall": false,
    "reportHeartbeat": false
  }
}]


================================================
FILE: AzureEnhancedMonitor/ext/aem.py
================================================
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import re
import socket
import traceback
import time
import datetime
import psutil
import urlparse
import xml.dom.minidom as minidom
from azure.storage import TableService, Entity
from Utils.WAAgentUtil import waagent, AddExtensionEvent


FAILED_TO_RETRIEVE_MDS_DATA="(03100)Failed to retrieve mds data"
FAILED_TO_RETRIEVE_LOCAL_DATA="(03101)Failed to retrieve local data"
FAILED_TO_RETRIEVE_STORAGE_DATA="(03102)Failed to retrieve storage data"
FAILED_TO_SERIALIZE_PERF_COUNTERS="(03103)Failed to serialize perf counters"

def timedelta_total_seconds(delta):

    if not hasattr(datetime.timedelta, 'total_seconds'):
        return delta.days * 86400 + delta.seconds
    else:
        return delta.total_seconds()

def get_host_base_from_uri(blob_uri):
    uri = urlparse.urlparse(blob_uri)
    netloc = uri.netloc
    if netloc is None:
        return None
    return netloc[netloc.find('.'):]

MonitoringIntervalInMinute = 1 #One minute
MonitoringInterval = 60 * MonitoringIntervalInMinute

#It takes sometime before the performance date reaches azure table.
AzureTableDelayInMinute = 5 #Five minute
AzureTableDelay = 60 * AzureTableDelayInMinute

AzureEnhancedMonitorVersion = "2.0.0"
LibDir = "/var/lib/AzureEnhancedMonitor"

LatestErrorRecord = "LatestErrorRecord"

def clearLastErrorRecord():
    errFile = os.path.join(LibDir, LatestErrorRecord)
    if os.path.exists(errFile) and os.path.isfile(errFile):
        os.remove(errFile)

def getLatestErrorRecord():
    errFile=os.path.join(LibDir, LatestErrorRecord)
    if os.path.exists(errFile) and os.path.isfile(errFile):
        with open(errFile, 'r') as f:
            return f.read()

    return "0"

def updateLatestErrorRecord(s):
    errFile = os.path.join(LibDir, LatestErrorRecord)
    maxRetry = 3
    for i in range(0, maxRetry):
        try:
            with open(errFile, "w+") as F:
                F.write(s.encode("utf8"))
                return
        except IOError:
            time.sleep(1)

    waagent.Error(("Failed to serialize latest error record to file:"
                    "{0}").format(errFile))
    AddExtensionEvent(message="failed to write latest error record")
    raise

def easyHash(s):
    """
    MDSD used the following hash algorithm to cal a first part of partition key
    """
    strHash = 0
    multiplier = 37
    for c in s:
        strHash = strHash * multiplier + ord(c)
        #Only keep the last 64bit, since the mod base is 100
        strHash = strHash % (1<<64) 
    return strHash % 100 #Assume eventVolume is Large

Epoch = datetime.datetime(1, 1, 1)
tickInOneSecond = 1000 * 10000 # 1s = 1000 * 10000 ticks

def getMDSTimestamp(unixTimestamp):
    unixTime = datetime.datetime.utcfromtimestamp(unixTimestamp)
    startTimestamp = int(timedelta_total_seconds(unixTime - Epoch))
    return startTimestamp * tickInOneSecond

def getIdentity():
    identity = socket.gethostname()
    return identity

def getMDSPartitionKey(identity, timestamp):
    hashVal = easyHash(identity)
    return "{0:0>19d}___{1:0>19d}".format(hashVal, timestamp)

def getAzureDiagnosticKeyRange():
    #Round down by MonitoringInterval
    endTime = (int(time.time()) / MonitoringInterval) * MonitoringInterval
    endTime = endTime - AzureTableDelay
    startTime = endTime - MonitoringInterval

    identity = getIdentity()
    startKey = getMDSPartitionKey(identity, getMDSTimestamp(startTime))
    endKey = getMDSPartitionKey(identity, getMDSTimestamp(endTime))
    return startKey, endKey

def getAzureDiagnosticCPUData(accountName, accountKey, hostBase,
                              startKey, endKey, deploymentId):
    try:
        waagent.Log("Retrieve diagnostic data(CPU).")
        table = "LinuxCpuVer2v0"
        tableService = TableService(account_name = accountName, 
                                    account_key = accountKey,
                                    host_base = hostBase)
        ofilter = ("PartitionKey ge '{0}' and PartitionKey lt '{1}' "
                   "and DeploymentId eq '{2}'").format(startKey, endKey, deploymentId)
        oselect = ("PercentProcessorTime,DeploymentId")
        data = tableService.query_entities(table, ofilter, oselect, 1)
        if data is None or len(data) == 0:
            return None
        cpuPercent = float(data[0].PercentProcessorTime)
        return cpuPercent
    except Exception as e:
        waagent.Error((u"Failed to retrieve diagnostic data(CPU): {0} {1}"
                       "").format(e, traceback.format_exc()))
        updateLatestErrorRecord(FAILED_TO_RETRIEVE_MDS_DATA)
        AddExtensionEvent(message=FAILED_TO_RETRIEVE_MDS_DATA)
        return None
    

def getAzureDiagnosticMemoryData(accountName, accountKey, hostBase,
                                 startKey, endKey, deploymentId):
    try:
        waagent.Log("Retrieve diagnostic data: Memory")
        table = "LinuxMemoryVer2v0"
        tableService = TableService(account_name = accountName, 
                                    account_key = accountKey,
                                    host_base = hostBase)
        ofilter = ("PartitionKey ge '{0}' and PartitionKey lt '{1}' "
                   "and DeploymentId eq '{2}'").format(startKey, endKey, deploymentId)
        oselect = ("PercentAvailableMemory,DeploymentId")
        data = tableService.query_entities(table, ofilter, oselect, 1)
        if data is None or len(data) == 0:
            return None
        memoryPercent = 100 - float(data[0].PercentAvailableMemory)
        return memoryPercent
    except Exception as e:
        waagent.Error((u"Failed to retrieve diagnostic data(Memory): {0} {1}"
                       "").format(e, traceback.format_exc()))
        updateLatestErrorRecord(FAILED_TO_RETRIEVE_MDS_DATA)
        AddExtensionEvent(message=FAILED_TO_RETRIEVE_MDS_DATA)
        return None

class AzureDiagnosticData(object):
    def __init__(self, config):
        self.config = config
        accountName = config.getLADName()
        accountKey = config.getLADKey()
        hostBase = config.getLADHostBase()
        hostname = socket.gethostname()
        deploymentId = config.getVmDeploymentId()
        startKey, endKey = getAzureDiagnosticKeyRange()
        self.cpuPercent = getAzureDiagnosticCPUData(accountName, 
                                                    accountKey,
                                                    hostBase,
                                                    startKey,
                                                    endKey,
                                                    deploymentId)
        self.memoryPercent = getAzureDiagnosticMemoryData(accountName, 
                                                          accountKey,
                                                          hostBase,
                                                          startKey,
                                                          endKey,
                                                          deploymentId)

    def getCPUPercent(self):
        return self.cpuPercent

    def getMemoryPercent(self):
        return self.memoryPercent

class AzureDiagnosticMetric(object):
    def __init__(self, config):
        self.config = config
        self.linux = LinuxMetric(self.config)
        self.azure = AzureDiagnosticData(self.config)
        self.timestamp = int(time.time()) - AzureTableDelay

    def getTimestamp(self):
        return self.timestamp

    def getCurrHwFrequency(self):
        return self.linux.getCurrHwFrequency()

    def getMaxHwFrequency(self):
        return self.linux.getMaxHwFrequency()

    def getCurrVMProcessingPower(self):
        return self.linux.getCurrVMProcessingPower()

    def getGuaranteedVMProcessingPower(self):
        return self.linux.getGuaranteedVMProcessingPower()

    def getMaxVMProcessingPower(self):
        return self.linux.getMaxVMProcessingPower()

    def getNumOfCoresPerCPU(self):
        return self.linux.getNumOfCoresPerCPU()

    def getNumOfThreadsPerCore(self):
        return self.linux.getNumOfThreadsPerCore()

    def getPhysProcessingPowerPerVCPU(self):
        return self.linux.getPhysProcessingPowerPerVCPU()

    def getProcessorType(self):
        return self.linux.getProcessorType()

    def getReferenceComputeUnit(self):
        return self.linux.getReferenceComputeUnit()

    def getVCPUMapping(self):
        return self.linux.getVCPUMapping()
    
    def getVMProcessingPowerConsumption(self):
        return self.azure.getCPUPercent()
    
    def getCurrMemAssigned(self):
        return self.linux.getCurrMemAssigned()
        
    def getGuaranteedMemAssigned(self):
        return self.linux.getGuaranteedMemAssigned()

    def getMaxMemAssigned(self):
        return self.linux.getMaxMemAssigned()

    def getVMMemConsumption(self):
        return self.azure.getMemoryPercent()

    def getNetworkAdapterIds(self):
        return self.linux.getNetworkAdapterIds()

    def getNetworkAdapterMapping(self, adapterId):
        return self.linux.getNetworkAdapterMapping(adapterId)

    def getMaxNetworkBandwidth(self, adapterId):
        return self.linux.getMaxNetworkBandwidth(adapterId)

    def getMinNetworkBandwidth(self, adapterId):
        return self.linux.getMinNetworkBandwidth(adapterId)

    def getNetworkReadBytes(self, adapterId):
        return self.linux.getNetworkReadBytes(adapterId)

    def getNetworkWriteBytes(self, adapterId):
        return self.linux.getNetworkWriteBytes(adapterId)

    def getNetworkPacketRetransmitted(self):
        return self.linux.getNetworkPacketRetransmitted()
  
    def getLastHardwareChange(self):
        return self.linux.getLastHardwareChange()

class CPUInfo(object):

    @staticmethod
    def getCPUInfo():
        cpuinfo = waagent.GetFileContents("/proc/cpuinfo")
        ret, lscpu = waagent.RunGetOutput("lscpu")
        return CPUInfo(cpuinfo, lscpu)

    def __init__(self, cpuinfo, lscpu):
        self.cpuinfo = cpuinfo
        self.lscpu = lscpu
        self.cores = 1;
        self.coresPerCpu = 1;
        self.threadsPerCore = 1;
        
        coresMatch = re.search("CPU(s):\s+(\d+)", self.lscpu)
        if coresMatch:
            self.cores = int(coresMatch.group(1))
        
        coresPerCpuMatch = re.search("Core(s) per socket:\s+(\d+)", self.lscpu)
        if coresPerCpuMatch:
            self.coresPerCpu = int(coresPerCpuMatch.group(1))
        
        threadsPerCoreMatch = re.search("Core(s) per socket:\s+(\d+)", self.lscpu)
        if threadsPerCoreMatch:
            self.threadsPerCore = int(threadsPerCoreMatch.group(1))
        
        model = re.search("model name\s+:\s+(.*)\s", self.cpuinfo)
        vendorId = re.search("vendor_id\s+:\s+(.*)\s", self.cpuinfo)
        if model and vendorId:
            self.processorType = "{0}, {1}".format(model.group(1), 
                                                   vendorId.group(1))
        else:
            self.processorType = None
        
        freqMatch = re.search("CPU MHz:\s+(.*)\s", self.lscpu)
        if freqMatch:
            self.frequency = float(freqMatch.group(1))
        else:
            self.frequency = None

        ht = re.match("flags\s.*\sht\s", self.cpuinfo)
        self.isHTon = ht is not None

    def getNumOfCoresPerCPU(self):
        return self.coresPerCpu
    
    def getNumOfCores(self):
        return self.cores

    def getNumOfThreadsPerCore(self):
        return self.threadsPerCore
    
    def getProcessorType(self):
        return self.processorType
   
    def getFrequency(self):
        return self.frequency

    def isHyperThreadingOn(self):
        return self.isHTon

    def getCPUPercent(self):
        return psutil.cpu_percent()
    
class MemoryInfo(object):
    def __init__(self):
        self.memInfo = psutil.virtual_memory()

    def getMemSize(self):
        return self.memInfo[0]  / 1024 / 1024 #MB

    def getMemPercent(self):
        return self.memInfo[2] #%

def getMacAddress(adapterId):
    nicAddrPath = os.path.join("/sys/class/net", adapterId, "address")
    mac = waagent.GetFileContents(nicAddrPath)
    mac = mac.strip()
    mac = mac.replace(":", "-")
    return mac

def sameList(l1, l2):
    if l1 is None or l2 is None:
        return l1 == l2
    if len(l1) != len(l2):
        return False
    for i in range(0, len(l1)):
        if l1[i] != l2[i]:
            return False
    return True

class NetworkInfo(object):
    def __init__(self):
        self.nics = psutil.net_io_counters(pernic=True)
        self.nicNames = []
        for nicName, stat in self.nics.iteritems():
            if nicName != 'lo':
                self.nicNames.append(nicName)

    def getAdapterIds(self):
        return self.nicNames

    def getNetworkReadBytes(self, adapterId):
        net = psutil.net_io_counters(pernic=True)
        if net[adapterId] != None:
            bytes_recv1 = net[adapterId][1]
            time1 = time.time()
            
            time.sleep(0.2)
            
            net = psutil.net_io_counters(pernic=True)
            bytes_recv2 = net[adapterId][1]
            time2 = time.time()
            
            interval = (time2 - time1)
            
            return (bytes_recv2 - bytes_recv1) / interval
        else:
            return 0

    def getNetworkWriteBytes(self, adapterId):
        net = psutil.net_io_counters(pernic=True)
        if net[adapterId] != None:
            bytes_sent1 = net[adapterId][0]
            time1 = time.time()
            
            time.sleep(0.2)
            
            net = psutil.net_io_counters(pernic=True)
            bytes_sent2 = net[adapterId][0]
            time2 = time.time()
            
            interval = (time2 - time1)
            
            return (bytes_sent2 - bytes_sent1) / interval
        else:
            return 0

    def getNetstat(self):
        retCode, output = waagent.RunGetOutput("netstat -s", chk_err=False)
        return output

    def getNetworkPacketRetransmitted(self):
        netstat = self.getNetstat()
        match = re.search("(\d+)\s*segments retransmited", netstat)
        if match != None:
            return int(match.group(1))
        else:
            waagent.Error("Failed to parse netstat output: {0}".format(netstat))
            updateLatestErrorRecord(FAILED_TO_RETRIEVE_LOCAL_DATA)
            AddExtensionEvent(message=FAILED_TO_RETRIEVE_LOCAL_DATA)
            return None


HwInfoFile = os.path.join(LibDir, "HwInfo")
class HardwareChangeInfo(object):
    def __init__(self, networkInfo):
        self.networkInfo = networkInfo

    def getHwInfo(self):
        if not os.path.isfile(HwInfoFile):
            return None, None
        hwInfo = waagent.GetFileContents(HwInfoFile).split("\n")
        return int(hwInfo[0]), hwInfo[1:]

    def setHwInfo(self, timestamp, hwInfo):
        content = str(timestamp)
        content = content + "\n" + "\n".join(hwInfo)
        waagent.SetFileContents(HwInfoFile, content)

    def getLastHardwareChange(self):
        oldTime, oldMacs = self.getHwInfo()
        newMacs = map(lambda x : getMacAddress(x), 
                      self.networkInfo.getAdapterIds())
        newTime = int(time.time())
        newMacs.sort()
        if oldMacs is None or not sameList(newMacs, oldMacs):
            #Hardware changed
            if newTime < oldTime:
                waagent.Warn(("Hardware change detected. But the old timestamp "
                               "is greater than now, {0}>{1}.").format(oldTime, 
                                                                       newTime))
            self.setHwInfo(newTime, newMacs)
            return newTime
        else:
            return oldTime

class LinuxMetric(object):
    def __init__(self, config):
        self.config = config
        #CPU
        self.cpuInfo = CPUInfo.getCPUInfo()
        #Memory
        self.memInfo = MemoryInfo()
        #Network
        self.networkInfo = NetworkInfo()
        #Detect hardware change
        self.hwChangeInfo = HardwareChangeInfo(self.networkInfo)
        self.timestamp = int(time.time())

    def getTimestamp(self):
        return self.timestamp

    def getCurrHwFrequency(self):
        return self.cpuInfo.getFrequency()

    def getMaxHwFrequency(self):
        return self.getCurrHwFrequency()

    def getCurrVMProcessingPower(self):
        if self.config.isCpuOverCommitted():
            return None
        else:
            return self.cpuInfo.getNumOfCores()

    def getGuaranteedVMProcessingPower(self):
        return self.getCurrVMProcessingPower()

    def getMaxVMProcessingPower(self):
        return self.getCurrVMProcessingPower()

    def getNumOfCoresPerCPU(self):
        return self.cpuInfo.getNumOfCoresPerCPU()

    def getNumOfThreadsPerCore(self):
        return self.cpuInfo.getNumOfThreadsPerCore()

    def getPhysProcessingPowerPerVCPU(self):
        return 1 / float(self.getNumOfThreadsPerCore())

    def getProcessorType(self):
        return self.cpuInfo.getProcessorType()

    def getReferenceComputeUnit(self):
        return self.getProcessorType()

    def getVCPUMapping(self):
        return "thread" if self.cpuInfo.isHyperThreadingOn() else "core"
    
    def getVMProcessingPowerConsumption(self):
        return self.memInfo.getMemPercent()
    
    def getCurrMemAssigned(self):
        if self.config.isMemoryOverCommitted():
            return None
        else:
            return self.memInfo.getMemSize()
        
    def getGuaranteedMemAssigned(self):
        return self.getCurrMemAssigned()

    def getMaxMemAssigned(self):
        return self.getCurrMemAssigned()

    def getVMMemConsumption(self):
        return self.memInfo.getMemPercent()

    def getNetworkAdapterIds(self):
        return self.networkInfo.getAdapterIds()

    def getNetworkAdapterMapping(self, adapterId):
        return getMacAddress(adapterId)

    def getMaxNetworkBandwidth(self, adapterId):
        return 1000 #Mbit/s 

    def getMinNetworkBandwidth(self, adapterId):
        return 1000 #Mbit/s 

    def getNetworkReadBytes(self, adapterId):
        return self.networkInfo.getNetworkReadBytes(adapterId)

    def getNetworkWriteBytes(self, adapterId):
        return self.networkInfo.getNetworkWriteBytes(adapterId)

    def getNetworkPacketRetransmitted(self):
        return self.networkInfo.getNetworkPacketRetransmitted()
  
    def getLastHardwareChange(self):
        return self.hwChangeInfo.getLastHardwareChange()

class VMDataSource(object):
    def __init__(self, config):
        self.config = config

    def collect(self):
        counters = []
        if self.config.isLADEnabled():
            metrics = AzureDiagnosticMetric(self.config)
        else:
            metrics = LinuxMetric(self.config)

        #CPU
        counters.append(self.createCounterCurrHwFrequency(metrics))
        counters.append(self.createCounterMaxHwFrequency(metrics))
        counters.append(self.createCounterCurrVMProcessingPower(metrics))
        counters.append(self.createCounterGuaranteedVMProcessingPower(metrics))
        counters.append(self.createCounterMaxVMProcessingPower(metrics))
        counters.append(self.createCounterNumOfCoresPerCPU(metrics))
        counters.append(self.createCounterNumOfThreadsPerCore(metrics))
        counters.append(self.createCounterPhysProcessingPowerPerVCPU(metrics))
        counters.append(self.createCounterProcessorType(metrics))
        counters.append(self.createCounterReferenceComputeUnit(metrics))
        counters.append(self.createCounterVCPUMapping(metrics))
        counters.append(self.createCounterVMProcessingPowerConsumption(metrics))

        #Memory
        counters.append(self.createCounterCurrMemAssigned(metrics))
        counters.append(self.createCounterGuaranteedMemAssigned(metrics))
        counters.append(self.createCounterMaxMemAssigned(metrics))
        counters.append(self.createCounterVMMemConsumption(metrics))

        #Network
        adapterIds = metrics.getNetworkAdapterIds()
        for adapterId in adapterIds:
            if adapterId.startswith('eth'):
                counters.append(self.createCounterAdapterId(adapterId))
                counters.append(self.createCounterNetworkMapping(metrics, adapterId))
                counters.append(self.createCounterMinNetworkBandwidth(metrics, adapterId))
                counters.append(self.createCounterMaxNetworkBandwidth(metrics, adapterId))
                counters.append(self.createCounterNetworkReadBytes(metrics, adapterId))
                counters.append(self.createCounterNetworkWriteBytes(metrics, adapterId))
        counters.append(self.createCounterNetworkPacketRetransmitted(metrics))
        
        #Hardware change
        counters.append(self.createCounterLastHardwareChange(metrics))

        #Error
        counters.append(self.createCounterError())

        return counters
    
    def createCounterLastHardwareChange(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_LARGE,
                           category = "config",
                           name = "Last Hardware Change",
                           value = metrics.getLastHardwareChange(),
                           unit="posixtime")

    def createCounterError(self):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_LARGE,
                           category = "config",
                           name = "Error",
                           value = getLatestErrorRecord())

    def createCounterCurrHwFrequency(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "cpu",
                           name = "Current Hw Frequency",
                           value = metrics.getCurrHwFrequency(),
                           unit = "MHz",
                           refreshInterval = 60)

    def createCounterMaxHwFrequency(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "cpu",
                           name = "Max Hw Frequency",
                           value = metrics.getMaxHwFrequency(),
                           unit = "MHz")

    def createCounterCurrVMProcessingPower(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "cpu",
                           name = "Current VM Processing Power",
                           value = metrics.getCurrVMProcessingPower(),
                           unit = "compute unit")

    def createCounterMaxVMProcessingPower(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "cpu",
                           name = "Max. VM Processing Power",
                           value = metrics.getMaxVMProcessingPower(),
                           unit = "compute unit")

    def createCounterGuaranteedVMProcessingPower(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "cpu",
                           name = "Guaranteed VM Processing Power",
                           value = metrics.getGuaranteedVMProcessingPower(),
                           unit = "compute unit")

    def createCounterNumOfCoresPerCPU(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "cpu",
                           name = "Number of Cores per CPU",
                           value = metrics.getNumOfCoresPerCPU())

    def createCounterNumOfThreadsPerCore(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "cpu",
                           name = "Number of Threads per Core",
                           value = metrics.getNumOfThreadsPerCore())

    def createCounterPhysProcessingPowerPerVCPU(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "cpu",
                           name = "Phys. Processing Power per vCPU",
                           value = metrics.getPhysProcessingPowerPerVCPU())

    def createCounterProcessorType(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "cpu",
                           name = "Processor Type",
                           value = metrics.getProcessorType())

    def createCounterReferenceComputeUnit(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "cpu",
                           name = "Reference Compute Unit",
                           value = metrics.getReferenceComputeUnit())

    def createCounterVCPUMapping(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "cpu",
                           name = "vCPU Mapping",
                           value = metrics.getVCPUMapping())

    def createCounterVMProcessingPowerConsumption(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "cpu",
                           name = "VM Processing Power Consumption",
                           value = metrics.getVMProcessingPowerConsumption(),
                           unit = "%",
                           timestamp = metrics.getTimestamp(),
                           refreshInterval = 60)

    def createCounterCurrMemAssigned(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "memory",
                           name = "Current Memory assigned",
                           value = metrics.getCurrMemAssigned(),
                           unit = "MB")

    def createCounterMaxMemAssigned(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "memory",
                           name = "Max Memory assigned",
                           value = metrics.getMaxMemAssigned(),
                           unit = "MB")

    def createCounterGuaranteedMemAssigned(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "memory",
                           name = "Guaranteed Memory assigned",
                           value = metrics.getGuaranteedMemAssigned(),
                           unit = "MB")

    def createCounterVMMemConsumption(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "memory",
                           name = "VM Memory Consumption",
                           value = metrics.getVMMemConsumption(),
                           unit = "%",
                           timestamp = metrics.getTimestamp(),
                           refreshInterval = 60)

    def createCounterAdapterId(self, adapterId):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "network",
                           name = "Adapter Id",
                           instance = adapterId,
                           value = adapterId)

    def createCounterNetworkMapping(self, metrics, adapterId):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "network",
                           name = "Mapping",
                           instance = adapterId,
                           value = metrics.getNetworkAdapterMapping(adapterId))

    def createCounterMaxNetworkBandwidth(self, metrics, adapterId):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "network",
                           name = "VM Maximum Network Bandwidth",
                           instance = adapterId,
                           value = metrics.getMaxNetworkBandwidth(adapterId),
                           unit = "Mbit/s")

    def createCounterMinNetworkBandwidth(self, metrics, adapterId):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "network",
                           name = "VM Minimum Network Bandwidth",
                           instance = adapterId,
                           value = metrics.getMinNetworkBandwidth(adapterId),
                           unit = "Mbit/s")

    def createCounterNetworkReadBytes(self, metrics, adapterId):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_LARGE,
                           category = "network",
                           name = "Network Read Bytes",
                           instance = adapterId,
                           value = metrics.getNetworkReadBytes(adapterId),
                           unit = "byte/s")

    def createCounterNetworkWriteBytes(self, metrics, adapterId):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_LARGE,
                           category = "network",
                           name = "Network Write Bytes",
                           instance = adapterId,
                           value = metrics.getNetworkWriteBytes(adapterId),
                           unit = "byte/s")

    def createCounterNetworkPacketRetransmitted(self, metrics):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "network",
                           name = "Packets Retransmitted",
                           value = metrics.getNetworkPacketRetransmitted(),
                           unit = "packets/min")

def getStorageTimestamp(unixTimestamp):
    tformat = "{0:0>4d}{1:0>2d}{2:0>2d}T{3:0>2d}{4:0>2d}"
    ts = time.gmtime(unixTimestamp)
    return tformat.format(ts.tm_year,
                          ts.tm_mon,
                          ts.tm_mday,
                          ts.tm_hour,
                          ts.tm_min)
    

def getStorageTableKeyRange():
    #Round down by MonitoringInterval
    endTime = int(time.time()) / MonitoringInterval * MonitoringInterval 
    endTime = endTime - AzureTableDelay
    startTime = endTime - MonitoringInterval
    return getStorageTimestamp(startTime), getStorageTimestamp(endTime)

def getStorageMetrics(account, key, hostBase, table, startKey, endKey):
    try:
        waagent.Log("Retrieve storage metrics data.")
        tableService = TableService(account_name = account, 
                                    account_key = key,
                                    host_base = hostBase)
        ofilter = ("PartitionKey ge '{0}' and PartitionKey lt '{1}'"
                   "").format(startKey, endKey)
        oselect = ("TotalRequests,TotalIngress,TotalEgress,AverageE2ELatency,"
                   "AverageServerLatency,RowKey")
        metrics = tableService.query_entities(table, ofilter, oselect)
        waagent.Log("{0} records returned.".format(len(metrics)))
        return metrics
    except Exception as e:
        waagent.Error((u"Failed to retrieve storage metrics data: {0} {1}"
                       "").format(e, traceback.format_exc()))
        updateLatestErrorRecord(FAILED_TO_RETRIEVE_STORAGE_DATA)
        AddExtensionEvent(message=FAILED_TO_RETRIEVE_STORAGE_DATA)
        return None

def getDataDisks():
    blockDevs = os.listdir('/sys/block')
    dataDisks = filter(lambda d : re.match("sd[c-z]", d), blockDevs)
    return dataDisks

def getFirstLun(dev):
    path = os.path.join("/sys/block", dev, "device/scsi_disk")
    for lun in os.listdir(path):
        return int(lun[-1])

class DiskInfo(object):
    def __init__(self, config):
        self.config = config

    def getDiskMapping(self):
        osdiskVhd = "{0} {1}".format(self.config.getOSDiskAccount(),
                                     self.config.getOSDiskName())
        osdisk = {
                "vhd":osdiskVhd, 
                "type": self.config.getOSDiskType(),
                "caching": self.config.getOSDiskCaching(),
                "iops": self.config.getOSDiskSLAIOPS(),
                "throughput": self.config.getOSDiskSLAThroughput(),
        }

        diskMapping = {
                "/dev/sda": osdisk,
        }

        dataDisks = getDataDisks()
        if dataDisks is None or len(dataDisks) == 0:
            return diskMapping
        
        lunToDevMap = {}
        for dev in dataDisks:
            lun = getFirstLun(dev)
            lunToDevMap[lun] = dev

        diskCount = self.config.getDataDiskCount()
        for i in range(0, diskCount):
            lun = self.config.getDataDiskLun(i)
            datadiskVhd = "{0} {1}".format(self.config.getDataDiskAccount(i),
                                           self.config.getDataDiskName(i))
            datadisk = {
                    "vhd": datadiskVhd,
                    "type": self.config.getDataDiskType(i),
                    "caching": self.config.getDataDiskCaching(i),
                    "iops": self.config.getDataDiskSLAIOPS(i),
                    "throughput": self.config.getDataDiskSLAThroughput(i),
            }
            if lun in lunToDevMap:
                dev = lunToDevMap[lun]
                diskMapping[dev] = datadisk
            else:
                waagent.Warn("Couldn't find disk with lun: {0}".format(lun))

        return diskMapping 

def isUserRead(op):
    if not op.startswith("user;"):
        return False
    op = op[5:]
    for prefix in ["Get", "List", "Preflight"]:
        if op.startswith(prefix):
            return True
    return False

def isUserWrite(op):
    if not op.startswith("user;"):
        return False
    op = op[5:]
    for prefix in ["Put" ,"Set" ,"Clear" ,"Delete" ,"Create" ,"Snapshot"]:    
        if op.startswith(prefix):
            return True
    return False

def storageStat(metrics, opFilter):
    stat = {}
    stat['bytes'] = None
    stat['ops'] = None
    stat['e2eLatency'] = None
    stat['serverLatency'] = None
    stat['throughput'] = None
    if metrics is None:
        return stat

    metrics = filter(lambda x : opFilter(x.RowKey), metrics)
    stat['bytes'] = sum(map(lambda x : x.TotalIngress + x.TotalEgress, 
                            metrics))
    stat['ops'] = sum(map(lambda x : x.TotalRequests, metrics))
    if stat['ops'] != 0:
        stat['e2eLatency'] = sum(map(lambda x : x.TotalRequests * \
                                                x.AverageE2ELatency, 
                                     metrics)) / stat['ops']
        stat['serverLatency'] = sum(map(lambda x : x.TotalRequests * \
                                                   x.AverageServerLatency, 
                                        metrics)) / stat['ops']
    #Convert to MB/s
    stat['throughput'] = float(stat['bytes']) / (1024 * 1024) / 60 
    return stat

class AzureStorageStat(object):

    def __init__(self, metrics):
        self.metrics = metrics
        self.rStat = storageStat(metrics, isUserRead)
        self.wStat = storageStat(metrics, isUserWrite)

    def getReadBytes(self):
        return self.rStat['bytes']

    def getReadOps(self):
        return self.rStat['ops']

    def getReadOpE2ELatency(self):
        return self.rStat['e2eLatency']

    def getReadOpServerLatency(self):
        return self.rStat['serverLatency']

    def getReadOpThroughput(self):
        return self.rStat['throughput']

    def getWriteBytes(self):
        return self.wStat['bytes']

    def getWriteOps(self):
        return self.wStat['ops']

    def getWriteOpE2ELatency(self):
        return self.wStat['e2eLatency']

    def getWriteOpServerLatency(self):
        return self.wStat['serverLatency']

    def getWriteOpThroughput(self):
        return self.wStat['throughput']


class StorageDataSource(object):
    def __init__(self, config):
        self.config = config

    def collect(self):
        counters = []

        #Add disk mapping for resource disk
        counters.append(self.createCounterDiskMapping("/dev/sdb", 
                                                      "not mapped to vhd"))
        #Add disk mapping for osdisk and data disk
        diskMapping = DiskInfo(self.config).getDiskMapping()
        for dev, disk in diskMapping.iteritems():
            counters.append(self.createCounterDiskMapping(dev, disk.get("vhd")))
            counters.append(self.createCounterDiskType(dev, disk.get("type")))
            counters.append(self.createCounterDiskCaching(dev, disk.get("caching")))
            if disk.get("type") == "Premium":
                counters.append(self.createCounterDiskIOPS(dev, disk.get("iops")))
                counters.append(self.createCounterDiskThroughput(dev, disk.get("throughput")))

        accounts = self.config.getStorageAccountNames()
        for account in accounts:
            if self.config.getStorageAccountType(account) == "Standard":
                counters.extend(self.collectMetrixForStandardStorage(account))
        return counters

    def collectMetrixForStandardStorage(self, account):
        counters = []
        startKey, endKey = getStorageTableKeyRange()
        tableName = self.config.getStorageAccountMinuteTable(account)
        accountKey = self.config.getStorageAccountKey(account)
        hostBase = self.config.getStorageHostBase(account)
        metrics = getStorageMetrics(account, 
                                    accountKey,
                                    hostBase,
                                    tableName,
                                    startKey,
                                    endKey)
        stat = AzureStorageStat(metrics)
        counters.append(self.createCounterStorageId(account))
        counters.append(self.createCounterReadBytes(account, stat))
        counters.append(self.createCounterReadOps(account, stat))
        counters.append(self.createCounterReadOpE2ELatency(account, stat))
        counters.append(self.createCounterReadOpServerLatency(account, stat))
        counters.append(self.createCounterReadOpThroughput(account, stat))
        counters.append(self.createCounterWriteBytes(account, stat))
        counters.append(self.createCounterWriteOps(account, stat))
        counters.append(self.createCounterWriteOpE2ELatency(account, stat))
        counters.append(self.createCounterWriteOpServerLatency(account, stat))
        counters.append(self.createCounterWriteOpThroughput(account, stat))
        return counters

    def createCounterDiskType(self, dev, diskType):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "disk",
                           name = "Storage Type",
                           instance = dev,
                           value = diskType)

    def createCounterDiskCaching(self, dev, caching):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "disk",
                           name = "Caching",
                           instance = dev,
                           value = caching)

    def createCounterDiskThroughput(self, dev, throughput):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "disk",
                           name = "SLA Throughput",
                           instance = dev,
                           unit = "MB/sec",
                           value = throughput)

    def createCounterDiskIOPS(self, dev, iops):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "disk",
                           name = "SLA",
                           instance = dev,
                           unit = "Ops/sec",
                           value = iops)

    def createCounterReadBytes(self, account, stat):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_LARGE,
                           category = "storage",
                           name = "Storage Read Bytes",
                           instance = account,
                           value = stat.getReadBytes(),
                           unit = 'byte',
                           refreshInterval = 60)

    def createCounterReadOps(self, account, stat):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "storage",
                           name = "Storage Read Ops",
                           instance = account,
                           value = stat.getReadOps(),
                           refreshInterval = 60)

    def createCounterReadOpE2ELatency(self, account, stat):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "storage",
                           name = "Storage Read Op Latency E2E msec",
                           instance = account,
                           value = stat.getReadOpE2ELatency(),
                           unit = 'ms',
                           refreshInterval = 60)

    def createCounterReadOpServerLatency(self, account, stat):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "storage",
                           name = "Storage Read Op Latency Server msec",
                           instance = account,
                           value = stat.getReadOpServerLatency(),
                           unit = 'ms',
                           refreshInterval = 60)

    def createCounterReadOpThroughput(self, account, stat):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "storage",
                           name = "Storage Read Throughput E2E MB/sec",
                           instance = account,
                           value = stat.getReadOpThroughput(),
                           unit = 'MB/s',
                           refreshInterval = 60)

    def createCounterWriteBytes(self, account, stat):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_LARGE,
                           category = "storage",
                           name = "Storage Write Bytes",
                           instance = account,
                           value = stat.getWriteBytes(),
                           unit = 'byte',
                           refreshInterval = 60)

    def createCounterWriteOps(self, account, stat):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "storage",
                           name = "Storage Write Ops",
                           instance = account,
                           value = stat.getWriteOps(),
                           refreshInterval = 60)

    def createCounterWriteOpE2ELatency(self, account, stat):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "storage",
                           name = "Storage Write Op Latency E2E msec",
                           instance = account,
                           value = stat.getWriteOpE2ELatency(),
                           unit = 'ms',
                           refreshInterval = 60)

    def createCounterWriteOpServerLatency(self, account, stat):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "storage",
                           name = "Storage Write Op Latency Server msec",
                           instance = account,
                           value = stat.getWriteOpServerLatency(),
                           unit = 'ms',
                           refreshInterval = 60)

    def createCounterWriteOpThroughput(self, account, stat):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_DOUBLE,
                           category = "storage",
                           name = "Storage Write Throughput E2E MB/sec",
                           instance = account,
                           value = stat.getWriteOpThroughput(),
                           unit = 'MB/s',
                           refreshInterval = 60)


    def createCounterStorageId(self, account):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "storage",
                           name = "Storage ID",
                           instance = account,
                           value = account)

    def createCounterDiskMapping(self, dev, vhd):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "storage",
                           name = "Phys. Disc to Storage Mapping",
                           instance = dev,
                           value = vhd)
                   
class HvInfo(object):
    def __init__(self):
        self.hvName = None;
        self.hvVersion = None;
        root_dir = os.path.dirname(__file__)
        cmd = os.path.join(root_dir, "bin/hvinfo")
        ret, output = waagent.RunGetOutput(cmd, chk_err=False)
        print(ret)
        if ret ==0 and output is not None:
            lines = output.split("\n")
            if len(lines) >= 2:
                self.hvName = lines[0]
                self.hvVersion = lines[1]

    def getHvName(self):
        return self.hvName

    def getHvVersion(self):
        return self.hvVersion

class StaticDataSource(object):
    def __init__(self, config):
        self.config = config

    def collect(self):
        counters = []
        hvInfo = HvInfo()
        counters.append(self.createCounterCloudProvider())
        counters.append(self.createCounterCpuOverCommitted())
        counters.append(self.createCounterMemoryOverCommitted())
        counters.append(self.createCounterDataProviderVersion())
        counters.append(self.createCounterDataSources())
        counters.append(self.createCounterInstanceType())
        counters.append(self.createCounterVirtSln(hvInfo.getHvName()))
        counters.append(self.createCounterVirtSlnVersion(hvInfo.getHvVersion()))
        vmSLAThroughput = self.config.getVMSLAThroughput()
        if vmSLAThroughput is not None:
            counters.append(self.createCounterVMSLAThroughput(vmSLAThroughput))
        vmSLAIOPS = self.config.getVMSLAIOPS()
        if vmSLAIOPS is not None:
            counters.append(self.createCounterVMSLAIOPS(vmSLAIOPS))

        return counters
    
    def createCounterVMSLAThroughput(self, throughput):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "config",
                           name = "SLA Max Disk Bandwidth per VM",
                           unit = "Ops/sec",
                           value = throughput)
     
    def createCounterVMSLAIOPS(self, iops):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_INT,
                           category = "config",
                           name = "SLA Max Disk IOPS per VM",
                           unit = "Ops/sec",
                           value = iops)

    def createCounterCloudProvider(self):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "config",
                           name = "Cloud Provider",
                           value = "Microsoft Azure")

    def createCounterVirtSlnVersion(self, hvVersion):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "config",
                           name = "Virtualization Solution Version",
                           value = hvVersion)

    def createCounterVirtSln(self, hvName):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "config",
                           name = "Virtualization Solution",
                           value = hvName)
  
    def createCounterInstanceType(self):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "config",
                           name = "Instance Type",
                           value = self.config.getVmSize())

    def createCounterDataSources(self):
        dataSource = "wad" if self.config.isLADEnabled() else "local"
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "config",
                           name = "Data Sources",
                           value = dataSource)

    def createCounterDataProviderVersion(self):
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "config",
                           name = "Data Provider Version",
                           value = AzureEnhancedMonitorVersion)

    def createCounterMemoryOverCommitted(self):
        value = "yes" if self.config.isMemoryOverCommitted() else "no"
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "config",
                           name = "Memory Over-Provisioning",
                           value = value)

    def createCounterCpuOverCommitted(self):
        value = "yes" if self.config.isCpuOverCommitted() else "no"
        return PerfCounter(counterType = PerfCounterType.COUNTER_TYPE_STRING,
                           category = "config",
                           name = "CPU Over-Provisioning",
                           value = value)

class PerfCounterType(object):
    COUNTER_TYPE_INVALID = 0
    COUNTER_TYPE_INT = 1
    COUNTER_TYPE_DOUBLE = 2
    COUNTER_TYPE_LARGE = 3
    COUNTER_TYPE_STRING = 4

class PerfCounter(object):
    def __init__(self, 
                 counterType, 
                 category, 
                 name, 
                 value, 
                 instance="",
                 unit="none",
                 timestamp = None,
                 refreshInterval=0):
        self.counterType = counterType
        self.category = category
        self.name = name
        self.instance = instance
        self.value = value
        self.unit = unit
        self.refreshInterval = refreshInterval
        if(timestamp):
            self.timestamp = timestamp
        else:
            self.timestamp = int(time.time())
        self.machine = socket.gethostname()

    def __str__(self):
        return (u"{0};{1};{2};{3};{4};{5};{6};{7};{8};{9};\n"
                 "").format(self.counterType,
                            self.category,
                            self.name,
                            self.instance,
                            0 if self.value is not None else 1,
                            self.value if self.value is not None else "",
                            self.unit,
                            self.refreshInterval,
                            self.timestamp,
                            self.machine)

    __repr__ = __str__

class EnhancedMonitor(object):
    def __init__(self, config):
        self.dataSources = []
        self.dataSources.append(VMDataSource(config))
        self.dataSources.append(StorageDataSource(config))
        self.dataSources.append(StaticDataSource(config))
        self.writer = PerfCounterWriter()

    def run(self):
        counters = []
        for dataSource in self.dataSources:
            counters.extend(dataSource.collect())
        clearLastErrorRecord()
        self.writer.write(counters)

EventFile=os.path.join(LibDir, "PerfCounters")
class PerfCounterWriter(object):
    def write(self, counters, maxRetry = 3, eventFile=EventFile):
        for i in range(0, maxRetry):
            try:
                self._write(counters, eventFile)
                waagent.Log(("Write {0} counters to event file."
                             "").format(len(counters)))
                return
            except IOError as e:
                waagent.Warn((u"Write to perf counters file failed: {0}"
                              "").format(e))
                waagent.Log("Retry: {0}".format(i))
                time.sleep(1)

        waagent.Error(("Failed to serialize perf counter to file:"
                       "{0}").format(eventFile))
        updateLatestErrorRecord(FAILED_TO_SERIALIZE_PERF_COUNTERS)
        AddExtensionEvent(message=FAILED_TO_SERIALIZE_PERF_COUNTERS)
        raise

    def _write(self, counters, eventFile):
        with open(eventFile, "w+") as F:
            F.write("".join(map(lambda c : str(c), counters)).encode("utf8"))

class EnhancedMonitorConfig(object):
    def __init__(self, publicConfig, privateConfig):
        xmldoc = minidom.parse('/var/lib/waagent/SharedConfig.xml')
        self.deployment = xmldoc.getElementsByTagName('Deployment')
        self.role = xmldoc.getElementsByTagName('Role')
        self.configData = {}
        diskCount = 0
        accountNames = []
        for item in publicConfig["cfg"]:
            self.configData[item["key"]] = item["value"]
            if item["key"].startswith("disk.lun"):
                diskCount = diskCount + 1
            if item["key"].endswith("minute.name"):
                accountNames.append(item["value"])

        for item in privateConfig["cfg"]:
            self.configData[item["key"]] = item["value"]

        self.configData["disk.count"] = diskCount
        self.configData["account.names"] = accountNames


    def getVmSize(self):
        return self.configData.get("vmsize")

    def getVmRoleInstance(self):
        return self.role[0].attributes['name'].value

    def getVmDeploymentId(self):
        return self.deployment[0].attributes['name'].value

    def isMemoryOverCommitted(self):
        return self.configData.get("vm.memory.isovercommitted")

    def isCpuOverCommitted(self):
        return self.configData.get("vm.cpu.isovercommitted")

    def getScriptVersion(self):
        return self.configData.get("script.version")

    def isVerbose(self):
        flag = self.configData.get("verbose")
        return flag == "1" or flag == 1

    def getVMSLAIOPS(self):
        return self.configData.get("vm.sla.iops")

    def getVMSLAThroughput(self):
        return self.configData.get("vm.sla.throughput")

    def getOSDiskName(self):
        return self.configData.get("osdisk.name")

    def getOSDiskAccount(self):
        osdiskConnMinute = self.getOSDiskConnMinute()
        return self.configData.get("{0}.name".format(osdiskConnMinute))

    def getOSDiskConnMinute(self):
        return self.configData.get("osdisk.connminute")

    def getOSDiskConnHour(self):
        return self.configData.get("osdisk.connhour")

    def getOSDiskType(self):
        return self.configData.get("osdisk.type")

    def getOSDiskCaching(self):
        return self.configData.get("osdisk.caching")

    def getOSDiskSLAIOPS(self):
        return self.configData.get("osdisk.sla.iops")
    
    def getOSDiskSLAThroughput(self):
        return self.configData.get("osdisk.sla.throughput")
    
    def getDataDiskCount(self):
        return self.configData.get("disk.count")

    def getDataDiskLun(self, index):
        return self.configData.get("disk.lun.{0}".format(index))

    def getDataDiskName(self, index):
        return self.configData.get("disk.name.{0}".format(index))

    def getDataDiskAccount(self, index):
        return self.configData.get("disk.account.{0}".format(index))

    def getDataDiskConnMinute(self, index):
        return self.configData.get("disk.connminute.{0}".format(index))

    def getDataDiskConnHour(self, index):
        return self.configData.get("disk.connhour.{0}".format(index))
    
    def getDataDiskType(self, index):
        return self.configData.get("disk.type.{0}".format(index))

    def getDataDiskCaching(self, index):
        return self.configData.get("disk.caching.{0}".format(index))

    def getDataDiskSLAIOPS(self, index):
        return self.configData.get("disk.sla.iops.{0}".format(index))
    
    def getDataDiskSLAThroughput(self, index):
        return self.configData.get("disk.sla.throughput.{0}".format(index))
    
    def getStorageAccountNames(self):
        return self.configData.get("account.names")

    def getStorageAccountKey(self, name):
        return self.configData.get("{0}.minute.key".format(name))
        
    def getStorageAccountType(self, name):
        key = "{0}.minute.ispremium".format(name) 
        return "Premium" if self.configData.get(key) == 1 else "Standard"
    
    def getStorageHostBase(self, name):
        return get_host_base_from_uri(self.getStorageAccountMinuteUri(name)) 

    def getStorageAccountMinuteUri(self, name):
        return self.configData.get("{0}.minute.uri".format(name))

    def getStorageAccountMinuteTable(self, name):
        uri = self.getStorageAccountMinuteUri(name)
        pos = uri.rfind('/')
        tableName = uri[pos+1:]
        return tableName

    def getStorageAccountHourUri(self, name):
        return self.configData.get("{0}.hour.uri".format(name))

    def isLADEnabled(self):
        flag = self.configData.get("wad.isenabled")
        return flag == "1" or flag == 1

    def getLADKey(self):
        return self.configData.get("wad.key")

    def getLADName(self):
        return self.configData.get("wad.name")
    
    def getLADHostBase(self):
        return get_host_base_from_uri(self.getLADUri())

    def getLADUri(self):
        return self.configData.get("wad.uri")



================================================
FILE: AzureEnhancedMonitor/ext/handler.py
================================================
#!/usr/bin/env python
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import sys
import re
import os
import subprocess
import traceback
import time
import aem
import string
from Utils.WAAgentUtil import waagent, InitExtensionEventLog
import Utils.HandlerUtil as util

ExtensionShortName = 'AzureEnhancedMonitor'
ExtensionFullName  = 'Microsoft.OSTCExtensions.AzureEnhancedMonitor'
ExtensionVersion   = 'AzureEnhancedMonitor'

def printable(s):
    return filter(lambda c : c in string.printable, str(s))

def enable(hutil):
    pidFile = os.path.join(aem.LibDir, "pid");
   
    #Check whether monitor process is running.
    #If it does, return. Otherwise clear pid file
    if os.path.isfile(pidFile):
        pid = waagent.GetFileContents(pidFile)
        if os.path.isdir(os.path.join("/proc", pid)):
            if hutil.is_seq_smaller():
                hutil.do_exit(0, 'Enable', 'success', '0', 
                              'Azure Enhanced Monitor is already running')
            else:
                waagent.Log("Stop old daemon: {0}".format(pid))
                os.kill(int(pid), 9)
        os.remove(pidFile)

    args = [os.path.join(os.getcwd(), __file__), "daemon"]
    devnull = open(os.devnull, 'w')
    child = subprocess.Popen(args, stdout=devnull, stderr=devnull)
    if child.pid == None or child.pid < 1:
        hutil.do_exit(1, 'Enable', 'error', '1', 
                      'Failed to launch Azure Enhanced Monitor')
    else:
        hutil.save_seq()
        waagent.SetFileContents(pidFile, str(child.pid))
        waagent.Log(("Daemon pid: {0}").format(child.pid))
        hutil.do_exit(0, 'Enable', 'success', '0', 
                      'Azure Enhanced Monitor is enabled')

def disable(hutil):
    pidFile = os.path.join(aem.LibDir, "pid");
   
    #Check whether monitor process is running.
    #If it does, kill it. Otherwise clear pid file
    if os.path.isfile(pidFile):
        pid = waagent.GetFileContents(pidFile)
        if os.path.isdir(os.path.join("/proc", pid)):
            waagent.Log(("Stop daemon: {0}").format(pid))
            os.kill(int(pid), 9)
            os.remove(pidFile)
            hutil.do_exit(0, 'Disable', 'success', '0', 
                          'Azure Enhanced Monitor is disabled')
        os.remove(pidFile)
    
    hutil.do_exit(0, 'Disable', 'success', '0', 
                  'Azure Enhanced Monitor is not running')

def daemon(hutil):
    publicConfig = hutil.get_public_settings()
    privateConfig = hutil.get_protected_settings()
    config = aem.EnhancedMonitorConfig(publicConfig, privateConfig)
    monitor = aem.EnhancedMonitor(config)
    hutil.set_verbose_log(config.isVerbose())
    InitExtensionEventLog(hutil.get_name())
    while True:
        waagent.Log("Collecting performance counter.")
        startTime = time.time()
        try:
            monitor.run()
            message = ("deploymentId={0} roleInstance={1} OK"
                       "").format(config.getVmDeploymentId(), 
                                  config.getVmRoleInstance())
            hutil.do_status_report("Enable", "success", 0, message)

        except Exception as e:
            waagent.Error("{0} {1}".format(printable(e), 
                                           traceback.format_exc()))
            hutil.do_status_report("Enable", "error", 0, "{0}".format(e))
        waagent.Log("Finished collection.")
        timeElapsed = time.time() - startTime
        timeToWait = (aem.MonitoringInterval - timeElapsed)
        #Make sure timeToWait is in the range [0, aem.MonitoringInterval)
        timeToWait = timeToWait % aem.MonitoringInterval
        time.sleep(timeToWait)

def grace_exit(operation, status, msg):
    hutil = parse_context(operation)
    hutil.do_exit(0, operation, status, '0', msg)

def parse_context(operation):
    hutil = util.HandlerUtility(waagent.Log, waagent.Error, ExtensionShortName, ExtensionFullName, ExtensionVersion)
    hutil.do_parse_context(operation)
    return hutil

def main():
    waagent.LoggerInit('/var/log/waagent.log','/dev/stdout')
    waagent.Log("{0} started to handle.".format(ExtensionShortName))
    
    if not os.path.isdir(aem.LibDir):
        os.makedirs(aem.LibDir)
    
    for command in sys.argv[1:]:
        if re.match("^([-/]*)(install)", command):
            grace_exit("install", "success", "Install succeeded")
        if re.match("^([-/]*)(uninstall)", command):
            grace_exit("uninstall", "success", "Uninstall succeeded")
        if re.match("^([-/]*)(update)", command):
            grace_exit("update", "success", "Update succeeded")

        try:
            if re.match("^([-/]*)(enable)", command):
                hutil = parse_context("enable")
                enable(hutil)
            elif re.match("^([-/]*)(disable)", command):
                hutil = parse_context("disable")
                disable(hutil)
            elif re.match("^([-/]*)(daemon)", command):
                hutil = parse_context("enable")
                daemon(hutil)
        except Exception as e:
            hutil.error("{0}, {1}".format(e, traceback.format_exc()))
            hutil.do_exit(1, command, 'failed','0', 
                          '{0} failed:{1}'.format(command, e))

if __name__ == '__main__':
    main()


================================================
FILE: AzureEnhancedMonitor/ext/installer.py
================================================
#!/usr/bin/env python
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import imp
import os
import shutil

from Utils.WAAgentUtil import waagent
import Utils.HandlerUtil as util

ExtensionShortName = 'AzureEnhancedMonitor'

def parse_context(operation):
    hutil = util.HandlerUtility(waagent.Log, waagent.Error, ExtensionShortName)
    hutil.do_parse_context(operation)
    return hutil

def find_psutil_build(buildDir):
    for item in os.listdir(buildDir):
        try:
            build = os.path.join(buildDir, item)
            binary = os.path.join(build, '_psutil_linux.so')
            imp.load_dynamic('_psutil_linux', binary)
            return build
        except Exception:
            pass
    raise Exception("Available build of psutil not found.")

def main():
    waagent.LoggerInit('/var/log/waagent.log','/dev/stdout')
    waagent.Log("{0} started to handle.".format(ExtensionShortName))
    
    hutil = parse_context("Install")
    try:
        root = os.path.dirname(os.path.abspath(__file__))
        buildDir = os.path.join(root, "libpsutil")
        build = find_psutil_build(buildDir) 
        for item in os.listdir(build):
            src = os.path.join(build, item)
            dest = os.path.join(root, item)
            if os.path.isfile(src):
                if os.path.isfile(dest):
                    os.remove(dest)
                shutil.copyfile(src, dest)
            else:
                if os.path.isdir(dest):
                    shutil.rmtree(dest)
                shutil.copytree(src, dest)
    except Exception as e:
        hutil.error("{0}, {1}").format(e, traceback.format_exc())
        hutil.do_exit(1, "Install", 'failed','0', 
                      'Install failed: {0}'.format(e))

if __name__ == '__main__':
    main()


================================================
FILE: AzureEnhancedMonitor/ext/references
================================================
Common/azure-sdk-for-python/azure/
Common/psutil/LICENSE
Common/libpsutil
Utils/
LICENSE-2_0.txt
AzureEnhancedMonitor/hvinfo/bin


================================================
FILE: AzureEnhancedMonitor/ext/test/env.py
================================================
#!/usr/bin/env python
#
#CustomScript extension
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import sys
import os

test_dir = os.path.dirname(os.path.abspath(__file__))
root = os.path.dirname(test_dir)
sys.path.append(root)

azure_sdk = os.path.join(root, "Common/azure-sdk-for-python") 
sys.path.append(azure_sdk)


================================================
FILE: AzureEnhancedMonitor/ext/test/storage_metrics
================================================
[{"TotalRequests": 1, "RowKey": "system;All", "AverageE2ELatency": 52.0, "AverageServerLatency": 48.0, "TotalIngress": 247088, "TotalEgress": 160}, {"TotalRequests": 154, "RowKey": "user;All", "AverageE2ELatency": 6.285714, "AverageServerLatency": 5.551948, "TotalIngress": 1015225, "TotalEgress": 562321}, {"TotalRequests": 6, "RowKey": "user;ClearPage", "AverageE2ELatency": 5.0, "AverageServerLatency": 5.0, "TotalIngress": 3166, "TotalEgress": 1284}, {"TotalRequests": 1, "RowKey": "user;GetBlob", "AverageE2ELatency": 139.0, "AverageServerLatency": 31.0, "TotalIngress": 500, "TotalEgress": 524684}, {"TotalRequests": 11, "RowKey": "user;PutBlob", "AverageE2ELatency": 8.727273, "AverageServerLatency": 8.727273, "TotalIngress": 19026, "TotalEgress": 2475}, {"TotalRequests": 136, "RowKey": "user;PutPage", "AverageE2ELatency": 5.169118, "AverageServerLatency": 5.132353, "TotalIngress": 992533, "TotalEgress": 33878}]

================================================
FILE: AzureEnhancedMonitor/ext/test/test_aem.py
================================================
#!/usr/bin/env python
#
#CustomScript extension
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import datetime
import os
import json
import unittest

import env
import aem
from Utils.WAAgentUtil import waagent

TestPublicConfig = """\
{
    "cfg": [{
        "key":  "vmsize",
        "value":  "Small (A1)"
    },{
        "key":  "vm.roleinstance",
        "value":  "osupdate"
    },{
        "key":  "vm.role",
        "value":  "IaaS"
    },{
        "key":  "vm.deploymentid",
        "value":  "cd98461b43364478a908d03d0c3135a7"
    },{
        "key":  "vm.memory.isovercommitted",
        "value":  0
    },{
        "key":  "vm.cpu.isovercommitted",
        "value":  0
    },{
        "key":  "script.version",
        "value":  "1.2.0.0"
    },{
        "key":  "verbose",
        "value":  "0"
    },{
        "key":  "osdisk.connminute",
        "value":  "asdf.minute"
    },{
        "key":  "osdisk.connhour",
        "value":  "asdf.hour"
    },{
        "key":  "osdisk.name",
        "value":  "osupdate-osupdate-2015-02-12.vhd"
    },{
        "key":  "asdf.hour.uri",
        "value":  "https://asdf.table.core.windows.net/$metricshourprimarytransactionsblob"
    },{
        "key":  "asdf.minute.uri",
        "value":  "https://asdf.table.core.windows.net/$metricsminuteprimarytransactionsblob"
    },{
        "key":  "asdf.hour.name",
        "value":  "asdf"
    },{
        "key":  "asdf.minute.name",
        "value":  "asdf"
    },{
        "key":  "wad.name",
        "value":  "asdf"
    },{
        "key":  "wad.isenabled",
        "value":  "1"
    },{
        "key":  "wad.uri",
        "value":  "https://asdf.table.core.windows.net/wadperformancecounterstable"
    }]
}
"""
TestPrivateConfig = """\
{
    "cfg" : [{
        "key" : "asdf.minute.key",
        "value" : "qwer"
    },{
        "key" : "wad.key",
        "value" : "qwer"
    }]
}
"""
class TestAEM(unittest.TestCase):
    def setUp(self):
        waagent.LoggerInit("/dev/null", "/dev/stdout")

    def test_config(self):
        publicConfig = json.loads(TestPublicConfig)
        privateConfig = json.loads(TestPrivateConfig)
        config = aem.EnhancedMonitorConfig(publicConfig, privateConfig)
        self.assertNotEquals(None, config)
        self.assertEquals(".table.core.windows.net", 
                          config.getStorageHostBase('asdf'))
        self.assertEquals(".table.core.windows.net", 
                          config.getLADHostBase())
        return config

    def test_static_datasource(self):
        config = self.test_config()
        dataSource = aem.StaticDataSource(config)
        counters = dataSource.collect()
        self.assertNotEquals(None, counters)
        self.assertNotEquals(0, len(counters))

        name = "Cloud Provider"
        counter = next((c for c in counters if c.name == name))
        self.assertNotEquals(None, counter)
        self.assertEquals("Microsoft Azure", counter.value)
        
        name = "Virtualization Solution Version"
        counter = next((c for c in counters if c.name == name))
        self.assertNotEquals(None, counter)
        self.assertNotEquals(None, counter.value)

        name = "Virtualization Solution"
        counter = next((c for c in counters if c.name == name))
        self.assertNotEquals(None, counter)
        self.assertNotEquals(None, counter.value)

        name = "Instance Type"
        counter = next((c for c in counters if c.name == name))
        self.assertNotEquals(None, counter)
        self.assertEquals("Small (A1)", counter.value)

        name = "Data Sources"
        counter = next((c for c in counters if c.name == name))
        self.assertNotEquals(None, counter)
        self.assertEquals("wad", counter.value)

        name = "Data Provider Version"
        counter = next((c for c in counters if c.name == name))
        self.assertNotEquals(None, counter)
        self.assertEquals("2.0.0", counter.value)

        name = "Memory Over-Provisioning"
        counter = next((c for c in counters if c.name == name))
        self.assertNotEquals(None, counter)
        self.assertEquals("no", counter.value)

        name = "CPU Over-Provisioning"
        counter = next((c for c in counters if c.name == name))
        self.assertNotEquals(None, counter)
        self.assertEquals("no", counter.value)

    def test_cpuinfo(self):
        cpuinfo = aem.CPUInfo.getCPUInfo()
        self.assertNotEquals(None, cpuinfo)
        self.assertNotEquals(0, cpuinfo.getNumOfCoresPerCPU())
        self.assertNotEquals(0, cpuinfo.getNumOfCores())
        self.assertNotEquals(None, cpuinfo.getProcessorType())
        self.assertEquals(float, type(cpuinfo.getFrequency()))
        self.assertEquals(bool, type(cpuinfo.isHyperThreadingOn()))
        percent = cpuinfo.getCPUPercent()
        self.assertEquals(float, type(percent))
        self.assertTrue(percent >= 0 and percent <= 100)

    def test_meminfo(self):
        meminfo = aem.MemoryInfo()
        self.assertNotEquals(None, meminfo.getMemSize())
        self.assertEquals(long, type(meminfo.getMemSize()))
        percent = meminfo.getMemPercent()
        self.assertEquals(float, type(percent))
        self.assertTrue(percent >= 0 and percent <= 100)

    def test_networkinfo(self):
        netinfo = aem.NetworkInfo()
        adapterIds = netinfo.getAdapterIds()
        self.assertNotEquals(None, adapterIds)
        self.assertNotEquals(0, len(adapterIds))
        adapterId = adapterIds[0]
        self.assertNotEquals(None, aem.getMacAddress(adapterId))
        self.assertNotEquals(None, netinfo.getNetworkReadBytes())
        self.assertNotEquals(None, netinfo.getNetworkWriteBytes())
        self.assertNotEquals(None, netinfo.getNetworkPacketRetransmitted())

    def test_hwchangeinfo(self):
        netinfo = aem.NetworkInfo()
        testHwInfoFile = "/tmp/HwInfo"
        aem.HwInfoFile = testHwInfoFile
        if os.path.isfile(testHwInfoFile):
            os.remove(testHwInfoFile)
        hwChangeInfo = aem.HardwareChangeInfo(netinfo)
        self.assertNotEquals(None, hwChangeInfo.getLastHardwareChange())
        self.assertTrue(os.path.isfile, aem.HwInfoFile)

        #No hardware change
        lastChange = hwChangeInfo.getLastHardwareChange()
        hwChangeInfo = aem.HardwareChangeInfo(netinfo)
        self.assertEquals(lastChange, hwChangeInfo.getLastHardwareChange())

        #Create mock hardware
        waagent.SetFileContents(testHwInfoFile, ("0\nma-ca-sa-ds-02"))
        hwChangeInfo = aem.HardwareChangeInfo(netinfo)
        self.assertNotEquals(None, hwChangeInfo.getLastHardwareChange())

        
    def test_linux_metric(self):
        config = self.test_config()
        metric = aem.LinuxMetric(config)
        self.validate_cnm_metric(metric)

    #Metric for CPU, network and memory
    def validate_cnm_metric(self, metric):
        self.assertNotEquals(None, metric.getCurrHwFrequency())
        self.assertNotEquals(None, metric.getMaxHwFrequency())
        self.assertNotEquals(None, metric.getCurrVMProcessingPower())
        self.assertNotEquals(None, metric.getGuaranteedMemAssigned())
        self.assertNotEquals(None, metric.getMaxVMProcessingPower())
        self.assertNotEquals(None, metric.getNumOfCoresPerCPU())
        self.assertNotEquals(None, metric.getNumOfThreadsPerCore())
        self.assertNotEquals(None, metric.getPhysProcessingPowerPerVCPU())
        self.assertNotEquals(None, metric.getProcessorType())
        self.assertNotEquals(None, metric.getReferenceComputeUnit())
        self.assertNotEquals(None, metric.getVCPUMapping())
        self.assertNotEquals(None, metric.getVMProcessingPowerConsumption())
        self.assertNotEquals(None, metric.getCurrMemAssigned())
        self.assertNotEquals(None, metric.getGuaranteedMemAssigned())
        self.assertNotEquals(None, metric.getMaxMemAssigned())
        self.assertNotEquals(None, metric.getVMMemConsumption())
        adapterIds = metric.getNetworkAdapterIds()
        self.assertNotEquals(None, adapterIds)
        self.assertNotEquals(0, len(adapterIds))
        adapterId = adapterIds[0]
        self.assertNotEquals(None, metric.getNetworkAdapterMapping(adapterId))
        self.assertNotEquals(None, metric.getMaxNetworkBandwidth(adapterId))
        self.assertNotEquals(None, metric.getMinNetworkBandwidth(adapterId))
        self.assertNotEquals(None, metric.getNetworkReadBytes())
        self.assertNotEquals(None, metric.getNetworkWriteBytes())
        self.assertNotEquals(None, metric.getNetworkPacketRetransmitted())
        self.assertNotEquals(None, metric.getLastHardwareChange())

    def test_vm_datasource(self):
        config = self.test_config()
        config.configData["wad.isenabled"] = "0"
        dataSource = aem.VMDataSource(config)
        counters = dataSource.collect()
        self.assertNotEquals(None, counters)
        self.assertNotEquals(0, len(counters))

        counterNames = [
            "Current Hw Frequency",
            "Current VM Processing Power",
            "Guaranteed VM Processing Power",
            "Max Hw Frequency",
            "Max. VM Processing Power",
            "Number of Cores per CPU",
            "Number of Threads per Core",
            "Phys. Processing Power per vCPU",
            "Processor Type",
            "Reference Compute Unit",
            "vCPU Mapping",
            "VM Processing Power Consumption",
            "Current Memory assigned",
            "Guaranteed Memory assigned",
            "Max Memory assigned",
            "VM Memory Consumption",
            "Adapter Id",
            "Mapping",
            "Maximum Network Bandwidth",
            "Minimum Network Bandwidth",
            "Network Read Bytes",
            "Network Write Bytes",
            "Packets Retransmitted"
        ]
        #print "\n".join(map(lambda c: str(c), counters))
        for name in counterNames:
            #print name
            counter = next((c for c in counters if c.name == name))
            self.assertNotEquals(None, counter)
            self.assertNotEquals(None, counter.value)

    def test_storagemetric(self):
        metrics = mock_getStorageMetrics()
        self.assertNotEquals(None, metrics)
        stat = aem.AzureStorageStat(metrics)
        self.assertNotEquals(None, stat.getReadBytes())
        self.assertNotEquals(None, stat.getReadOps())
        self.assertNotEquals(None, stat.getReadOpE2ELatency())
        self.assertNotEquals(None, stat.getReadOpServerLatency())
        self.assertNotEquals(None, stat.getReadOpThroughput())
        self.assertNotEquals(None, stat.getWriteBytes())
        self.assertNotEquals(None, stat.getWriteOps())
        self.assertNotEquals(None, stat.getWriteOpE2ELatency())
        self.assertNotEquals(None, stat.getWriteOpServerLatency())
        self.assertNotEquals(None, stat.getWriteOpThroughput())

    def test_disk_info(self):
        config = self.test_config()
        mapping = aem.DiskInfo(config).getDiskMapping()
        self.assertNotEquals(None, mapping)

    def test_get_storage_key_range(self):
        startKey, endKey = aem.getStorageTableKeyRange()
        self.assertNotEquals(None, startKey)
        self.assertEquals(13, len(startKey))
        self.assertNotEquals(None, endKey)
        self.assertEquals(13, len(endKey))

    def test_storage_datasource(self):
        aem.getStorageMetrics = mock_getStorageMetrics
        config = self.test_config()
        dataSource = aem.StorageDataSource(config)
        counters = dataSource.collect()

        self.assertNotEquals(None, counters)
        self.assertNotEquals(0, len(counters))

        counterNames = [
            "Phys. Disc to Storage Mapping",
            "Storage ID",
            "Storage Read Bytes",
            "Storage Read Op Latency E2E msec",
            "Storage Read Op Latency Server msec",
            "Storage Read Ops",
            "Storage Read Throughput E2E MB/sec",
            "Storage Write Bytes",
            "Storage Write Op Latency E2E msec",
            "Storage Write Op Latency Server msec",
            "Storage Write Ops",
            "Storage Write Throughput E2E MB/sec"
        ]

        #print "\n".join(map(lambda c: str(c), counters))
        for name in counterNames:
            #print name
            counter = next((c for c in counters if c.name == name))
            self.assertNotEquals(None, counter)
            self.assertNotEquals(None, counter.value)

    def test_writer(self):
        testEventFile = "/tmp/Event"
        if os.path.isfile(testEventFile):
            os.remove(testEventFile)
        writer = aem.PerfCounterWriter()
        counters = [aem.PerfCounter(counterType = 0,
                                    category = "test",
                                    name = "test",
                                    value = "test",
                                    unit = "test")]

        writer.write(counters, eventFile = testEventFile)
        with open(testEventFile) as F:
            content = F.read()
            self.assertEquals(str(counters[0]), content)

        testEventFile = "/dev/console"
        print("==============================")
        print("The warning below is expected.")
        self.assertRaises(IOError, writer.write, counters, 2, testEventFile)
        print("==============================")

    def test_easyHash(self):
        hashVal = aem.easyHash('a')
        self.assertEquals(97, hashVal)
        hashVal = aem.easyHash('ab')
        self.assertEquals(87, hashVal)
        hashVal = aem.easyHash(("ciextension-SUSELinuxEnterpriseServer11SP3"
                                "___role1___"
                                "ciextension-SUSELinuxEnterpriseServer11SP3"))
        self.assertEquals(5, hashVal)
    
    def test_get_ad_key_range(self):
        startKey, endKey = aem.getAzureDiagnosticKeyRange()
        print(startKey)
        print(endKey)

    def test_get_mds_timestamp(self):
        date = datetime.datetime(2015, 1, 26, 3, 54)
        epoch = datetime.datetime.utcfromtimestamp(0)
        unixTimestamp = (int((date - epoch).total_seconds()))
        mdsTimestamp = aem.getMDSTimestamp(unixTimestamp)
        self.assertEquals(635578412400000000, mdsTimestamp)
    
    def test_get_storage_timestamp(self):
        date = datetime.datetime(2015, 1, 26, 3, 54)
        epoch = datetime.datetime.utcfromtimestamp(0)
        unixTimestamp = (int((date - epoch).total_seconds()))
        storageTimestamp = aem.getStorageTimestamp(unixTimestamp)
        self.assertEquals("20150126T0354", storageTimestamp)

def mock_getStorageMetrics(*args, **kwargs):
        with open(os.path.join(env.test_dir, "storage_metrics")) as F:
            test_data = F.read()
        jsonObjs = json.loads(test_data)  
        class ObjectView(object):
            def __init__(self, data):
                self.__dict__ = data
        metrics = map(lambda x : ObjectView(x), jsonObjs)
        return metrics

if __name__ == '__main__':
    unittest.main()


================================================
FILE: AzureEnhancedMonitor/ext/test/test_installer.py
================================================
#!/usr/bin/env python
#
#CustomScript extension
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import unittest
import env
import os
import json
import datetime
import installer

class TestInstall(unittest.TestCase):
    def test_install_psutil(self):
        buildDir = os.path.join(env.root, "../../Common/libpsutil")
        build = installer.find_psutil_build(buildDir)
        self.assertNotEquals(None, build)

if __name__ == '__main__':
    unittest.main()


================================================
FILE: AzureEnhancedMonitor/hvinfo/.gitignore
================================================
bin/*


================================================
FILE: AzureEnhancedMonitor/hvinfo/Makefile
================================================
CC := gcc
SRCDIR := src
LIBDIR := lib
INCDIR := include
BUILDDIR := build
TARGET := bin/hvinfo

SRCEXT := c
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
CFLAGS := -g
LDFLAGS := 
INC := -I $(INCDIR)
LIB := -L $(LIBDIR)

all : $(TARGET)

$(TARGET): $(OBJECTS)
	@echo "Linking..."
	$(CC) $^ $(LDFLAGS) -o $(TARGET) $(LIB)

$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
	@mkdir -p $(BUILDDIR)
	@echo "Compiling..."
	$(CC) $(CFLAGS) $(INC) -c -o $@ $<

clean:
	@echo "Cleaning..."
	$(RM) -r $(BUILDDIR) $(TARGET)

.PHONY: clean test


================================================
FILE: AzureEnhancedMonitor/hvinfo/src/hvinfo.c
================================================
//
// Copyright 2014 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 

void get_cpuid(unsigned int leaf, unsigned int *cpuid)
{
    asm volatile (
        "cpuid" 
        : "=a" (cpuid[0]), "=b" (cpuid[1]), "=c" (cpuid[2]), "=d" (cpuid[3]) 
        : "a" (leaf));
}

void u32_to_char_arr(char* dest, unsigned int i)
{
    dest[0] = (char)(i       & 0xFF);
    dest[1] = (char)(i >> 8  & 0xFF);
    dest[2] = (char)(i >> 16 & 0xFF);
    dest[3] = (char)(i >> 24 & 0xFF);
}

int main()
{
    unsigned int cpuid[4];
    char vendor_id[13];

    /* Read hypervisor name*/
    memset(cpuid, 0, sizeof(unsigned int) * 4);
    memset(vendor_id, 0, sizeof(char) * 13);
    get_cpuid(0x40000000, cpuid);

    //cpuid[1~3] is hypervisor vendor id signature.
    //In hyper-v, it is:
    //
    //    0x7263694D—“Micr”
    //    0x666F736F—“osof”
    //    0x76482074—“t Hv”
    //
    u32_to_char_arr(vendor_id,     cpuid[1]);
    u32_to_char_arr(vendor_id + 4, cpuid[2]);
    u32_to_char_arr(vendor_id + 8, cpuid[3]);

    printf("%s\n", vendor_id);

    /* Read hypervisor version*/
    memset(cpuid, 0, sizeof(unsigned int) * 4);
    get_cpuid(0x40000001, cpuid);

    // cpuid[0] is hypervisor vendor-neutral interface identification.
    // 0x31237648—“Hv#1. It means the next leaf contains version info.
    if(0x31237648 != cpuid[0])
    {
        return 1;
    }
    memset(cpuid, 0, sizeof(unsigned int) * 4);
    get_cpuid(0x40000002, cpuid);

    //cpuid[1] is host version. 
    //The high-end 16 bit is major version, while the low-end is minor.
    printf("%d.%d\n", (cpuid[1] >> 16) & 0xFF, (cpuid[1]) & 0xFF);
    return 0;
}



================================================
FILE: AzureEnhancedMonitor/nodejs/package.json
================================================
{
  "name": "azure-linux-tools",
  "author": "Microsoft Corporation",
  "contributors": [
    "Yue, Zhang <yuezha@microsoft.com>"
  ],
  "version": "1.0.0",
  "description": "Azure Linux VM configuration tools",
  "tags": [
    "azure",
    "vm",
    "linux",
    "tools"
  ],
  "keywords": [
    "node",
    "azure",
    "vm",
    "linux",
    "tools"
  ],
  "main": "setaem.js",
  "preferGlobal": "true",
  "engines": {
    "node": ">= 0.8.26"
  },
  "licenses": [
    {
      "type": "Apache",
      "url": "http://www.apache.org/licenses/LICENSE-2.0"
    }
  ],
  "dependencies": {
    "promise" : "6.1.0",
    "azure-common" : "0.9.13",
    "azure-storage" : "0.4.2",
    "azure-arm-storage" : "0.11.0",
    "azure-arm-compute" : "0.13.0"
  },
  "devDependencies": {
  },
  "homepage": "https://github.com/Azure/azure-linux-extensions",
  "repository": {
    "type": "git",
    "url": "git@github.com:Azure/azure-linux-extensions.git"
  },
  "bin": {
    "setaem": "setaem.js"
  },
  "scripts":{
  }
}


================================================
FILE: AzureEnhancedMonitor/nodejs/setaem.js
================================================
#!/usr/bin/env node

//
// Copyright (c) Microsoft and contributors.  All rights reserved.
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 
'use strict';

var fs = require('fs');
var path = require('path');
var Promise = require('promise');
var common = require('azure-common');
var storage = require('azure-storage');
var storageMgmt = require('azure-arm-storage');
var computeMgmt = require('azure-arm-compute');
var readFile = Promise.denodeify(fs.readFile); 

var debug = 0;

/*Const*/
var CurrentScriptVersion = "1.0.0.0";

var aemExtPublisher = "Microsoft.OSTCExtensions";
var aemExtName = "AzureEnhancedMonitorForLinux";
var aemExtVersion = "2.0";

var ladExtName = "LinuxDiagnostic";
var ladExtPublisher = "Microsoft.OSTCExtensions";
var ladExtVersion = "2.0";

var ROLECONTENT = "IaaS";
var AzureEndpoint = "windows.net";
var BlobMetricsMinuteTable= "$MetricsMinutePrimaryTransactionsBlob";
var BlobMetricsHourTable= "$MetricsMinutePrimaryTransactionsBlob";
var ladMetricesTable= "";
/*End of Const*/

var AemConfig = function(){
    this.prv = [];
    this.pub = [];
};

AemConfig.prototype.setPublic = function(key, value){
    this.pub.push({
        'key' : key,
        'value' : value
    });
};


AemConfig.prototype.setPrivate = function(key, value){
    this.prv.push({
        'key' : key,
        'value' : value
    });
};

AemConfig.prototype.getPublic = function(){
    return {
        'key' : aemExtName + "PublicConfigParameter",
        'value' : JSON.stringify({'cfg' : this.pub}),
        'type':'Public'
    }
};

AemConfig.prototype.getPrivate = function(){
    return {
        'key' : aemExtName + "PrivateConfigParameter",
        'value' : JSON.stringify({'cfg' : this.prv}),
        'type':'Private'
    }
};

var setAzureVMEnhancedMonitorForLinux = function(rgpName, vmName){
    var azureProfile;
    var currSubscription;
    var computeClient;
    var storageClient;
    var selectedVM;
    var osdiskAccount;
    var accounts = [];
    var aemConfig = new AemConfig();

    return getAzureProfile().then(function(profile){
        azureProfile = profile;
        return getDefaultSubscription(profile);
    }).then(function(subscription){
        console.log("[INFO]Using subscription: " + subscription.name);
        debug && console.log(JSON.stringify(subscription, null, 4));
        currSubscription = subscription;
        var cred = getCloudCredential(subscription);
        var baseUri = subscription.managementEndpointUrl;
        computeClient = computeMgmt.createComputeManagementClient(cred, baseUri);
        storageClient = storageMgmt.createStorageManagementClient(cred, baseUri);
    }).then(function(){
        return getVirtualMachine(computeClient, rgpName, vmName);
    }).then(function(vm){
        //Set vm role basic config
        console.log("[INFO]Found VM: " + vm.oSProfile.computerName);
        debug && console.log(JSON.stringify(vm, null, 4));
        /*
        vm:
        { extensions: [ [Object] ],
          tags: {},
          hardwareProfile: { virtualMachineSize: 'Standard_A1' },
          storageProfile: { dataDisks: [], imageReference: [Object], oSDisk: [Object] },
          oSProfile:
          { secrets: [],
            computerName: 'zhongyiubuntu4',
            adminUsername: 'zhongyi',
            linuxConfiguration: [Object] },
          networkProfile: { networkInterfaces: [Object] },
          diagnosticsProfile: { bootDiagnostics: [Object] },
          provisioningState: 'Succeeded',
          id: '/subscriptions/4be8920b-2978-43d7-ab14-04d8549c1d05/resourceGroups/zhongyiubuntu4/providers/Microsoft.Compute/virtualMachines/zhongyiubuntu4',
          name: 'zhongyiubuntu4',
          type: 'Microsoft.Compute/virtualMachines',
          location: 'eastasia' }}
        */
        selectedVM = vm;
        var cpuOverCommitted = 0;
        if(selectedVM.hardwareProfile.virtualMachineSize === 'ExtralSmall'){
            cpuOverCommitted = 1
        }
        aemConfig.setPublic('vmsize', selectedVM.hardwareProfile.virtualMachineSize);
        aemConfig.setPublic('vm.role', 'IaaS');
        aemConfig.setPublic('vm.memory.isovercommitted', 0);
        aemConfig.setPublic('vm.cpu.isovercommitted', cpuOverCommitted);
        aemConfig.setPublic('script.version', CurrentScriptVersion);
        aemConfig.setPublic('verbose', '0');
        aemConfig.setPublic('href', 'http://aka.ms/sapaem');
    }).then(function(){
        //Set vm disk config
        /*
        osDisk:
        { operatingSystemType: 'Linux',
          name: 'zhongyiubuntu4',
          virtualHardDisk: { uri: 'https://zhongyiubuntu44575.blob.core.windows.net/vhds/zhongyiubuntu4.vhd' },
          caching: 'ReadWrite',
          createOption: 'FromImage' }
        */
        var osdisk = selectedVM.storageProfile.oSDisk;
        osdiskAccount = getStorageAccountFromUri(osdisk.virtualHardDisk.uri);
        console.log("[INFO]Adding configure for OS disk.");
        aemConfig.setPublic('osdisk.account', osdiskAccount);
        aemConfig.setPublic('osdisk.name', osdisk.name);
        //aemConfig.setPublic('osdisk.caching', osdisk.caching);
        aemConfig.setPublic('osdisk.connminute', osdiskAccount + ".minute");
        aemConfig.setPublic('osdisk.connhour', osdiskAccount + ".hour");
        accounts.push({
            name: osdiskAccount,
        });        
        /*
        dataDisk:
        { lun: 0,
          name: 'zhongyiubuntu4-20151112-140433',
          virtualHardDisk: { uri: 'https://zhongyiubuntu44575.blob.core.windows.net/vhds/zhongyiubuntu4-20151112-140433.vhd' },
          caching: 'None',
          createOption: 'Empty',
          diskSizeGB: 1023 }
        */
        for(var i = 0; i < selectedVM.storageProfile.dataDisks.length; i++){
            var dataDisk = selectedVM.storageProfile.dataDisks[i];
            console.log("[INFO]Adding configure for data disk: " + 
                        dataDisk.name);
            var datadiskAccount = getStorageAccountFromUri(dataDisk.virtualHardDisk.uri);
            accounts.push({
                name:datadiskAccount
            });
            //The default lun value is 0
            var lun = dataDisk.lun;
            aemConfig.setPublic('disk.lun.' + i, lun);
            aemConfig.setPublic('disk.name.' + i, dataDisk.name);
            aemConfig.setPublic('disk.caching.' + i, dataDisk.name);
            aemConfig.setPublic('disk.account.' + i, datadiskAccount);
            aemConfig.setPublic('disk.connminute.' + i, 
                                datadiskAccount + ".minute");
            aemConfig.setPublic('disk.connhour.' + i, datadiskAccount + ".hour");
        }
    }).then(function(){        
        //Set storage account config
        var promises = [];
        var i = -2;
        Object(accounts).forEach(function(account){
            var promise = getResourceGroupName(storageClient, account.name)
              .then(function(rgpName){
                account.rgp = rgpName;
                console.log("!!!!rgp",rgpName);
                return getStorageAccountKey(storageClient, rgpName, account.name);
            }).then(function(accountKey){
                console.log("!!!!key",accountKey);
                account.key = accountKey;
                aemConfig.setPrivate(account.name + ".minute.key", accountKey);
                aemConfig.setPrivate(account.name + ".hour.key", accountKey);
                return getStorageAccountProperties(storageClient, account.rgp, account.name);
            }).then(function(properties){
                //ispremium
                i += 1;
                if (properties.accountType.startsWith("Standard")) {
                    if (i >= 0)
                        aemConfig.setPublic('disk.type.' + i, "Standard");
                    else
                        aemConfig.setPublic('osdisk.type' + i, "Standard");
                } else {
                    if (i >= 0)
                        aemConfig.setPublic('disk.type.' + i, "Premium");
                    else
                        aemConfig.setPublic('osdisk.type' + i, "Premium");
                    aemConfig.setPublic(account.name + ".hour.ispremium", 1);
                    aemConfig.setPublic(account.name + ".minute.ispremium", 1);
                }
                
                //endpoints
                var endpoints = properties.primaryEndpoints;
                
                var tableEndpoint;
                var blobEndpoint;
                endpoints.forEach(function(endpoint){
                    if(endpoint.match(/.*table.*/)){
                        tableEndpoint = endpoint;
                    }else if(endpoint.match(/.*blob.*/)){
                        blobEndpoint = endpoint;
                    }
                });
                account.tableEndpoint = tableEndpoint;
                account.blobEndpoint = blobEndpoint;
                var minuteUri = tableEndpoint + BlobMetricsMinuteTable;
                var hourUri = tableEndpoint + BlobMetricsHourTable;
                account.minuteUri = minuteUri
                aemConfig.setPublic(account.name + ".hour.uri", hourUri);
                aemConfig.setsetPrivate(account.name + ".hour.key", account.key);
                aemConfig.setPublic(account.name + ".minute.uri", minuteUri);
                aemConfig.setsetPrivate(account.name + ".minute.key", account.key);
                aemConfig.setPublic(account.name + ".hour.name", account.name);
                aemConfig.setPublic(account.name + ".minute.name", account.name);
            }).then(function(){
                return checkStorageAccountAnalytics(account.name, 
                                                    account.key,
                                                    account.blobEndpoint);
            });
            promises.push(promise);
        });
        return Promise.all(promises);
    }).then(function(res){
        //Set Linux diagnostic config
        aemConfig.setPublic("wad.name", accounts[0].name);
        aemConfig.setPublic("wad.isenabled", 1);
        var ladUri = accounts[0].tableEndpoint + ladMetricesTable;
        console.log("[INFO]Your endpoint is: "+accounts[0].tableEndpoint);
        aemConfig.setPublic("wad.uri", ladUri);
        aemConfig.setPrivate("wad.key", accounts[0].key);
    }).then(function(){
        //Update vm
        var extensions = [];
        var ladExtConfig = {
            'name' : ladExtName,
            'referenceName' : ladExtName,
            'publisher' : ladExtPublisher,
            'version' : ladExtVersion,
            'state': 'Enable',
            'resourceExtensionParameterValues' : [{
                'key' : ladExtName + "PrivateConfigParameter",
                'value' : JSON.stringify({
                    'storageAccountName' : accounts[0].name,
                    'storageAccountKey' : accounts[0].key,
                    'endpoint' : accounts[0].tableEndpoint.substring((accounts[0].tableEndpoint.search(/\./)) + 1, accounts[0].tableEndpoint.length)
                }),
                'type':'Private'
            }]
        };
        var aemExtConfig = {
            'name' : aemExtName,
            'referenceName' : aemExtName,
            'publisher' : aemExtPublisher,
            'version' : aemExtVersion,
            'state': 'Enable',
            'resourceExtensionParameterValues' : [
                aemConfig.getPublic(), 
                aemConfig.getPrivate()
            ]
        };
        extensions.push(ladExtConfig);
        extensions.push(aemExtConfig);
        selectedVM.provisionGuestAgent = true;
        selectedVM.resourceExtensionReferences = extensions;
        console.log("[INFO]Updating configuration for VM: " + selectedVM.roleName);
        console.log("[INFO]This could take a few minutes. Please wait.")
        debug && console.log(JSON.stringify(selectedVM, null, 4)) 
        return updateVirtualMachine(computeClient, svcName, vmName, selectedVM);
    });
}

var updateVirtualMachine = function (client, svcName, vmName, parameters){
    return new Promise(function(fullfill, reject){
        client.virtualMachines.update(svcName, vmName, vmName, parameters, 
                                      function(err, ret){
            if(err){
                reject(err)
            } else {
                fullfill(ret);
            } 
        });
    });
}

var getStorageAccountProperties = function(storageClient, rgpName, accountName){
    return new Promise(function(fullfill, reject){
        storageClient.storageAccounts.getProperties(rgpName, accountName, function(err, res){
            if(err){
                reject(err);
            } else {
                fullfill(res.storageAccounts.properties);
            }
        });
    });
};

var getResourceGroupName = function(storageClient, accountName) {
    return new Promise(function(fullfill, reject){
        storageClient.storageAccounts.list(function(err, res){
            if(err){
                reject(err);
            } else {
                res.storageAccounts.forEach(function (storage) {
                    var matchRgp = /resourceGroups\/(.+?)\/.*/.exec(storage.id);
                    var matchAct = /storageAccounts\/(.+?)$/.exec(storage.id);
                    if (matchAct[1] == accountName) {
                        fullfill(matchRgp[1]);
                    }
                });
            }
        });
    });
};

var getStorageAccountKey = function(storageClient, rgpName, accountName){
    console.log("123");
    return new Promise(function(fullfill, reject){
        storageClient.storageAccounts.listKeys(rgpName, accountName, function(err, res){
            console.log("??");
            if (err) {
                reject(err);
            } else {
                fullfill(res);
            }
        });
    });
};

var getStorageAccountAnalytics = function(accountName, accountKey, host){
    return new Promise(function(fullfill, reject){
        var blobService = storage.createBlobService(accountName, accountKey, 
                                                    host); 
        blobService.getServiceProperties(null, function(err, properties, resp){
            if(err){
                reject(err)
            } else {
                fullfill(properties);
            }
        });
    });
};

var analyticsSettings = {
    Logging:{ 
        Version: '1.0',
        Delete: true,
        Read: true,
        Write: true,
        RetentionPolicy: { Enabled: true, Days: 13 } },
    HourMetrics:{ 
        Version: '1.0',
        Enabled: true,
        IncludeAPIs: true,
        RetentionPolicy: { Enabled: true, Days: 13 } },
    MinuteMetrics:{ 
        Version: '1.0',
        Enabled: true,
        IncludeAPIs: true,
        RetentionPolicy: { Enabled: true, Days: 13 } 
    } 
};

var checkStorageAccountAnalytics = function(accountName, accountKey, host){
   return getStorageAccountAnalytics(accountName, accountKey, host)
     .then(function(properties){
        if(!properties 
                || !properties.Logging
                || !properties.Logging.Read 
                || !properties.Logging.Write
                || !properties.Logging.Delete
                || !properties.MinuteMetrics
                || !properties.MinuteMetrics.Enabled
                || !properties.MinuteMetrics.RetentionPolicy
                || !properties.MinuteMetrics.RetentionPolicy.Enabled
                || !properties.MinuteMetrics.RetentionPolicy.Days
                || properties.MinuteMetrics.RetentionPolicy.Days == 0
                ){
            console.log("[INFO] Turn on storage analytics for: " + accountName)
            return setStorageAccountAnalytics(accountName, accountKey, host,
                                              analyticsSettings);
        }
   });
}

var setStorageAccountAnalytics = function(accountName, accountKey, 
                                          host, properties){
    return new Promise(function(fullfill, reject){
        var blobService = storage.createBlobService(accountName, accountKey,
                                                    host); 
        blobService.setServiceProperties(properties, null, 
                                         function(err, properties, resp){
            if(err){
                reject(err)
            } else {
                fullfill(properties);
            }
        });
    });
};

var getStorageAccountFromUri = function(uri){
    var match = /https:\/\/(.+?)\..*/.exec(uri);
    if(match){
        return match[1];
    }
}

var getVirtualMachine = function(computeClient, rgpName, vmName){
    return new Promise(function(fullfill, reject){
        computeClient.virtualMachines.get(rgpName, vmName, 
                                            function(err, res){
            if(err){
                reject(err);
            } else {
                fullfill(res.virtualMachine);
            }
        });
    });
}

var getCloudCredential = function(subscription){
    var cred;
    if(subscription.credential.type === 'cert'){
        cred = computeMgmt.createCertificateCloudCredentials({
            subscriptionId:subscription.id ,
            cert:subscription.managementCertificate.cert,
            key:subscription.managementCertificate.key,
        });
    }else{//if(subscription.credential.type === 'token'){
       cred = new common.TokenCloudCredentials({
            subscriptionId : subscription.id,
            token : subscription.credential.token  
       });
    } 
    return cred;
}

var getAzureProfile = function(){
    var profileJSON = path.join(getUserHome(), ".azure/azureProfile.json");
    return readFile(profileJSON).then(function(result){
        var profile = JSON.parse(result);
        return profile;
    });
}

var getDefaultSubscription = function(profile){
    debug && console.log(JSON.stringify(profile, null, 4))
    if(profile == null || profile.subscriptions == null 
            || profile.subscriptions.length == 0){
        throw "No subscription found."
    }
    console.log("[INFO]Found available subscriptions:");
    console.log("");
    console.log("    Id\t\t\t\t\t\tName");
    console.log("    --------------------------------------------------------");
    profile.subscriptions.forEach(function(subscription){
        console.log("    " + subscription.id + "\t" + subscription.name);
    });
    console.log("");
    var defaultSubscription;
    profile.subscriptions.every(function(subscription, index, arr){
        if(subscription.isDefault){
            defaultSubscription = subscription;
            return false;
        } else {
            return true;
        }
    });

    if(defaultSubscription == null){
        console.log("[WARN]No subscription is selected.");
        defaultSubscription = profile.subscriptions[0];
        console.log("[INFO]The first subscription will be used.");
        console.log("[INFO]You could use the following command to select " + 
                    "another subscription.");
        console.log("");
        console.log("    azure account set [<subscript_id>|<subscript_name>]");
        console.log("");
    }
    if(defaultSubscription.user){
        return getTokenCredential(defaultSubscription);
    } else if(defaultSubscription.managementCertificate){
        return getCertCredential(defaultSubscription);
    } else {
        throw "Unknown subscription type.";
    }
}

var getTokenCredential = function(subscription){
    var tokensJSON = path.join(getUserHome(), ".azure/accessTokens.json");
    return readFile(tokensJSON).then(function(result){
        var tokens = JSON.parse(result);
        tokens.every(function(token, index, arr){
            if(token.userId === subscription.user.name){
                subscription.credential = {
                    type : 'token',
                    token : token.accessToken
                };
                return false
            }
        });
        return subscription;
    });
}

var getCertCredential = function(subscription){
    subscription.credential = {
        type : 'cert',
        cert : subscription.managementCertificate
    };
    return subscription;
}

function getUserHome() {
  return process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
}

var main = function(){
    var rgpName = null;
    var vmName = null;
    if(process.argv.length === 4){
        vmName = process.argv[3];
        rgpName = process.argv[2];
    } else if(process.argv.length === 3){
        if(process.argv[2] === "--help" || process.argv[2] === "-h"){
            usage();
            process.exit(0);
        } else if(process.argv[2] === "--version" || process.argv[2] === "-v"){
            console.log(CurrentScriptVersion);
            process.exit(0);
        }
        vmName = process.argv[2];
        rgpName = vmName;
    } else{
        usage();
        process.exit(1);
    }

    setAzureVMEnhancedMonitorForLinux(rgpName, vmName).done(function(){
        console.log("[INFO]Azure Enhanced Monitoring Extension " + 
                    "configuration updated.");
        console.log("[INFO]It can take up to 15 Minutes for the " + 
                    "monitoring data to appear in the system.");
        process.exit(0);
    }, function(err){
        if(err && err.statusCode == 401){
            console.error("[ERROR]Token expired. " + 
                          "Please run the following command to login.");
            console.log("    ");
            console.log("    azure login");
            console.log("or");
            console.log("    azure account import <pem_file>");
            process.exit(-1);
        }else{
            console.log(err);
            console.log(err.stack);
            process.exit(-1);
        }
    });
}

var usage = function(){
    console.log("");
    console.log("Usage:");
    console.log("    setaem <service_name> <vm_name>");
    console.log("or");
    console.log("    setaem <vm_name>");
    console.log("");
    console.log("  *if service_name and vm_name are the same, " + 
                "service_name could be omitted.");
    console.log("");
    console.log("    ");
    console.log("    -h, --help ");
    console.log("        Print help.");
    console.log("    ");
    console.log("    -v, --version");
    console.log("        Print version.");
    console.log("    ");
}

main();


================================================
FILE: AzureMonitorAgent/.gitignore
================================================
MetricsExtensionBin/
metrics_ext_utils/
packages/
telegraf_utils/
Utils/
waagent


================================================
FILE: AzureMonitorAgent/HandlerManifest.json
================================================
[
  {
    "name":  "AzureMonitorLinuxAgent",
    "version": "1.5.124",
    "handlerManifest": {
      "installCommand": "./shim.sh -install",
      "uninstallCommand": "./shim.sh -uninstall",
      "updateCommand": "./shim.sh -update",
      "enableCommand": "./shim.sh -enable",
      "disableCommand": "./shim.sh -disable",
      "rebootAfterInstall": false,
      "reportHeartbeat": false,
      "updateMode": "UpdateWithInstall",
      "continueOnUpdateFailure": true
    },
    "resourceLimits": {
      "services": [
        {
          "name": "azuremonitoragent",
          "cpuQuotaPercentage": 250
        },
        {
          "name": "azuremonitoragentmgr"
        },
        {
          "name": "azuremonitor-agentlauncher",
          "cpuQuotaPercentage": 4
        },
        {
          "name": "azuremonitor-coreagent",
          "cpuQuotaPercentage": 200
        },
        {
          "name": "metrics-extension",
          "cpuQuotaPercentage": 5
        },
        {
          "name": "metrics-sourcer",
          "cpuQuotaPercentage": 10
        }
      ]
    }
  }
]


================================================
FILE: AzureMonitorAgent/README.md
================================================
# AzureMonitorLinuxAgent Extension
Allow the owner of the Azure Virtual Machines to install the Azure Monitor Linux Agent

# The Latest Version is 1.6.2
The extension is currently in Public Preview and is accessible to all public cloud regions in Azure. 

You can read the User Guide below.
* [Learn more: Azure Virtual Machine Extensions](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-extensions-features/)

Azure Monitor Linux Agent Extension can:
* Install the agent and pull configs from MCS

# User Guide

## 1. Deploying the Extension to a VM

You can deploy it using Azure CLI


 
### 1.1. Using Azure CLI Resource Manager

You can view the availability of the Azure Monitor Linux Agent extension versions in each region by running:

```
az vm extension image list-versions -l <region> --name AzureMonitorLinuxAgent -p Microsoft.Azure.Monitor
```

You can deploy the Azure Monitor Linux Agent Extension by running:
```
az vm extension set --name AzureMonitorLinuxAgent --publisher Microsoft.Azure.Monitor --version <version> --resource-group <My Resource Group> --vm-name <My VM Name>
```

To update the version of the esisting installation of Azure Monitor Linux Agent extension on a VM, please add "--force-update" flag to the above command. (Currenty Waagent only supports this way of upgrading. Will update once we have more info from them.)


## Supported Linux Distributions 
 Currently Manually tested only on -
* CentOS Linux 6, and 7 (x64)
* Red Hat Enterprise Linux Server 6 and 7 (x64)
* Ubuntu 16.04 LTS, 18.04 LTS(x64)

Will Add more distros once they are tested

## Troubleshooting

* The status of the extension is reported back to Azure so that user can
see the status on Azure Portal
* All the extension installation and config files are unzipped into - 
`/var/lib/waagent/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-<version>/packages/`
and the tail of the output is logged into the log directory specified
in HandlerEnvironment.json and reported back to Azure
* The operation log of the extension is `/var/log/azure/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-<version>/extension.log` file.


================================================
FILE: AzureMonitorAgent/agent.py
================================================
#!/usr/bin/env python
#
# AzureMonitoringLinuxAgent Extension
#
# Copyright 2021 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function
import sys
import os
import os.path
import datetime
import signal
import pwd
import glob
import grp
import re
import filecmp
import stat
import traceback
import time
import platform
import subprocess
import json
import base64
import inspect
import shutil
import hashlib
import fileinput
import contextlib
import ama_tst.modules.install.supported_distros as supported_distros
from collections import OrderedDict
from hashlib import sha256
from shutil import copyfile, rmtree, copytree, copy2

from threading import Thread
import telegraf_utils.telegraf_config_handler as telhandler
import metrics_ext_utils.metrics_constants as metrics_constants
import metrics_ext_utils.metrics_ext_handler as me_handler
import metrics_ext_utils.metrics_common_utils as metrics_utils

try:
    import urllib.request as urllib # Python 3+
except ImportError:
    import urllib2 as urllib # Python 2

try:
    from urllib.parse import urlparse  # Python 3+
except ImportError:
    from urlparse import urlparse  # Python 2

try:
    import urllib.error as urlerror # Python 3+
except ImportError:
    import urllib2 as urlerror # Python 2


# python shim can only make IMDS calls which shouldn't go through proxy
try:
    urllib.getproxies = lambda x = None: {}
except Exception as e:
    print('Resetting proxies failed with error: {0}'.format(e))    

try:
    from Utils.WAAgentUtil import waagent
    import Utils.HandlerUtil as HUtil
except Exception as e:
    # These utils have checks around the use of them; this is not an exit case
    print('Importing utils failed with error: {0}'.format(e))

# This code is taken from the omsagent's extension wrapper.
# This same monkey patch fix is relevant for AMA extension as well.
# This monkey patch duplicates the one made in the waagent import above.
# It is necessary because on 2.6, the waagent monkey patch appears to be overridden
# by the python-future subprocess.check_output backport.
if sys.version_info < (2,7):
    def check_output(*popenargs, **kwargs):
        r"""Backport from subprocess module from python 2.7"""
        if 'stdout' in kwargs:
            raise ValueError('stdout argument not allowed, it will be overridden.')
        process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
        output, unused_err = process.communicate()
        retcode = process.poll()
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
            raise subprocess.CalledProcessError(retcode, cmd, output=output)
        return output

    # Exception classes used by this module.
    class CalledProcessError(Exception):
        def __init__(self, returncode, cmd, output=None):
            self.returncode = returncode
            self.cmd = cmd
            self.output = output

        def __str__(self):
            return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)

    subprocess.check_output = check_output
    subprocess.CalledProcessError = CalledProcessError

# Global Variables
PackagesDirectory = 'packages'
# The BundleFileName values will be replaced by actual values in the release pipeline. See apply_version.sh.
BundleFileNameDeb = 'azuremonitoragent.deb'
BundleFileNameRpm = 'azuremonitoragent.rpm'
BundleFileName = ''
TelegrafBinName = 'telegraf'
InitialRetrySleepSeconds = 30
PackageManager = ''
PackageManagerOptions = ''
MdsdCounterJsonPath = '/etc/opt/microsoft/azuremonitoragent/config-cache/metricCounters.json'
FluentCfgPath = '/etc/opt/microsoft/azuremonitoragent/config-cache/fluentbit/td-agent.conf'
AMASyslogConfigMarkerPath = '/etc/opt/microsoft/azuremonitoragent/config-cache/syslog.marker'
AMASyslogPortFilePath = '/etc/opt/microsoft/azuremonitoragent/config-cache/syslog.port'
AMAFluentPortFilePath = '/etc/opt/microsoft/azuremonitoragent/config-cache/fluent.port'
PreviewFeaturesDirectory = '/etc/opt/microsoft/azuremonitoragent/config-cache/previewFeatures/'
ArcSettingsFile = '/var/opt/azcmagent/localconfig.json'
AMAAstTransformConfigMarkerPath = '/etc/opt/microsoft/azuremonitoragent/config-cache/agenttransform.marker'
AMAExtensionLogRotateFilePath = '/etc/logrotate.d/azuremonitoragentextension'
WAGuestAgentLogRotateFilePath = '/etc/logrotate.d/waagent-extn.logrotate'
AmaUninstallContextFile = '/var/opt/microsoft/uninstall-context'
AmaDataPath = '/var/opt/microsoft/azuremonitoragent/'
SupportedArch = set(['x86_64', 'aarch64'])
MDSDFluentPort = 0
MDSDSyslogPort = 0

# Error codes
GenericErrorCode = 1
UnsupportedOperatingSystem = 51
IndeterminateOperatingSystem = 51
MissingorInvalidParameterErrorCode = 53
DPKGOrRPMLockedErrorCode = 56
MissingDependency = 52

# Settings
GenevaConfigKey = "genevaConfiguration"
AzureMonitorConfigKey = "azureMonitorConfiguration"

# Configuration
HUtilObject = None
SettingsSequenceNumber = None
HandlerEnvironment = None
SettingsDict = None


def main():
    """
    Main method
    Parse out operation from argument, invoke the operation, and finish.
    """
    init_waagent_logger()
    waagent_log_info('Azure Monitoring Agent for Linux started to handle.')

    # Determine the operation being executed
    operation = None
    try:
        option = sys.argv[1]
        if re.match('^([-/]*)(disable)', option):
            operation = 'Disable'
        elif re.match('^([-/]*)(uninstall)', option):
            operation = 'Uninstall'
        elif re.match('^([-/]*)(install)', option):
            operation = 'Install'
        elif re.match('^([-/]*)(enable)', option):
            operation = 'Enable'
        elif re.match('^([-/]*)(update)', option):
            operation = 'Update'
        elif re.match('^([-/]*)(metrics)', option):
            operation = 'Metrics'
        elif re.match('^([-/]*)(syslogconfig)', option):
            operation = 'Syslogconfig'
        elif re.match('^([-/]*)(transformconfig)', option):
            operation = 'Transformconfig'
    except Exception as e:
        waagent_log_error(str(e))

    if operation is None:
        log_and_exit('Unknown', GenericErrorCode, 'No valid operation provided')

    # Set up for exit code and any error messages
    exit_code = 0
    message = '{0} succeeded'.format(operation)

    # Avoid entering broken state where manual purge actions are necessary in low disk space scenario
    destructive_operations = ['Disable', 'Uninstall']
    if operation not in destructive_operations:
        exit_code = check_disk_space_availability()
        if exit_code != 0:
            message = '{0} failed due to low disk space'.format(operation)
            log_and_exit(operation, exit_code, message)

    # Invoke operation
    try:
        global HUtilObject
        HUtilObject = parse_context(operation)
        exit_code, output = operations[operation]()

        # Exit code 1 indicates a general problem that doesn't have a more
        # specific error code; it often indicates a missing dependency
        if exit_code == 1 and operation == 'Install':
            message = 'Install failed with exit code 1. For error details, check logs ' \
                      'in /var/log/azure/Microsoft.Azure.Monitor' \
                      '.AzureMonitorLinuxAgent'
        elif exit_code is DPKGOrRPMLockedErrorCode and operation == 'Install':
            message = 'Install failed with exit code {0} because the ' \
                      'package manager on the VM is currently locked: ' \
                      'please wait and try again'.format(DPKGOrRPMLockedErrorCode)
        elif exit_code != 0:
            message = '{0} failed with exit code {1} {2}'.format(operation,
                                                             exit_code, output)

    except AzureMonitorAgentForLinuxException as e:
        exit_code = e.error_code
        message = e.get_error_message(operation)
    except Exception as e:
        exit_code = GenericErrorCode
        message = '{0} failed with error: {1}\n' \
                  'Stacktrace: {2}'.format(operation, e,
                                           traceback.format_exc())

    # Finish up and log messages
    log_and_exit(operation, exit_code, message)

def check_disk_space_availability():
    """
    Check if there is the required space on the machine.
    """
    try:
        if get_free_space_mb("/var") < 700 or get_free_space_mb("/etc") < 500 or get_free_space_mb("/opt") < 500 :
            # 52 is the exit code for missing dependency i.e. disk space
            # https://github.com/Azure/azure-marketplace/wiki/Extension-Build-Notes-Best-Practices#error-codes-and-messages-output-to-stderr
            return MissingDependency
        else:
            return 0
    except:
        print('Failed to check disk usage.')
        return 0

def get_free_space_mb(dirname):
    """
    Get the free space in MB in the directory path.
    """
    st = os.statvfs(dirname)
    return (st.f_bavail * st.f_frsize) // (1024 * 1024)

def is_systemd():
    """
    Check if the system is using systemd
    """
    return os.path.isdir("/run/systemd/system")

def get_service_command(service, *operations):
    """
    Get the appropriate service command [sequence] for the provided service name and operation(s)
    """
    if is_systemd():
        return " && ".join(["systemctl {0} {1}".format(operation, service) for operation in operations])
    else:
        hutil_log_info("The VM doesn't have systemctl. Using the init.d service to start {0}.".format(service))
        return '/etc/init.d/{0} {1}'.format(service, operations[0])

def check_kill_process(pstring):
    for line in os.popen("ps ax | grep " + pstring + " | grep -v grep"):
        fields = line.split()
        pid = fields[0]
        os.kill(int(pid), signal.SIGKILL)

def compare_and_copy_bin(src, dest):
    # Check if previous file exist at the location, compare the two binaries,
    # If the files are not same, remove the older file, and copy the new one
    # If they are the same, then we ignore it and don't copy
    if os.path.isfile(src ):
        if os.path.isfile(dest):
            if not filecmp.cmp(src, dest):
                # Removing the file in case it is already being run in a process,
                # in which case we can get an error "text file busy" while copying
                os.remove(dest)
                copyfile(src, dest)

        else:
            # No previous binary exist, simply copy it and make it executable
            copyfile(src, dest)
        
        os.chmod(dest, stat.S_IXGRP | stat.S_IRGRP | stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IXOTH | stat.S_IROTH)

def set_metrics_binaries():
    current_arch = platform.machine()
    # Rename the Arch appropriate metrics extension binary to MetricsExtension
    MetricsExtensionDir = os.path.join(os.getcwd(), 'MetricsExtensionBin')
    SupportedMEPath = os.path.join(MetricsExtensionDir, 'metricsextension_'+current_arch)

    if os.path.exists(SupportedMEPath):
        os.rename(SupportedMEPath, os.path.join(MetricsExtensionDir, 'MetricsExtension'))

    # Cleanup unused ME binaries
    for f in os.listdir(MetricsExtensionDir):
        if f != 'MetricsExtension':
            os.remove(os.path.join(MetricsExtensionDir, f))

def copy_amacoreagent_binaries():
    current_arch = platform.machine()
    amacoreagent_bin_local_path = os.getcwd() + "/amaCoreAgentBin/amacoreagent_" + current_arch
    amacoreagent_bin = "/opt/microsoft/azuremonitoragent/bin/amacoreagent"
    compare_and_copy_bin(amacoreagent_bin_local_path, amacoreagent_bin)

    if current_arch == 'x86_64':
        #libgrpc_bin_local_path = os.getcwd() + "/amaCoreAgentBin/libgrpc_csharp_ext.x64.so"
        #libgrpc_bin = "/opt/microsoft/azuremonitoragent/bin/libgrpc_csharp_ext.x64.so"
        #compare_and_copy_bin(libgrpc_bin_local_path, libgrpc_bin)

        liblz4x64_bin_local_path = os.getcwd() + "/amaCoreAgentBin/liblz4x64.so"
        liblz4x64_bin = "/opt/microsoft/azuremonitoragent/bin/liblz4x64.so"
        compare_and_copy_bin(liblz4x64_bin_local_path, liblz4x64_bin)   
    #elif current_arch == 'aarch64':
        #libgrpc_bin_local_path = os.getcwd() + "/amaCoreAgentBin/libgrpc_csharp_ext.arm64.so"
        #libgrpc_bin = "/opt/microsoft/azuremonitoragent/bin/libgrpc_csharp_ext.arm64.so"
        #compare_and_copy_bin(libgrpc_bin_local_path, libgrpc_bin)
                  
    agentlauncher_bin_local_path = os.getcwd() + "/agentLauncherBin/agentlauncher_" + current_arch
    agentlauncher_bin = "/opt/microsoft/azuremonitoragent/bin/agentlauncher"
    compare_and_copy_bin(agentlauncher_bin_local_path, agentlauncher_bin)

def copy_mdsd_fluentbit_binaries():
    current_arch = platform.machine()
    mdsd_bin_local_path = os.getcwd() + "/mdsdBin/mdsd_" + current_arch
    mdsdmgr_bin_local_path = os.getcwd() + "/mdsdBin/mdsdmgr_" + current_arch
    fluentbit_bin_local_path = os.getcwd() + "/fluentBitBin/fluent-bit_" + current_arch
    mdsd_bin = "/opt/microsoft/azuremonitoragent/bin/mdsd"
    mdsdmgr_bin = "/opt/microsoft/azuremonitoragent/bin/mdsdmgr"
    fluentbit_bin = "/opt/microsoft/azuremonitoragent/bin/fluent-bit"

    # copy the required libs to our test directory first
    lib_dir = os.path.join(os.getcwd(), "lib")
    if os.path.exists(lib_dir):
        rmtree(lib_dir)

    if sys.version_info >= (3, 8):
        # dirs_exist_ok parameter was added in Python 3.8
        copytree("/opt/microsoft/azuremonitoragent/lib", lib_dir, dirs_exist_ok=True)
    else:
        copytree("/opt/microsoft/azuremonitoragent/lib", lib_dir)
    
    canUseSharedmdsd, _ = run_command_and_log('ldd ' + mdsd_bin_local_path + ' | grep "not found"')
    canUseSharedmdsdmgr, _ = run_command_and_log('ldd ' + mdsdmgr_bin_local_path + ' | grep "not found"')
    if canUseSharedmdsd != 0 and canUseSharedmdsdmgr != 0:        
        compare_and_copy_bin(mdsd_bin_local_path, mdsd_bin)
        compare_and_copy_bin(mdsdmgr_bin_local_path, mdsdmgr_bin)

    canUseSharedfluentbit, _ = run_command_and_log('ldd ' + fluentbit_bin_local_path + ' | grep "not found"')
    if canUseSharedfluentbit != 0:
        compare_and_copy_bin(fluentbit_bin_local_path, fluentbit_bin)

    rmtree(os.getcwd() + "/lib")    

def get_installed_package_version():
    """
    Returns if Azure Monitor Agent is installed and a list of installed version of the Azure Monitor Agent package.
    Returns: (is_installed, version_list)
    """
    if PackageManager == "dpkg":
        # In the case of dpkg, we specify only Package and Version as architecture is written as amd64/arm64 instead of x86_64/aarch64.
        cmd = "dpkg-query -W -f='${Package}_${Version}\n' 'azuremonitoragent*' 2>/dev/null"
    elif PackageManager == "rpm":
        cmd = "rpm -q azuremonitoragent"
    else:
        hutil_log_error("Could not determine package manager.")
        return False, []

    exit_code, output = run_command_and_log(cmd, check_error=False)

    if exit_code != 0 or not output:
        hutil_log_info("Azure Monitor Agent package not found after running {0}.".format(cmd))
        return False, []

    version_list = output.strip().split('\n')
    return True, version_list

def get_current_bundle_file():
    if PackageManager == 'dpkg':
        return BundleFileNameDeb.rsplit('.deb', 1)[0]  # Remove .deb extension
    elif PackageManager == 'rpm':
        return BundleFileNameRpm.rsplit('.rpm', 1)[0]  # Remove .rpm extension
    return ""

def install():
    """
    Ensure that this VM distro and version are supported.
    Install the Azure Monitor Linux Agent package, using retries.
    Note: install operation times out from WAAgent at 15 minutes, so do not
    wait longer.
    """

    exit_if_vm_not_supported('Install')
    find_package_manager("Install")
    set_os_arch('Install')
    vm_dist, vm_ver = find_vm_distro('Install')

    # Check if Debian 12 and 13 VMs have rsyslog package (required for AMA 1.31+)
    if (vm_dist.startswith('debian')) and ((vm_ver.startswith('12') or vm_ver.startswith('13')) or int(vm_ver.split('.')[0]) >= 12):
        check_rsyslog, _ = run_command_and_log("dpkg -s rsyslog")
        if check_rsyslog != 0:
            hutil_log_info("'rsyslog' package missing from Debian {0} machine, installing to allow AMA to run.".format(vm_ver))
            rsyslog_exit_code, rsyslog_output = run_command_and_log("DEBIAN_FRONTEND=noninteractive apt-get update && \
                                                                    DEBIAN_FRONTEND=noninteractive apt-get install -y rsyslog")
            if rsyslog_exit_code != 0:
                return rsyslog_exit_code, rsyslog_output
    
    # Check if Amazon 2023 VMs have rsyslog package (required for AMA 1.31+)
    if (vm_dist.startswith('amzn')) and vm_ver.startswith('2023'):
        check_rsyslog, _ = run_command_and_log("dnf list installed | grep rsyslog.x86_64")
        if check_rsyslog != 0:
            hutil_log_info("'rsyslog' package missing from Amazon Linux 2023 machine, installing to allow AMA to run.")
            rsyslog_exit_code, rsyslog_output = run_command_and_log("dnf install -y rsyslog")
            if rsyslog_exit_code != 0:
                return rsyslog_exit_code, rsyslog_output
    
    # Flag to handle the case where the same package is already installed
    same_package_installed = False

    # Check if the package is already installed with the correct version
    is_installed, installed_versions = get_installed_package_version()

    # Check if the package is already installed, if so determine if it is the same as the bundle or not
    if is_installed:
        hutil_log_info("Found installed azuremonitoragent version(s): {0}".format(installed_versions))
        # Check if already have this version of AMA installed, if so, no-op for install of AMA
        if len(installed_versions) == 1:
            current_bundle = get_current_bundle_file()
            hutil_log_info("Current bundle file: {0}".format(current_bundle))
            package_name = installed_versions[0]

            # This is to make sure dpkg's package name is in the same format as the BundleFileNameDeb
            if PackageManager == 'dpkg':
                architecture = ''
                if platform.machine() == 'x86_64':
                    architecture = '_x86_64'
                elif platform.machine() == 'aarch64':
                    architecture = '_aarch64'
                # need to change the ending from amd64 to x86_64 and arm64 to aarch64
                package_name = package_name + architecture
            if current_bundle == package_name:
                hutil_log_info("This version of azuremonitoragent package is already installed. Skipping package install.")
                same_package_installed = True
        else:
            hutil_log_error("Multiple versions of azuremonitoragent package found: {0}\n This is undefined behavior, we recommend running the following:".format(installed_versions))

            if PackageManager == 'dpkg':
                hutil_log_error("Run the following command first:\n dpkg --purge azuremonitoragent. If this does not work try the following with caution:\n"
                "'rm /var/lib/dpkg/info/azuremonitoragent.*' followed by 'dpkg --force-all -P azuremonitoragent'")
            elif PackageManager == 'rpm': # For reference AzureLinux 3.0 also falls under this category
                hutil_log_error("Run the following command first: ")
                hutil_log_error("'rpm -q azuremonitoragent' and for each version run: rpm -e azuremonitoragent-(version)-(bundle_number).(architecture), or rpm -e --deleteall azuremonitoragent\n An example of the command is as follows: rpm -e {0}".format(installed_versions[0]))
                hutil_log_error("If the following does not work please try the following: rpm -e --noscripts --nodeps azuremonitoragent-(version)-(bundle_number).(architecture). I.e. rpm -e --noscripts --nodeps {0}".format(installed_versions[0]))

    # If the same bundle of Azure Monitor Agent package is not already installed, proceed with installation
    if not same_package_installed:
        hutil_log_info("Installing Azure Monitor Agent package.")
        package_directory = os.path.join(os.getcwd(), PackagesDirectory)
        bundle_path = os.path.join(package_directory, BundleFileName)
        os.chmod(bundle_path, 100)
        print(PackageManager, " and ", BundleFileName)
        AMAInstallCommand = "{0} {1} -i {2}".format(PackageManager, PackageManagerOptions, bundle_path)
        hutil_log_info('Running command "{0}"'.format(AMAInstallCommand))

        # Try to install with retry, since install can fail due to concurrent package operations
        exit_code, output = run_command_with_retries_output(AMAInstallCommand, retries = 15,
                                            retry_check = retry_if_dpkg_or_rpm_locked,
                                            final_check = final_check_if_dpkg_or_rpm_locked)

        # Retry install for aarch64 rhel8 VMs as initial install fails to create symlink to /etc/systemd/system/azuremonitoragent.service
        # in /etc/systemd/system/multi-user.target.wants/azuremonitoragent.service
        if vm_dist.replace(' ','').lower().startswith('redhat') and vm_ver == '8.6' and platform.machine() == 'aarch64':
            exit_code, output = run_command_with_retries_output(AMAInstallCommand, retries = 15,
                                            retry_check = retry_if_dpkg_or_rpm_locked,
                                            final_check = final_check_if_dpkg_or_rpm_locked)

        if exit_code != 0:
            return exit_code, output

        # System daemon reload is required for systemd to pick up the new service
        exit_code, output = run_command_and_log("systemctl daemon-reload")
        if exit_code != 0:
            return exit_code, output

    # Copy the AMACoreAgent and agentlauncher binaries
    copy_amacoreagent_binaries()

    set_metrics_binaries()

    # Copy AstExtension binaries
    # Needs to be revisited for aarch64
    copy_astextension_binaries()

    # Copy mdsd and fluent-bit with OpenSSL dynamically linked
    if is_feature_enabled('useDynamicSSL'):
        # Check if they have libssl.so.1.1 since AMA is built against this version
        libssl1_1, _ = run_command_and_log('ldconfig -p | grep libssl.so.1.1')
        if libssl1_1 == 0:
            copy_mdsd_fluentbit_binaries()
    
    # Set task limits to max of 65K in suse 12
    # Based on Task 9764411: AMA broken after 1.7 in sles 12 - https://dev.azure.com/msazure/One/_workitems/edit/9764411
    vm_dist, _ = find_vm_distro('Install')
    if (vm_dist.startswith('suse') or vm_dist.startswith('sles')):
        try:
            suse_exit_code, suse_output = run_command_and_log("mkdir -p /etc/systemd/system/azuremonitoragent.service.d")
            if suse_exit_code != 0:
                return suse_exit_code, suse_output

            suse_exit_code, suse_output = run_command_and_log("echo '[Service]' > /etc/systemd/system/azuremonitoragent.service.d/override.conf")
            if suse_exit_code != 0:
                return suse_exit_code, suse_output

            suse_exit_code, suse_output = run_command_and_log("echo 'TasksMax=65535' >> /etc/systemd/system/azuremonitoragent.service.d/override.conf")
            if suse_exit_code != 0:
                return suse_exit_code, suse_output

            suse_exit_code, suse_output = run_command_and_log("systemctl daemon-reload")
            if suse_exit_code != 0:
                return suse_exit_code, suse_output
        except:
            log_and_exit("install", MissingorInvalidParameterErrorCode, "Failed to update /etc/systemd/system/azuremonitoragent.service.d for suse 12,15" )

    return 0, "Azure Monitor Agent package installed successfully"

def uninstall():
    """
    Uninstall the Azure Monitor Linux Agent.
    Whether it is a purge of all files or preserve of log files depends on the uninstall context file.
    Note: uninstall operation times out from WAAgent at 5 minutes
    """

    exit_if_vm_not_supported('Uninstall')
    find_package_manager("Uninstall")

    # Before we uninstall, we need to ensure AMA is installed to begin with
    is_installed, installed_versions = get_installed_package_version()
    if not is_installed:
        hutil_log_info("Azure Monitor Agent is not installed, nothing to uninstall.")
        return 0, "Azure Monitor Agent is not installed, nothing to uninstall."

    if PackageManager != "dpkg" and PackageManager != "rpm":
        log_and_exit("Uninstall", UnsupportedOperatingSystem, "The OS has neither rpm nor dpkg." )

    # For clean uninstall, gather the file list BEFORE running the uninstall command
    # This ensures we have the complete list even after the package manager removes its database
    package_files_for_cleanup = []

    hutil_log_info("Gathering package file list for clean uninstall before removing package")
    package_files_for_cleanup = _get_package_files_for_cleanup()
        
    # Attempt to uninstall each specific

    # Try a specific package uninstall for rpm
    if PackageManager == "rpm":
        purge_cmd_template = "rpm -e {0}"    
        # Process each package
        for package_name in installed_versions:
            if not package_name.strip():
                continue
            
            package_name = package_name.strip()

            # Clean the package name and create uninstall command
            uninstall_command = purge_cmd_template.format(package_name)

            hutil_
Download .txt
gitextract_55atar1w/

├── .gitattributes
├── .gitignore
├── .gitmodules
├── .vscode/
│   └── launch.json
├── AzureEnhancedMonitor/
│   ├── README.md
│   ├── bin/
│   │   ├── pack.sh
│   │   └── setup.sh
│   ├── clib/
│   │   ├── .gitignore
│   │   ├── Makefile
│   │   ├── include/
│   │   │   └── azureperf.h
│   │   ├── src/
│   │   │   ├── apmetric.c
│   │   │   └── azureperf.c
│   │   └── test/
│   │       ├── cases/
│   │       │   └── positive_case
│   │       ├── codegen.py
│   │       ├── counter_names
│   │       └── runtest.c
│   ├── ext/
│   │   ├── .gitignore
│   │   ├── HandlerManifest.json
│   │   ├── aem.py
│   │   ├── handler.py
│   │   ├── installer.py
│   │   ├── references
│   │   └── test/
│   │       ├── env.py
│   │       ├── storage_metrics
│   │       ├── test_aem.py
│   │       └── test_installer.py
│   ├── hvinfo/
│   │   ├── .gitignore
│   │   ├── Makefile
│   │   └── src/
│   │       └── hvinfo.c
│   └── nodejs/
│       ├── package.json
│       └── setaem.js
├── AzureMonitorAgent/
│   ├── .gitignore
│   ├── HandlerManifest.json
│   ├── README.md
│   ├── agent.py
│   ├── agent.version
│   ├── ama_tst/
│   │   ├── AMA-Troubleshooting-Tool.md
│   │   ├── __init__.py
│   │   ├── ama_troubleshooter.sh
│   │   └── modules/
│   │       ├── __init__.py
│   │       ├── connect/
│   │       │   ├── __init__.py
│   │       │   ├── check_endpts.py
│   │       │   ├── check_imds.py
│   │       │   └── connect.py
│   │       ├── custom_logs/
│   │       │   ├── __init__.py
│   │       │   ├── check_clconf.py
│   │       │   └── custom_logs.py
│   │       ├── error_codes.py
│   │       ├── errors.py
│   │       ├── general_health/
│   │       │   ├── __init__.py
│   │       │   ├── check_status.py
│   │       │   └── general_health.py
│   │       ├── helpers.py
│   │       ├── high_cpu_mem/
│   │       │   ├── __init__.py
│   │       │   ├── check_logrot.py
│   │       │   ├── check_usage.py
│   │       │   └── high_cpu_mem.py
│   │       ├── install/
│   │       │   ├── __init__.py
│   │       │   ├── check_ama.py
│   │       │   ├── check_os.py
│   │       │   ├── check_pkgs.py
│   │       │   ├── install.py
│   │       │   └── supported_distros.py
│   │       ├── logcollector.py
│   │       ├── main.py
│   │       ├── metrics_troubleshooter/
│   │       │   ├── __init__.py
│   │       │   └── metrics_troubleshooter.py
│   │       └── syslog_tst/
│   │           ├── __init__.py
│   │           ├── check_conf.py
│   │           ├── check_rsysng.py
│   │           └── syslog.py
│   ├── apply_version.sh
│   ├── azuremonitoragentextension.logrotate
│   ├── manifest.xml
│   ├── packaging.sh
│   ├── references
│   ├── services/
│   │   ├── metrics-extension-cmv1.service
│   │   ├── metrics-extension-cmv2.service
│   │   └── metrics-extension-otlp.service
│   ├── shim.sh
│   └── update_version.sh
├── CODEOWNERS
├── Common/
│   ├── WALinuxAgent-2.0.14/
│   │   └── waagent
│   ├── WALinuxAgent-2.0.16/
│   │   └── waagent
│   ├── libpsutil/
│   │   ├── py2.6-glibc-2.12-pre/
│   │   │   └── psutil/
│   │   │       ├── __init__.py
│   │   │       ├── _common.py
│   │   │       ├── _compat.py
│   │   │       ├── _psbsd.py
│   │   │       ├── _pslinux.py
│   │   │       ├── _psosx.py
│   │   │       ├── _psposix.py
│   │   │       ├── _pssunos.py
│   │   │       └── _pswindows.py
│   │   └── py2.7-glibc-2.12+/
│   │       └── psutil/
│   │           ├── __init__.py
│   │           ├── _common.py
│   │           ├── _compat.py
│   │           ├── _psbsd.py
│   │           ├── _pslinux.py
│   │           ├── _psosx.py
│   │           ├── _psposix.py
│   │           ├── _pssunos.py
│   │           └── _pswindows.py
│   └── waagentloader.py
├── CustomScript/
│   ├── CHANGELOG.md
│   ├── HandlerManifest.json
│   ├── README.md
│   ├── azure/
│   │   ├── __init__.py
│   │   ├── azure.pyproj
│   │   ├── http/
│   │   │   ├── __init__.py
│   │   │   ├── batchclient.py
│   │   │   ├── httpclient.py
│   │   │   └── winhttp.py
│   │   ├── servicebus/
│   │   │   ├── __init__.py
│   │   │   └── servicebusservice.py
│   │   ├── servicemanagement/
│   │   │   ├── __init__.py
│   │   │   ├── servicebusmanagementservice.py
│   │   │   ├── servicemanagementclient.py
│   │   │   ├── servicemanagementservice.py
│   │   │   ├── sqldatabasemanagementservice.py
│   │   │   └── websitemanagementservice.py
│   │   └── storage/
│   │       ├── __init__.py
│   │       ├── blobservice.py
│   │       ├── cloudstorageaccount.py
│   │       ├── queueservice.py
│   │       ├── sharedaccesssignature.py
│   │       ├── storageclient.py
│   │       └── tableservice.py
│   ├── customscript.py
│   ├── manifest.xml
│   ├── references
│   ├── shim.sh
│   └── test/
│       ├── HandlerEnvironment.json
│       ├── MockUtil.py
│       ├── create_test_blob.py
│       ├── env.py
│       ├── run_all.sh
│       ├── test_blob_download.py
│       ├── test_file_download.py
│       ├── test_preprocess_file.py
│       ├── test_uri_utils.py
│       └── timeout.sh
├── DSC/
│   ├── HandlerManifest.json
│   ├── Makefile
│   ├── README.md
│   ├── azure/
│   │   ├── __init__.py
│   │   ├── azure.pyproj
│   │   ├── http/
│   │   │   ├── __init__.py
│   │   │   ├── batchclient.py
│   │   │   ├── httpclient.py
│   │   │   └── winhttp.py
│   │   ├── servicebus/
│   │   │   ├── __init__.py
│   │   │   └── servicebusservice.py
│   │   ├── servicemanagement/
│   │   │   ├── __init__.py
│   │   │   ├── servicebusmanagementservice.py
│   │   │   ├── servicemanagementclient.py
│   │   │   ├── servicemanagementservice.py
│   │   │   ├── sqldatabasemanagementservice.py
│   │   │   └── websitemanagementservice.py
│   │   └── storage/
│   │       ├── __init__.py
│   │       ├── blobservice.py
│   │       ├── cloudstorageaccount.py
│   │       ├── queueservice.py
│   │       ├── sharedaccesssignature.py
│   │       ├── storageclient.py
│   │       └── tableservice.py
│   ├── curlhttpclient.py
│   ├── dsc.py
│   ├── extension_shim.sh
│   ├── httpclient.py
│   ├── httpclientfactory.py
│   ├── manifest.xml
│   ├── packages/
│   │   ├── dsc-1.2.4-0.ssl_100.x64.deb
│   │   ├── dsc-1.2.4-0.ssl_100.x64.rpm
│   │   ├── dsc-1.2.4-0.ssl_110.x64.deb
│   │   ├── dsc-1.2.4-0.ssl_110.x64.rpm
│   │   ├── omi-1.7.3-0.ssl_100.ulinux.s.x64.deb
│   │   ├── omi-1.7.3-0.ssl_100.ulinux.s.x64.rpm
│   │   ├── omi-1.7.3-0.ssl_100.ulinux.x64.deb
│   │   ├── omi-1.7.3-0.ssl_100.ulinux.x64.rpm
│   │   ├── omi-1.7.3-0.ssl_110.ulinux.s.x64.deb
│   │   ├── omi-1.7.3-0.ssl_110.ulinux.s.x64.rpm
│   │   ├── omi-1.7.3-0.ssl_110.ulinux.x64.deb
│   │   └── omi-1.7.3-0.ssl_110.ulinux.x64.rpm
│   ├── serializerfactory.py
│   ├── subprocessfactory.py
│   ├── test/
│   │   ├── MockUtil.py
│   │   ├── env.py
│   │   ├── mof/
│   │   │   ├── azureautomation.df.meta.mof
│   │   │   ├── dscnode.nxFile.meta.mof
│   │   │   ├── dscnode.nxFile.meta.push.mof
│   │   │   └── localhost.nxFile.mof
│   │   ├── status/
│   │   │   └── 0.status
│   │   ├── test_apply_meta_mof.py
│   │   ├── test_apply_mof.py
│   │   ├── test_compare_pkg_version.py
│   │   ├── test_download_file.py
│   │   ├── test_node_extension_properties.py
│   │   ├── test_register.py
│   │   └── test_status_update.py
│   ├── urllib2httpclient.py
│   └── urllib3httpclient.py
├── Diagnostic/
│   ├── ChangeLogs
│   ├── DistroSpecific.py
│   ├── HandlerManifest.json
│   ├── Makefile
│   ├── Providers/
│   │   ├── Builtin.py
│   │   └── __init__.py
│   ├── README.md
│   ├── Utils/
│   │   ├── LadDiagnosticUtil.py
│   │   ├── ProviderUtil.py
│   │   ├── XmlUtil.py
│   │   ├── __init__.py
│   │   ├── imds_util.py
│   │   ├── lad_exceptions.py
│   │   ├── lad_ext_settings.py
│   │   ├── lad_logging_config.py
│   │   ├── mdsd_xml_templates.py
│   │   ├── misc_helpers.py
│   │   └── omsagent_util.py
│   ├── __init__.py
│   ├── decrypt_protected_settings.sh
│   ├── diagnostic.py
│   ├── lad_config_all.py
│   ├── lad_mdsd.te
│   ├── license.txt
│   ├── manifest.xml
│   ├── mdsd/
│   │   ├── CMakeLists.txt
│   │   ├── Dockerfile
│   │   ├── LICENSE.txt
│   │   ├── README.md
│   │   ├── SampleConfig-LAD-SAS.xml
│   │   ├── azure.list
│   │   ├── buildcmake.sh
│   │   ├── lad-mdsd/
│   │   │   ├── Makefile.in.version
│   │   │   ├── README.txt
│   │   │   ├── changelog
│   │   │   ├── copyright
│   │   │   ├── deb/
│   │   │   │   ├── Makefile
│   │   │   │   └── control
│   │   │   └── rpm/
│   │   │       └── Makefile
│   │   ├── mdscommands/
│   │   │   ├── BinaryWriter.hh
│   │   │   ├── BodyOnlyXmlParser.cc
│   │   │   ├── BodyOnlyXmlParser.hh
│   │   │   ├── CMakeLists.txt
│   │   │   ├── CmdListXmlParser.cc
│   │   │   ├── CmdListXmlParser.hh
│   │   │   ├── CmdXmlCommon.cc
│   │   │   ├── CmdXmlCommon.hh
│   │   │   ├── CmdXmlElement.cc
│   │   │   ├── CmdXmlElement.hh
│   │   │   ├── CmdXmlParser.cc
│   │   │   ├── CmdXmlParser.hh
│   │   │   ├── ConfigUpdateCmd.cc
│   │   │   ├── ConfigUpdateCmd.hh
│   │   │   ├── DirectoryIter.cc
│   │   │   ├── DirectoryIter.hh
│   │   │   ├── EventData.cc
│   │   │   ├── EventData.hh
│   │   │   ├── EventEntry.cc
│   │   │   ├── EventEntry.hh
│   │   │   ├── EventHubCmd.cc
│   │   │   ├── EventHubCmd.hh
│   │   │   ├── EventHubPublisher.cc
│   │   │   ├── EventHubPublisher.hh
│   │   │   ├── EventHubType.cc
│   │   │   ├── EventHubType.hh
│   │   │   ├── EventHubUploader.cc
│   │   │   ├── EventHubUploader.hh
│   │   │   ├── EventHubUploaderId.cc
│   │   │   ├── EventHubUploaderId.hh
│   │   │   ├── EventHubUploaderMgr.cc
│   │   │   ├── EventHubUploaderMgr.hh
│   │   │   ├── EventPersistMgr.cc
│   │   │   ├── EventPersistMgr.hh
│   │   │   ├── MdsBlobReader.cc
│   │   │   ├── MdsBlobReader.hh
│   │   │   ├── MdsCmdLogger.hh
│   │   │   ├── MdsException.cc
│   │   │   ├── MdsException.hh
│   │   │   ├── PersistFiles.cc
│   │   │   ├── PersistFiles.hh
│   │   │   ├── PublisherStatus.cc
│   │   │   ├── PublisherStatus.hh
│   │   │   └── commands.xsd
│   │   ├── mdsd/
│   │   │   ├── Batch.cc
│   │   │   ├── Batch.hh
│   │   │   ├── CMakeLists.txt
│   │   │   ├── CanonicalEntity.cc
│   │   │   ├── CanonicalEntity.hh
│   │   │   ├── CfgContext.cc
│   │   │   ├── CfgContext.hh
│   │   │   ├── CfgCtxAccounts.cc
│   │   │   ├── CfgCtxAccounts.hh
│   │   │   ├── CfgCtxDerived.cc
│   │   │   ├── CfgCtxDerived.hh
│   │   │   ├── CfgCtxEnvelope.cc
│   │   │   ├── CfgCtxEnvelope.hh
│   │   │   ├── CfgCtxError.cc
│   │   │   ├── CfgCtxError.hh
│   │   │   ├── CfgCtxEtw.cc
│   │   │   ├── CfgCtxEtw.hh
│   │   │   ├── CfgCtxEventAnnotations.cc
│   │   │   ├── CfgCtxEventAnnotations.hh
│   │   │   ├── CfgCtxEvents.cc
│   │   │   ├── CfgCtxEvents.hh
│   │   │   ├── CfgCtxExtensions.cc
│   │   │   ├── CfgCtxExtensions.hh
│   │   │   ├── CfgCtxHeartBeats.cc
│   │   │   ├── CfgCtxHeartBeats.hh
│   │   │   ├── CfgCtxImports.cc
│   │   │   ├── CfgCtxImports.hh
│   │   │   ├── CfgCtxManagement.cc
│   │   │   ├── CfgCtxManagement.hh
│   │   │   ├── CfgCtxMdsdEvents.cc
│   │   │   ├── CfgCtxMdsdEvents.hh
│   │   │   ├── CfgCtxMonMgmt.cc
│   │   │   ├── CfgCtxMonMgmt.hh
│   │   │   ├── CfgCtxOMI.cc
│   │   │   ├── CfgCtxOMI.hh
│   │   │   ├── CfgCtxParser.cc
│   │   │   ├── CfgCtxParser.hh
│   │   │   ├── CfgCtxRoot.cc
│   │   │   ├── CfgCtxRoot.hh
│   │   │   ├── CfgCtxSchemas.cc
│   │   │   ├── CfgCtxSchemas.hh
│   │   │   ├── CfgCtxSources.cc
│   │   │   ├── CfgCtxSources.hh
│   │   │   ├── CfgCtxSvcBusAccts.cc
│   │   │   ├── CfgCtxSvcBusAccts.hh
│   │   │   ├── CfgEventAnnotationType.hh
│   │   │   ├── CfgOboDirectConfig.hh
│   │   │   ├── CmdLineConverter.cc
│   │   │   ├── CmdLineConverter.hh
│   │   │   ├── ConfigParser.cc
│   │   │   ├── ConfigParser.hh
│   │   │   ├── Constants.cc
│   │   │   ├── Constants.hh
│   │   │   ├── Credentials.cc
│   │   │   ├── Credentials.hh
│   │   │   ├── DaemonConf.cc
│   │   │   ├── DaemonConf.hh
│   │   │   ├── DerivedEvent.cc
│   │   │   ├── DerivedEvent.hh
│   │   │   ├── Engine.cc
│   │   │   ├── Engine.hh
│   │   │   ├── EtwEvent.cc
│   │   │   ├── EtwEvent.hh
│   │   │   ├── EventJSON.cc
│   │   │   ├── EventJSON.hh
│   │   │   ├── ExtensionMgmt.cc
│   │   │   ├── ExtensionMgmt.hh
│   │   │   ├── FileSink.cc
│   │   │   ├── FileSink.hh
│   │   │   ├── IMdsSink.cc
│   │   │   ├── IMdsSink.hh
│   │   │   ├── ITask.cc
│   │   │   ├── ITask.hh
│   │   │   ├── IdentityColumns.hh
│   │   │   ├── LADQuery.cc
│   │   │   ├── LADQuery.hh
│   │   │   ├── LinuxMdsConfig.xsd
│   │   │   ├── Listener.cc
│   │   │   ├── Listener.hh
│   │   │   ├── LocalSink.cc
│   │   │   ├── LocalSink.hh
│   │   │   ├── MdsBlobOutputter.hh
│   │   │   ├── MdsEntityName.cc
│   │   │   ├── MdsEntityName.hh
│   │   │   ├── MdsSchemaMetadata.cc
│   │   │   ├── MdsSchemaMetadata.hh
│   │   │   ├── MdsValue.cc
│   │   │   ├── MdsValue.hh
│   │   │   ├── MdsdConfig.cc
│   │   │   ├── MdsdConfig.hh
│   │   │   ├── MdsdExtension.hh
│   │   │   ├── MdsdMetrics.cc
│   │   │   ├── MdsdMetrics.hh
│   │   │   ├── Memcheck.cc
│   │   │   ├── OMIQuery.cc
│   │   │   ├── OMIQuery.hh
│   │   │   ├── OmiTask.cc
│   │   │   ├── OmiTask.hh
│   │   │   ├── PipeStages.cc
│   │   │   ├── PipeStages.hh
│   │   │   ├── Pipeline.cc
│   │   │   ├── Pipeline.hh
│   │   │   ├── PoolMgmt.hh
│   │   │   ├── Priority.cc
│   │   │   ├── Priority.hh
│   │   │   ├── ProtocolHandlerBase.cc
│   │   │   ├── ProtocolHandlerBase.hh
│   │   │   ├── ProtocolHandlerBond.cc
│   │   │   ├── ProtocolHandlerBond.hh
│   │   │   ├── ProtocolHandlerJSON.cc
│   │   │   ├── ProtocolHandlerJSON.hh
│   │   │   ├── ProtocolListener.cc
│   │   │   ├── ProtocolListener.hh
│   │   │   ├── ProtocolListenerBond.cc
│   │   │   ├── ProtocolListenerBond.hh
│   │   │   ├── ProtocolListenerDynamicJSON.cc
│   │   │   ├── ProtocolListenerDynamicJSON.hh
│   │   │   ├── ProtocolListenerJSON.cc
│   │   │   ├── ProtocolListenerJSON.hh
│   │   │   ├── ProtocolListenerMgr.cc
│   │   │   ├── ProtocolListenerMgr.hh
│   │   │   ├── ProtocolListenerTcpJSON.cc
│   │   │   ├── ProtocolListenerTcpJSON.hh
│   │   │   ├── RowIndex.cc
│   │   │   ├── RowIndex.hh
│   │   │   ├── SaxParserBase.cc
│   │   │   ├── SaxParserBase.hh
│   │   │   ├── SchemaCache.cc
│   │   │   ├── SchemaCache.hh
│   │   │   ├── Signals.c
│   │   │   ├── StoreType.cc
│   │   │   ├── StoreType.hh
│   │   │   ├── StreamListener.cc
│   │   │   ├── StreamListener.hh
│   │   │   ├── Subscription.cc
│   │   │   ├── Subscription.hh
│   │   │   ├── TableColumn.cc
│   │   │   ├── TableColumn.hh
│   │   │   ├── TableSchema.cc
│   │   │   ├── TableSchema.hh
│   │   │   ├── TermHandler.cc
│   │   │   ├── Version.cc
│   │   │   ├── Version.hh
│   │   │   ├── XJsonBlobBlockCountsMgr.cc
│   │   │   ├── XJsonBlobBlockCountsMgr.hh
│   │   │   ├── XJsonBlobRequest.cc
│   │   │   ├── XJsonBlobRequest.hh
│   │   │   ├── XJsonBlobSink.cc
│   │   │   ├── XJsonBlobSink.hh
│   │   │   ├── XTableConst.cc
│   │   │   ├── XTableConst.hh
│   │   │   ├── XTableHelper.cc
│   │   │   ├── XTableHelper.hh
│   │   │   ├── XTableRequest.cc
│   │   │   ├── XTableRequest.hh
│   │   │   ├── XTableSink.cc
│   │   │   ├── XTableSink.hh
│   │   │   ├── cJSON.c
│   │   │   ├── cJSON.h
│   │   │   ├── cryptutil.cc
│   │   │   ├── cryptutil.hh
│   │   │   ├── fdelt_chk.c
│   │   │   ├── mdsautokey.h
│   │   │   ├── mdsd.cc
│   │   │   └── wrap_memcpy.c
│   │   ├── mdsd.8
│   │   ├── mdsdcfg/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── EventPubCfg.cc
│   │   │   ├── EventPubCfg.hh
│   │   │   ├── EventSinkCfgInfo.hh
│   │   │   ├── EventType.hh
│   │   │   ├── MdsdEventCfg.cc
│   │   │   └── MdsdEventCfg.hh
│   │   ├── mdsdinput/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── MdsdInputMessageBuilder.cpp
│   │   │   ├── MdsdInputMessageBuilder.h
│   │   │   ├── MdsdInputMessageDecoder.h
│   │   │   ├── MdsdInputMessageIO.cpp
│   │   │   ├── MdsdInputMessageIO.h
│   │   │   ├── MdsdInputSchemaCache.cpp
│   │   │   ├── MdsdInputSchemaCache.h
│   │   │   ├── mdsd_input.bond
│   │   │   ├── mdsd_input_apply.cpp
│   │   │   ├── mdsd_input_apply.h
│   │   │   ├── mdsd_input_reflection.h
│   │   │   ├── mdsd_input_types.cpp
│   │   │   └── mdsd_input_types.h
│   │   ├── mdsdlog/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── Logger.cc
│   │   │   ├── Logger.hh
│   │   │   ├── Trace.cc
│   │   │   └── Trace.hh
│   │   ├── mdsdutil/
│   │   │   ├── AzureUtility.cc
│   │   │   ├── AzureUtility.hh
│   │   │   ├── CMakeLists.txt
│   │   │   ├── Crypto.cc
│   │   │   ├── Crypto.hh
│   │   │   ├── HttpProxySetup.cc
│   │   │   ├── HttpProxySetup.hh
│   │   │   ├── MdsTime.cc
│   │   │   ├── MdsTime.hh
│   │   │   ├── OpensslCert.cc
│   │   │   ├── OpensslCert.hh
│   │   │   ├── OpensslCertStore.cc
│   │   │   ├── OpensslCertStore.hh
│   │   │   ├── Utility.cc
│   │   │   └── Utility.hh
│   │   ├── mdsrest/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── GcsJsonData.cc
│   │   │   ├── GcsJsonData.hh
│   │   │   ├── GcsJsonParser.cc
│   │   │   ├── GcsJsonParser.hh
│   │   │   ├── GcsServiceInfo.cc
│   │   │   ├── GcsServiceInfo.hh
│   │   │   ├── GcsUtil.cc
│   │   │   ├── GcsUtil.hh
│   │   │   ├── MdsConst.hh
│   │   │   ├── MdsRest.cc
│   │   │   ├── MdsRest.hh
│   │   │   └── MdsRestException.hh
│   │   └── parseglibc.py
│   ├── mocks/
│   │   ├── Readme.txt
│   │   ├── __init__.py
│   │   ├── crypt.py
│   │   ├── fcntl.py
│   │   └── pwd.py
│   ├── run_unittests.sh
│   ├── services/
│   │   ├── mdsd-lde.service
│   │   ├── metrics-extension.service
│   │   └── metrics-sourcer.service
│   ├── shim.sh
│   ├── tests/
│   │   ├── .gitignore
│   │   ├── __init__.py
│   │   ├── lad_2_3_compatible_portal_pub_settings.json
│   │   ├── test_LadDiagnosticUtil.py
│   │   ├── test_builtin.py
│   │   ├── test_commonActions.py
│   │   ├── test_lad_config_all.py
│   │   ├── test_lad_ext_settings.py
│   │   ├── test_lad_logging_config.py
│   │   ├── var_lib_waagent/
│   │   │   └── lad_dir/
│   │   │       └── config/
│   │   │           ├── lad_settings_logging.json
│   │   │           └── lad_settings_metric.json
│   │   └── watchertests.py
│   ├── virtual-machines-linux-diagnostic-extension-v3.md
│   └── watcherutil.py
├── LAD-AMA-Common/
│   ├── metrics_ext_utils/
│   │   ├── __init__.py
│   │   ├── metrics_common_utils.py
│   │   ├── metrics_constants.py
│   │   └── metrics_ext_handler.py
│   └── telegraf_utils/
│       ├── __init__.py
│       ├── telegraf_config_handler.py
│       └── telegraf_name_map.py
├── LICENSE.txt
├── Makefile
├── OSPatching/
│   ├── HandlerManifest.json
│   ├── README.md
│   ├── azure/
│   │   ├── __init__.py
│   │   ├── azure.pyproj
│   │   ├── http/
│   │   │   ├── __init__.py
│   │   │   ├── batchclient.py
│   │   │   ├── httpclient.py
│   │   │   └── winhttp.py
│   │   ├── servicebus/
│   │   │   ├── __init__.py
│   │   │   └── servicebusservice.py
│   │   ├── servicemanagement/
│   │   │   ├── __init__.py
│   │   │   ├── servicebusmanagementservice.py
│   │   │   ├── servicemanagementclient.py
│   │   │   ├── servicemanagementservice.py
│   │   │   ├── sqldatabasemanagementservice.py
│   │   │   └── websitemanagementservice.py
│   │   └── storage/
│   │       ├── __init__.py
│   │       ├── blobservice.py
│   │       ├── cloudstorageaccount.py
│   │       ├── queueservice.py
│   │       ├── sharedaccesssignature.py
│   │       ├── storageclient.py
│   │       └── tableservice.py
│   ├── check.py
│   ├── handler.py
│   ├── manifest.xml
│   ├── oneoff/
│   │   └── __init__.py
│   ├── patch/
│   │   ├── AbstractPatching.py
│   │   ├── ConfigOptions.py
│   │   ├── OraclePatching.py
│   │   ├── SuSEPatching.py
│   │   ├── UbuntuPatching.py
│   │   ├── __init__.py
│   │   ├── centosPatching.py
│   │   └── redhatPatching.py
│   ├── references
│   ├── scheduled/
│   │   ├── __init__.py
│   │   └── history
│   └── test/
│       ├── FakePatching.py
│       ├── FakePatching2.py
│       ├── FakePatching3.py
│       ├── HandlerEnvironment.json
│       ├── README.txt
│       ├── check.py
│       ├── config/
│       │   └── 0.settings
│       ├── default.settings
│       ├── handler.py
│       ├── oneoff/
│       │   └── __init__.py
│       ├── prepare_settings.py
│       ├── scheduled/
│       │   ├── __init__.py
│       │   └── history
│       ├── test.crt
│       ├── test.prv
│       ├── test_handler_1.py
│       ├── test_handler_2.py
│       └── test_handler_3.py
├── OmsAgent/
│   ├── .gitignore
│   ├── HandlerManifest.json
│   ├── ImportGPGkey.sh
│   ├── README.md
│   ├── apply_version.sh
│   ├── extension-test/
│   │   ├── README.md
│   │   ├── oms_extension_tests.py
│   │   ├── omsfiles/
│   │   │   ├── apache_access.log
│   │   │   ├── custom.log
│   │   │   ├── customlog.conf
│   │   │   ├── error.log
│   │   │   ├── mysql-slow.log
│   │   │   ├── mysql.log
│   │   │   ├── oms_extension_run_script.py
│   │   │   ├── perf.conf
│   │   │   └── rsyslog-oms.conf
│   │   ├── parameters.json
│   │   └── verify_e2e.py
│   ├── keys/
│   │   ├── dscgpgkey.asc
│   │   └── msgpgkey.asc
│   ├── manifest.xml
│   ├── omsagent.py
│   ├── omsagent.version
│   ├── omsagent_shim.sh
│   ├── packaging.sh
│   ├── references
│   ├── test/
│   │   ├── MockUtil.py
│   │   ├── env.py
│   │   └── test_install.py
│   ├── update_version.sh
│   └── watcherutil.py
├── RDMAUpdate/
│   ├── MANIFEST.in
│   ├── RDMAUpdate.pyproj
│   ├── README.txt
│   ├── enableit.js
│   ├── main/
│   │   ├── CommandExecuter.py
│   │   ├── Common.py
│   │   ├── CronUtil.py
│   │   ├── RDMALogger.py
│   │   ├── RdmaException.py
│   │   ├── SecondStageMarkConfig.py
│   │   ├── Utils/
│   │   │   ├── HandlerUtil.py
│   │   │   ├── WAAgentUtil.py
│   │   │   └── __init__.py
│   │   ├── __init__.py
│   │   ├── handle.py
│   │   └── patch/
│   │       ├── AbstractPatching.py
│   │       ├── OraclePatching.py
│   │       ├── SuSEPatching.py
│   │       ├── UbuntuPatching.py
│   │       ├── __init__.py
│   │       ├── centosPatching.py
│   │       └── redhatPatching.py
│   ├── references
│   ├── setup.py
│   ├── test/
│   │   └── update_rdma_driver.py
│   └── test.ps1
├── README.md
├── SECURITY.md
├── SampleExtension/
│   ├── HandlerManifest.json
│   ├── disable.py
│   ├── enable.py
│   ├── install.py
│   ├── references
│   ├── uninstall.py
│   └── update.py
├── TestHandlerLinux/
│   ├── HandlerManifest.json
│   ├── bin/
│   │   ├── #heartbeat.py#
│   │   ├── disable.py
│   │   ├── enable.py
│   │   ├── heartbeat.py
│   │   ├── service.py
│   │   └── update.py
│   ├── installer/
│   │   ├── install.py
│   │   └── uninstall.py
│   ├── manifest.xml
│   ├── references
│   └── resources/
│       ├── HandlerUtil.py
│       └── mypydoc.py
├── Utils/
│   ├── HandlerUtil.py
│   ├── LogUtil.py
│   ├── ScriptUtil.py
│   ├── WAAgentUtil.py
│   ├── __init__.py
│   ├── constants.py
│   ├── crypt_fallback.py
│   ├── distroutils.py
│   ├── extensionutils.py
│   ├── handlerutil2.py
│   ├── logger.py
│   ├── ovfutils.py
│   └── test/
│       ├── MockUtil.py
│       ├── env.py
│       ├── mock.sh
│       ├── mock_sshd_config
│       ├── non_latin_characters.txt
│       ├── ovf-env-empty.xml
│       ├── ovf-env.xml
│       ├── place_vmaccess_on_local_machine.sh
│       ├── test_encode.py
│       ├── test_extensionutils_code_injection.py
│       ├── test_logutil.py
│       ├── test_null_protected_settings.py
│       ├── test_ovf_utils.py
│       ├── test_redacted_settings.py
│       └── test_scriptutil.py
├── VMAccess/
│   ├── CHANGELOG.md
│   ├── HandlerManifest.json
│   ├── README.md
│   ├── extension_noop.sh
│   ├── extension_shim.sh
│   ├── manifest.xml
│   ├── references
│   ├── resources/
│   │   ├── SuSE_default
│   │   ├── Ubuntu_default
│   │   ├── centos_default
│   │   ├── debian_default
│   │   ├── default
│   │   ├── fedora_default
│   │   └── redhat_default
│   ├── test/
│   │   ├── env.py
│   │   ├── test_iptable_rules.py
│   │   ├── test_reset_account.py
│   │   └── test_reset_sshd_config.py
│   └── vmaccess.py
├── VMBackup/
│   ├── .gitignore
│   ├── HandlerManifest.json
│   ├── MANIFEST.in
│   ├── README.txt
│   ├── VMBackup.pyproj
│   ├── debughelper/
│   │   ├── README.md
│   │   ├── checkMounts.go
│   │   ├── go.mod
│   │   ├── go.sum
│   │   ├── main.go
│   │   └── run.go
│   ├── main/
│   │   ├── ExtensionErrorCodeHelper.py
│   │   ├── HttpUtil.py
│   │   ├── IaaSExtensionSnapshotService/
│   │   │   ├── README.md
│   │   │   ├── SnapshotServiceConstants.py
│   │   │   ├── SnapshotServiceContracts.py
│   │   │   ├── __init__.py
│   │   │   └── service_metadata.json
│   │   ├── LogSeverity.json
│   │   ├── MachineIdentity.py
│   │   ├── PluginHost.py
│   │   ├── ScriptRunner.py
│   │   ├── Utils/
│   │   │   ├── DiskUtil.py
│   │   │   ├── Event.py
│   │   │   ├── EventLoggerUtil.py
│   │   │   ├── HandlerUtil.py
│   │   │   ├── HostSnapshotObjects.py
│   │   │   ├── LogHelper.py
│   │   │   ├── ResourceDiskUtil.py
│   │   │   ├── SizeCalculation.py
│   │   │   ├── Status.py
│   │   │   ├── StringHelper.py
│   │   │   ├── WAAgentUtil.py
│   │   │   ├── __init__.py
│   │   │   └── dhcpUtils.py
│   │   ├── VMSnapshotPluginHost.conf
│   │   ├── WaagentLib.py
│   │   ├── __init__.py
│   │   ├── backuplogger.py
│   │   ├── blobwriter.py
│   │   ├── common.py
│   │   ├── dhcpHandler.py
│   │   ├── freezesnapshotter.py
│   │   ├── fsfreezer.py
│   │   ├── guestsnapshotter.py
│   │   ├── handle.py
│   │   ├── handle.sh
│   │   ├── handle_host_daemon.py
│   │   ├── handle_host_daemon.sh
│   │   ├── hostsnapshotter.py
│   │   ├── mounts.py
│   │   ├── parameterparser.py
│   │   ├── patch/
│   │   │   ├── AbstractPatching.py
│   │   │   ├── DefaultPatching.py
│   │   │   ├── FreeBSDPatching.py
│   │   │   ├── KaliPatching.py
│   │   │   ├── NSBSDPatching.py
│   │   │   ├── SuSEPatching.py
│   │   │   ├── UbuntuPatching.py
│   │   │   ├── __init__.py
│   │   │   ├── centosPatching.py
│   │   │   ├── debianPatching.py
│   │   │   ├── oraclePatching.py
│   │   │   └── redhatPatching.py
│   │   ├── safefreeze/
│   │   │   ├── Makefile
│   │   │   └── src/
│   │   │       └── safefreeze.c
│   │   ├── safefreezeArm64/
│   │   │   ├── Makefile
│   │   │   ├── bin/
│   │   │   │   └── safefreeze
│   │   │   └── src/
│   │   │       └── safefreeze.c
│   │   ├── taskidentity.py
│   │   ├── tempPlugin/
│   │   │   ├── VMSnapshotScriptPluginConfig.json
│   │   │   ├── postScript.sh
│   │   │   ├── preScript.sh
│   │   │   └── vmbackup.conf
│   │   └── workloadPatch/
│   │       ├── CustomScripts/
│   │       │   └── customscript.sql
│   │       ├── DefaultScripts/
│   │       │   ├── logbackup.sql
│   │       │   ├── postMysqlMaster.sql
│   │       │   ├── postMysqlSlave.sql
│   │       │   ├── postOracleMaster.sql
│   │       │   ├── postPostgresMaster.sql
│   │       │   ├── preMysqlMaster.sql
│   │       │   ├── preMysqlSlave.sql
│   │       │   ├── preOracleMaster.sql
│   │       │   ├── prePostgresMaster.sql
│   │       │   └── timeoutDaemon.sh
│   │       ├── LogBackupPatch.py
│   │       ├── WorkloadPatch.py
│   │       ├── WorkloadUtils/
│   │       │   ├── OracleLogBackup.py
│   │       │   ├── OracleLogRestore.py
│   │       │   └── workload.conf
│   │       └── __init__.py
│   ├── manifest.xml
│   ├── mkstub.py
│   ├── references
│   ├── setup.py
│   └── test/
│       ├── handle.py
│       └── install_python2.6.sh
├── VMEncryption/
│   ├── .vscode/
│   │   └── settings.json
│   ├── MANIFEST.in
│   ├── ReleaseNotes.txt
│   ├── Test-AzureRmVMDiskEncryptionExtension.ps1
│   ├── Test-AzureRmVMDiskEncryptionExtensionDiskFormat.ps1
│   ├── UpgradeLog.htm
│   ├── VMEncryption.pyproj
│   ├── extension_shim.sh
│   ├── lint_output.txt
│   ├── main/
│   │   ├── BackupLogger.py
│   │   ├── BekUtil.py
│   │   ├── CommandExecutor.py
│   │   ├── Common.py
│   │   ├── ConfigUtil.py
│   │   ├── DecryptionMarkConfig.py
│   │   ├── DiskUtil.py
│   │   ├── EncryptionConfig.py
│   │   ├── EncryptionEnvironment.py
│   │   ├── EncryptionMarkConfig.py
│   │   ├── ExtensionParameter.py
│   │   ├── HttpUtil.py
│   │   ├── KeyVaultUtil.py
│   │   ├── MachineIdentity.py
│   │   ├── OnGoingItemConfig.py
│   │   ├── ProcessLock.py
│   │   ├── ResourceDiskUtil.py
│   │   ├── SupportedOS.json
│   │   ├── TokenUtil.py
│   │   ├── TransactionalCopyTask.py
│   │   ├── Utils/
│   │   │   ├── HandlerUtil.py
│   │   │   ├── WAAgentUtil.py
│   │   │   └── __init__.py
│   │   ├── __init__.py
│   │   ├── check_util.py
│   │   ├── handle.py
│   │   ├── oscrypto/
│   │   │   ├── 91ade/
│   │   │   │   ├── 50-udev-ade.rules
│   │   │   │   ├── cryptroot-ask-ade.sh
│   │   │   │   ├── module-setup.sh
│   │   │   │   └── parse-crypt-ade.sh
│   │   │   ├── OSEncryptionState.py
│   │   │   ├── OSEncryptionStateMachine.py
│   │   │   ├── __init__.py
│   │   │   ├── centos_68/
│   │   │   │   ├── CentOS68EncryptionStateMachine.py
│   │   │   │   ├── __init__.py
│   │   │   │   ├── encryptpatches/
│   │   │   │   │   └── centos_68_dracut.patch
│   │   │   │   └── encryptstates/
│   │   │   │       ├── EncryptBlockDeviceState.py
│   │   │   │       ├── PatchBootSystemState.py
│   │   │   │       ├── PrereqState.py
│   │   │   │       ├── SelinuxState.py
│   │   │   │       ├── SplitRootPartitionState.py
│   │   │   │       ├── StripdownState.py
│   │   │   │       ├── UnmountOldrootState.py
│   │   │   │       └── __init__.py
│   │   │   ├── rhel_68/
│   │   │   │   ├── RHEL68EncryptionStateMachine.py
│   │   │   │   ├── __init__.py
│   │   │   │   ├── encryptpatches/
│   │   │   │   │   └── rhel_68_dracut.patch
│   │   │   │   └── encryptstates/
│   │   │   │       ├── EncryptBlockDeviceState.py
│   │   │   │       ├── PatchBootSystemState.py
│   │   │   │       ├── PrereqState.py
│   │   │   │       ├── SelinuxState.py
│   │   │   │       ├── StripdownState.py
│   │   │   │       ├── UnmountOldrootState.py
│   │   │   │       └── __init__.py
│   │   │   ├── rhel_72/
│   │   │   │   ├── RHEL72EncryptionStateMachine.py
│   │   │   │   ├── __init__.py
│   │   │   │   └── encryptstates/
│   │   │   │       ├── EncryptBlockDeviceState.py
│   │   │   │       ├── PatchBootSystemState.py
│   │   │   │       ├── PrereqState.py
│   │   │   │       ├── SelinuxState.py
│   │   │   │       ├── StripdownState.py
│   │   │   │       ├── UnmountOldrootState.py
│   │   │   │       └── __init__.py
│   │   │   ├── rhel_72_lvm/
│   │   │   │   ├── RHEL72LVMEncryptionStateMachine.py
│   │   │   │   ├── __init__.py
│   │   │   │   └── encryptstates/
│   │   │   │       ├── EncryptBlockDeviceState.py
│   │   │   │       ├── PatchBootSystemState.py
│   │   │   │       ├── PrereqState.py
│   │   │   │       ├── SelinuxState.py
│   │   │   │       ├── StripdownState.py
│   │   │   │       ├── UnmountOldrootState.py
│   │   │   │       └── __init__.py
│   │   │   ├── ubuntu_1404/
│   │   │   │   ├── Ubuntu1404EncryptionStateMachine.py
│   │   │   │   ├── __init__.py
│   │   │   │   ├── encryptpatches/
│   │   │   │   │   └── ubuntu_1404_initramfs.patch
│   │   │   │   ├── encryptscripts/
│   │   │   │   │   ├── azure_crypt_key.sh
│   │   │   │   │   └── inject_luks_header.sh
│   │   │   │   └── encryptstates/
│   │   │   │       ├── EncryptBlockDeviceState.py
│   │   │   │       ├── PatchBootSystemState.py
│   │   │   │       ├── PrereqState.py
│   │   │   │       ├── SelinuxState.py
│   │   │   │       ├── SplitRootPartitionState.py
│   │   │   │       ├── StripdownState.py
│   │   │   │       ├── UnmountOldrootState.py
│   │   │   │       └── __init__.py
│   │   │   └── ubuntu_1604/
│   │   │       ├── Ubuntu1604EncryptionStateMachine.py
│   │   │       ├── __init__.py
│   │   │       ├── encryptpatches/
│   │   │       │   └── ubuntu_1604_initramfs.patch
│   │   │       ├── encryptscripts/
│   │   │       │   ├── azure_crypt_key.sh
│   │   │       │   └── inject_luks_header.sh
│   │   │       └── encryptstates/
│   │   │           ├── EncryptBlockDeviceState.py
│   │   │           ├── PatchBootSystemState.py
│   │   │           ├── PrereqState.py
│   │   │           ├── SelinuxState.py
│   │   │           ├── SplitRootPartitionState.py
│   │   │           ├── StripdownState.py
│   │   │           ├── UnmountOldrootState.py
│   │   │           └── __init__.py
│   │   └── patch/
│   │       ├── AbstractPatching.py
│   │       ├── SuSEPatching.py
│   │       ├── UbuntuPatching.py
│   │       ├── __init__.py
│   │       ├── centosPatching.py
│   │       ├── debianPatching.py
│   │       ├── oraclePatching.py
│   │       └── redhatPatching.py
│   ├── references
│   ├── requirements.txt
│   ├── setup.py
│   └── test/
│       ├── __init__.py
│       ├── console_logger.py
│       ├── test_check_util.py
│       ├── test_command_executor.py
│       ├── test_disk_util.py
│       ├── test_handler_util.py
│       ├── test_resource_disk_util.py
│       └── test_utils.py
├── docs/
│   ├── advanced-topics.md
│   ├── contribution-guide.md
│   ├── design-details.md
│   ├── document.md
│   ├── handler-registration.md
│   ├── overview.md
│   ├── sample-extension.md
│   ├── test.md
│   └── utils.md
├── go.mod
├── go.sum
├── registration-scripts/
│   ├── api/
│   │   ├── add-extension.sh
│   │   ├── check-request-status.sh
│   │   ├── del-extension.sh
│   │   ├── get-extension.sh
│   │   ├── get-subscription.sh
│   │   ├── list-extension.sh
│   │   ├── params
│   │   └── update-extension.sh
│   ├── bin/
│   │   ├── add.sh
│   │   ├── blob/
│   │   │   ├── list.sh
│   │   │   └── upload.sh
│   │   ├── check.sh
│   │   ├── del.sh
│   │   ├── get.sh
│   │   ├── list.sh
│   │   ├── subscription.sh
│   │   └── update.sh
│   ├── create_zip.sh
│   ├── mooncake/
│   │   └── sample-extension-1.0.xml
│   └── public/
│       └── sample-extension-1.0.xml
├── script/
│   ├── 0.settings
│   ├── HandlerEnvironment.json
│   ├── create_zip.sh
│   ├── mkstub.sh
│   ├── ovf-env.xml
│   ├── set_env.sh
│   ├── test.crt
│   └── test.prv
└── ui-extension-packages/
    ├── microsoft.custom-script-linux/
    │   ├── Artifacts/
    │   │   ├── CreateUiDefinition.json
    │   │   └── MainTemplate.json
    │   ├── Manifest.json
    │   ├── Strings/
    │   │   └── resources.resjson
    │   └── UiDefinition.json
    └── microsoft.custom-script-linux-arm/
        ├── Artifacts/
        │   ├── CreateUiDefinition.json
        │   └── MainTemplate.json
        ├── Manifest.json
        ├── Strings/
        │   └── resources.resjson
        └── UiDefinition.json
Download .txt
Showing preview only (702K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (8724 symbols across 595 files)

FILE: AzureEnhancedMonitor/clib/include/azureperf.h
  type perf_counter (line 53) | typedef struct
  type ap_handler (line 73) | typedef struct

FILE: AzureEnhancedMonitor/clib/src/apmetric.c
  function ap_metric_config_cloud_provider (line 24) | int ap_metric_config_cloud_provider(ap_handler *handler, perf_counter *p...
  function ap_metric_config_cpu_over_provisioning (line 33) | int ap_metric_config_cpu_over_provisioning(ap_handler *handler, perf_cou...
  function ap_metric_config_memory_over_provisioning (line 42) | int ap_metric_config_memory_over_provisioning(ap_handler *handler, perf_...
  function ap_metric_config_data_provider_version (line 51) | int ap_metric_config_data_provider_version(ap_handler *handler, perf_cou...
  function ap_metric_config_data_sources (line 60) | int ap_metric_config_data_sources(ap_handler *handler, perf_counter *pc,...
  function ap_metric_config_instance_type (line 69) | int ap_metric_config_instance_type(ap_handler *handler, perf_counter *pc...
  function ap_metric_config_virtualization_solution (line 78) | int ap_metric_config_virtualization_solution(ap_handler *handler, perf_c...
  function ap_metric_config_virtualization_solution_version (line 87) | int ap_metric_config_virtualization_solution_version(ap_handler *handler...
  function ap_metric_cpu_current_hw_frequency (line 96) | int ap_metric_cpu_current_hw_frequency(ap_handler *handler, perf_counter...
  function ap_metric_cpu_max_hw_frequency (line 105) | int ap_metric_cpu_max_hw_frequency(ap_handler *handler, perf_counter *pc...
  function ap_metric_cpu_current_vm_processing_power (line 114) | int ap_metric_cpu_current_vm_processing_power(ap_handler *handler, perf_...
  function ap_metric_cpu_guaranteed_vm_processing_power (line 123) | int ap_metric_cpu_guaranteed_vm_processing_power(ap_handler *handler, pe...
  function ap_metric_cpu_max_vm_processing_power (line 132) | int ap_metric_cpu_max_vm_processing_power(ap_handler *handler, perf_coun...
  function ap_metric_cpu_number_of_cores_per_cpu (line 141) | int ap_metric_cpu_number_of_cores_per_cpu(ap_handler *handler, perf_coun...
  function ap_metric_cpu_number_of_threads_per_core (line 150) | int ap_metric_cpu_number_of_threads_per_core(ap_handler *handler, perf_c...
  function ap_metric_cpu_phys_processing_power_per_vcpu (line 159) | int ap_metric_cpu_phys_processing_power_per_vcpu(ap_handler *handler, pe...
  function ap_metric_cpu_processor_type (line 168) | int ap_metric_cpu_processor_type(ap_handler *handler, perf_counter *pc, ...
  function ap_metric_cpu_reference_compute_unit (line 177) | int ap_metric_cpu_reference_compute_unit(ap_handler *handler, perf_count...
  function ap_metric_cpu_vcpu_mapping (line 186) | int ap_metric_cpu_vcpu_mapping(ap_handler *handler, perf_counter *pc, si...
  function ap_metric_cpu_vm_processing_power_consumption (line 195) | int ap_metric_cpu_vm_processing_power_consumption(ap_handler *handler, p...
  function ap_metric_memory_current_memory_assigned (line 204) | int ap_metric_memory_current_memory_assigned(ap_handler *handler, perf_c...
  function ap_metric_memory_guaranteed_memory_assigned (line 213) | int ap_metric_memory_guaranteed_memory_assigned(ap_handler *handler, per...
  function ap_metric_memory_max_memory_assigned (line 222) | int ap_metric_memory_max_memory_assigned(ap_handler *handler, perf_count...
  function ap_metric_memory_vm_memory_consumption (line 231) | int ap_metric_memory_vm_memory_consumption(ap_handler *handler, perf_cou...
  function ap_metric_network_adapter_id (line 240) | int ap_metric_network_adapter_id(ap_handler *handler, perf_counter *pc, ...
  function ap_metric_network_mapping (line 249) | int ap_metric_network_mapping(ap_handler *handler, perf_counter *pc, siz...
  function ap_metric_network_min_network_bandwidth (line 258) | int ap_metric_network_min_network_bandwidth(ap_handler *handler, perf_co...
  function ap_metric_network_max_network_bandwidth (line 267) | int ap_metric_network_max_network_bandwidth(ap_handler *handler, perf_co...
  function ap_metric_network_network_read_bytes (line 276) | int ap_metric_network_network_read_bytes(ap_handler *handler, perf_count...
  function ap_metric_network_network_write_bytes (line 285) | int ap_metric_network_network_write_bytes(ap_handler *handler, perf_coun...
  function ap_metric_network_packets_retransmitted (line 294) | int ap_metric_network_packets_retransmitted(ap_handler *handler, perf_co...
  function ap_metric_config_last_hardware_change (line 303) | int ap_metric_config_last_hardware_change(ap_handler *handler, perf_coun...
  function ap_metric_storage_phys_disc_to_storage_mapping (line 312) | int ap_metric_storage_phys_disc_to_storage_mapping(ap_handler *handler, ...
  function ap_metric_storage_storage_id (line 321) | int ap_metric_storage_storage_id(ap_handler *handler, perf_counter *pc, ...
  function ap_metric_storage_read_bytes (line 330) | int ap_metric_storage_read_bytes(ap_handler *handler, perf_counter *pc, ...
  function ap_metric_storage_read_ops (line 339) | int ap_metric_storage_read_ops(ap_handler *handler, perf_counter *pc, si...
  function ap_metric_storage_read_op_latency_e2e (line 348) | int ap_metric_storage_read_op_latency_e2e(ap_handler *handler, perf_coun...
  function ap_metric_storage_read_op_latency_server (line 357) | int ap_metric_storage_read_op_latency_server(ap_handler *handler, perf_c...
  function ap_metric_storage_read_throughput_e2e (line 366) | int ap_metric_storage_read_throughput_e2e(ap_handler *handler, perf_coun...
  function ap_metric_storage_write_bytes (line 375) | int ap_metric_storage_write_bytes(ap_handler *handler, perf_counter *pc,...
  function ap_metric_storage_write_ops (line 384) | int ap_metric_storage_write_ops(ap_handler *handler, perf_counter *pc, s...
  function ap_metric_storage_write_op_latency_e2e (line 393) | int ap_metric_storage_write_op_latency_e2e(ap_handler *handler, perf_cou...
  function ap_metric_storage_write_op_latency_server (line 402) | int ap_metric_storage_write_op_latency_server(ap_handler *handler, perf_...
  function ap_metric_storage_write_throughput_e2e (line 411) | int ap_metric_storage_write_throughput_e2e(ap_handler *handler, perf_cou...

FILE: AzureEnhancedMonitor/clib/src/azureperf.c
  function ap_handler (line 35) | ap_handler* ap_open()
  function ap_close (line 43) | void ap_close(ap_handler *handler)
  function read_sperator (line 48) | int read_sperator(FILE *fp, int strict)
  function read_int (line 71) | int read_int(FILE *fp, int *val)
  function read_int64 (line 89) | int read_int64(FILE *fp, long long *val)
  function read_double (line 107) | int read_double(FILE *fp, double *val)
  function read_str (line 125) | int read_str(FILE *fp, char* str, int max_size)
  function set_handler_err (line 161) | void set_handler_err(ap_handler *handler, int err)
  function read_pc_from_file (line 166) | int read_pc_from_file(ap_handler* handler, FILE *fp)
  function ap_refresh (line 287) | void ap_refresh(ap_handler *handler)
  function ap_metric_all (line 318) | int ap_metric_all(ap_handler *handler, perf_counter *all, size_t size)
  function get_metric (line 333) | int get_metric(ap_handler *handler, perf_counter *pc,

FILE: AzureEnhancedMonitor/clib/test/runtest.c
  function main (line 23) | int main(int argc, char ** argv)
  function print_counter (line 34) | void print_counter(perf_counter *pc)
  function run_test (line 57) | int run_test(char* ap_file)

FILE: AzureEnhancedMonitor/ext/aem.py
  function timedelta_total_seconds (line 34) | def timedelta_total_seconds(delta):
  function get_host_base_from_uri (line 41) | def get_host_base_from_uri(blob_uri):
  function clearLastErrorRecord (line 60) | def clearLastErrorRecord():
  function getLatestErrorRecord (line 65) | def getLatestErrorRecord():
  function updateLatestErrorRecord (line 73) | def updateLatestErrorRecord(s):
  function easyHash (line 89) | def easyHash(s):
  function getMDSTimestamp (line 104) | def getMDSTimestamp(unixTimestamp):
  function getIdentity (line 109) | def getIdentity():
  function getMDSPartitionKey (line 113) | def getMDSPartitionKey(identity, timestamp):
  function getAzureDiagnosticKeyRange (line 117) | def getAzureDiagnosticKeyRange():
  function getAzureDiagnosticCPUData (line 128) | def getAzureDiagnosticCPUData(accountName, accountKey, hostBase,
  function getAzureDiagnosticMemoryData (line 152) | def getAzureDiagnosticMemoryData(accountName, accountKey, hostBase,
  class AzureDiagnosticData (line 175) | class AzureDiagnosticData(object):
    method __init__ (line 176) | def __init__(self, config):
    method getCPUPercent (line 197) | def getCPUPercent(self):
    method getMemoryPercent (line 200) | def getMemoryPercent(self):
  class AzureDiagnosticMetric (line 203) | class AzureDiagnosticMetric(object):
    method __init__ (line 204) | def __init__(self, config):
    method getTimestamp (line 210) | def getTimestamp(self):
    method getCurrHwFrequency (line 213) | def getCurrHwFrequency(self):
    method getMaxHwFrequency (line 216) | def getMaxHwFrequency(self):
    method getCurrVMProcessingPower (line 219) | def getCurrVMProcessingPower(self):
    method getGuaranteedVMProcessingPower (line 222) | def getGuaranteedVMProcessingPower(self):
    method getMaxVMProcessingPower (line 225) | def getMaxVMProcessingPower(self):
    method getNumOfCoresPerCPU (line 228) | def getNumOfCoresPerCPU(self):
    method getNumOfThreadsPerCore (line 231) | def getNumOfThreadsPerCore(self):
    method getPhysProcessingPowerPerVCPU (line 234) | def getPhysProcessingPowerPerVCPU(self):
    method getProcessorType (line 237) | def getProcessorType(self):
    method getReferenceComputeUnit (line 240) | def getReferenceComputeUnit(self):
    method getVCPUMapping (line 243) | def getVCPUMapping(self):
    method getVMProcessingPowerConsumption (line 246) | def getVMProcessingPowerConsumption(self):
    method getCurrMemAssigned (line 249) | def getCurrMemAssigned(self):
    method getGuaranteedMemAssigned (line 252) | def getGuaranteedMemAssigned(self):
    method getMaxMemAssigned (line 255) | def getMaxMemAssigned(self):
    method getVMMemConsumption (line 258) | def getVMMemConsumption(self):
    method getNetworkAdapterIds (line 261) | def getNetworkAdapterIds(self):
    method getNetworkAdapterMapping (line 264) | def getNetworkAdapterMapping(self, adapterId):
    method getMaxNetworkBandwidth (line 267) | def getMaxNetworkBandwidth(self, adapterId):
    method getMinNetworkBandwidth (line 270) | def getMinNetworkBandwidth(self, adapterId):
    method getNetworkReadBytes (line 273) | def getNetworkReadBytes(self, adapterId):
    method getNetworkWriteBytes (line 276) | def getNetworkWriteBytes(self, adapterId):
    method getNetworkPacketRetransmitted (line 279) | def getNetworkPacketRetransmitted(self):
    method getLastHardwareChange (line 282) | def getLastHardwareChange(self):
  class CPUInfo (line 285) | class CPUInfo(object):
    method getCPUInfo (line 288) | def getCPUInfo():
    method __init__ (line 293) | def __init__(self, cpuinfo, lscpu):
    method getNumOfCoresPerCPU (line 329) | def getNumOfCoresPerCPU(self):
    method getNumOfCores (line 332) | def getNumOfCores(self):
    method getNumOfThreadsPerCore (line 335) | def getNumOfThreadsPerCore(self):
    method getProcessorType (line 338) | def getProcessorType(self):
    method getFrequency (line 341) | def getFrequency(self):
    method isHyperThreadingOn (line 344) | def isHyperThreadingOn(self):
    method getCPUPercent (line 347) | def getCPUPercent(self):
  class MemoryInfo (line 350) | class MemoryInfo(object):
    method __init__ (line 351) | def __init__(self):
    method getMemSize (line 354) | def getMemSize(self):
    method getMemPercent (line 357) | def getMemPercent(self):
  function getMacAddress (line 360) | def getMacAddress(adapterId):
  function sameList (line 367) | def sameList(l1, l2):
  class NetworkInfo (line 377) | class NetworkInfo(object):
    method __init__ (line 378) | def __init__(self):
    method getAdapterIds (line 385) | def getAdapterIds(self):
    method getNetworkReadBytes (line 388) | def getNetworkReadBytes(self, adapterId):
    method getNetworkWriteBytes (line 406) | def getNetworkWriteBytes(self, adapterId):
    method getNetstat (line 424) | def getNetstat(self):
    method getNetworkPacketRetransmitted (line 428) | def getNetworkPacketRetransmitted(self):
  class HardwareChangeInfo (line 441) | class HardwareChangeInfo(object):
    method __init__ (line 442) | def __init__(self, networkInfo):
    method getHwInfo (line 445) | def getHwInfo(self):
    method setHwInfo (line 451) | def setHwInfo(self, timestamp, hwInfo):
    method getLastHardwareChange (line 456) | def getLastHardwareChange(self):
  class LinuxMetric (line 473) | class LinuxMetric(object):
    method __init__ (line 474) | def __init__(self, config):
    method getTimestamp (line 486) | def getTimestamp(self):
    method getCurrHwFrequency (line 489) | def getCurrHwFrequency(self):
    method getMaxHwFrequency (line 492) | def getMaxHwFrequency(self):
    method getCurrVMProcessingPower (line 495) | def getCurrVMProcessingPower(self):
    method getGuaranteedVMProcessingPower (line 501) | def getGuaranteedVMProcessingPower(self):
    method getMaxVMProcessingPower (line 504) | def getMaxVMProcessingPower(self):
    method getNumOfCoresPerCPU (line 507) | def getNumOfCoresPerCPU(self):
    method getNumOfThreadsPerCore (line 510) | def getNumOfThreadsPerCore(self):
    method getPhysProcessingPowerPerVCPU (line 513) | def getPhysProcessingPowerPerVCPU(self):
    method getProcessorType (line 516) | def getProcessorType(self):
    method getReferenceComputeUnit (line 519) | def getReferenceComputeUnit(self):
    method getVCPUMapping (line 522) | def getVCPUMapping(self):
    method getVMProcessingPowerConsumption (line 525) | def getVMProcessingPowerConsumption(self):
    method getCurrMemAssigned (line 528) | def getCurrMemAssigned(self):
    method getGuaranteedMemAssigned (line 534) | def getGuaranteedMemAssigned(self):
    method getMaxMemAssigned (line 537) | def getMaxMemAssigned(self):
    method getVMMemConsumption (line 540) | def getVMMemConsumption(self):
    method getNetworkAdapterIds (line 543) | def getNetworkAdapterIds(self):
    method getNetworkAdapterMapping (line 546) | def getNetworkAdapterMapping(self, adapterId):
    method getMaxNetworkBandwidth (line 549) | def getMaxNetworkBandwidth(self, adapterId):
    method getMinNetworkBandwidth (line 552) | def getMinNetworkBandwidth(self, adapterId):
    method getNetworkReadBytes (line 555) | def getNetworkReadBytes(self, adapterId):
    method getNetworkWriteBytes (line 558) | def getNetworkWriteBytes(self, adapterId):
    method getNetworkPacketRetransmitted (line 561) | def getNetworkPacketRetransmitted(self):
    method getLastHardwareChange (line 564) | def getLastHardwareChange(self):
  class VMDataSource (line 567) | class VMDataSource(object):
    method __init__ (line 568) | def __init__(self, config):
    method collect (line 571) | def collect(self):
    method createCounterLastHardwareChange (line 618) | def createCounterLastHardwareChange(self, metrics):
    method createCounterError (line 625) | def createCounterError(self):
    method createCounterCurrHwFrequency (line 631) | def createCounterCurrHwFrequency(self, metrics):
    method createCounterMaxHwFrequency (line 639) | def createCounterMaxHwFrequency(self, metrics):
    method createCounterCurrVMProcessingPower (line 646) | def createCounterCurrVMProcessingPower(self, metrics):
    method createCounterMaxVMProcessingPower (line 653) | def createCounterMaxVMProcessingPower(self, metrics):
    method createCounterGuaranteedVMProcessingPower (line 660) | def createCounterGuaranteedVMProcessingPower(self, metrics):
    method createCounterNumOfCoresPerCPU (line 667) | def createCounterNumOfCoresPerCPU(self, metrics):
    method createCounterNumOfThreadsPerCore (line 673) | def createCounterNumOfThreadsPerCore(self, metrics):
    method createCounterPhysProcessingPowerPerVCPU (line 679) | def createCounterPhysProcessingPowerPerVCPU(self, metrics):
    method createCounterProcessorType (line 685) | def createCounterProcessorType(self, metrics):
    method createCounterReferenceComputeUnit (line 691) | def createCounterReferenceComputeUnit(self, metrics):
    method createCounterVCPUMapping (line 697) | def createCounterVCPUMapping(self, metrics):
    method createCounterVMProcessingPowerConsumption (line 703) | def createCounterVMProcessingPowerConsumption(self, metrics):
    method createCounterCurrMemAssigned (line 712) | def createCounterCurrMemAssigned(self, metrics):
    method createCounterMaxMemAssigned (line 719) | def createCounterMaxMemAssigned(self, metrics):
    method createCounterGuaranteedMemAssigned (line 726) | def createCounterGuaranteedMemAssigned(self, metrics):
    method createCounterVMMemConsumption (line 733) | def createCounterVMMemConsumption(self, metrics):
    method createCounterAdapterId (line 742) | def createCounterAdapterId(self, adapterId):
    method createCounterNetworkMapping (line 749) | def createCounterNetworkMapping(self, metrics, adapterId):
    method createCounterMaxNetworkBandwidth (line 756) | def createCounterMaxNetworkBandwidth(self, metrics, adapterId):
    method createCounterMinNetworkBandwidth (line 764) | def createCounterMinNetworkBandwidth(self, metrics, adapterId):
    method createCounterNetworkReadBytes (line 772) | def createCounterNetworkReadBytes(self, metrics, adapterId):
    method createCounterNetworkWriteBytes (line 780) | def createCounterNetworkWriteBytes(self, metrics, adapterId):
    method createCounterNetworkPacketRetransmitted (line 788) | def createCounterNetworkPacketRetransmitted(self, metrics):
  function getStorageTimestamp (line 795) | def getStorageTimestamp(unixTimestamp):
  function getStorageTableKeyRange (line 805) | def getStorageTableKeyRange():
  function getStorageMetrics (line 812) | def getStorageMetrics(account, key, hostBase, table, startKey, endKey):
  function getDataDisks (line 832) | def getDataDisks():
  function getFirstLun (line 837) | def getFirstLun(dev):
  class DiskInfo (line 842) | class DiskInfo(object):
    method __init__ (line 843) | def __init__(self, config):
    method getDiskMapping (line 846) | def getDiskMapping(self):
  function isUserRead (line 890) | def isUserRead(op):
  function isUserWrite (line 899) | def isUserWrite(op):
  function storageStat (line 908) | def storageStat(metrics, opFilter):
  class AzureStorageStat (line 933) | class AzureStorageStat(object):
    method __init__ (line 935) | def __init__(self, metrics):
    method getReadBytes (line 940) | def getReadBytes(self):
    method getReadOps (line 943) | def getReadOps(self):
    method getReadOpE2ELatency (line 946) | def getReadOpE2ELatency(self):
    method getReadOpServerLatency (line 949) | def getReadOpServerLatency(self):
    method getReadOpThroughput (line 952) | def getReadOpThroughput(self):
    method getWriteBytes (line 955) | def getWriteBytes(self):
    method getWriteOps (line 958) | def getWriteOps(self):
    method getWriteOpE2ELatency (line 961) | def getWriteOpE2ELatency(self):
    method getWriteOpServerLatency (line 964) | def getWriteOpServerLatency(self):
    method getWriteOpThroughput (line 967) | def getWriteOpThroughput(self):
  class StorageDataSource (line 971) | class StorageDataSource(object):
    method __init__ (line 972) | def __init__(self, config):
    method collect (line 975) | def collect(self):
    method collectMetrixForStandardStorage (line 997) | def collectMetrixForStandardStorage(self, account):
    method createCounterDiskType (line 1023) | def createCounterDiskType(self, dev, diskType):
    method createCounterDiskCaching (line 1030) | def createCounterDiskCaching(self, dev, caching):
    method createCounterDiskThroughput (line 1037) | def createCounterDiskThroughput(self, dev, throughput):
    method createCounterDiskIOPS (line 1045) | def createCounterDiskIOPS(self, dev, iops):
    method createCounterReadBytes (line 1053) | def createCounterReadBytes(self, account, stat):
    method createCounterReadOps (line 1062) | def createCounterReadOps(self, account, stat):
    method createCounterReadOpE2ELatency (line 1070) | def createCounterReadOpE2ELatency(self, account, stat):
    method createCounterReadOpServerLatency (line 1079) | def createCounterReadOpServerLatency(self, account, stat):
    method createCounterReadOpThroughput (line 1088) | def createCounterReadOpThroughput(self, account, stat):
    method createCounterWriteBytes (line 1097) | def createCounterWriteBytes(self, account, stat):
    method createCounterWriteOps (line 1106) | def createCounterWriteOps(self, account, stat):
    method createCounterWriteOpE2ELatency (line 1114) | def createCounterWriteOpE2ELatency(self, account, stat):
    method createCounterWriteOpServerLatency (line 1123) | def createCounterWriteOpServerLatency(self, account, stat):
    method createCounterWriteOpThroughput (line 1132) | def createCounterWriteOpThroughput(self, account, stat):
    method createCounterStorageId (line 1142) | def createCounterStorageId(self, account):
    method createCounterDiskMapping (line 1149) | def createCounterDiskMapping(self, dev, vhd):
  class HvInfo (line 1156) | class HvInfo(object):
    method __init__ (line 1157) | def __init__(self):
    method getHvName (line 1170) | def getHvName(self):
    method getHvVersion (line 1173) | def getHvVersion(self):
  class StaticDataSource (line 1176) | class StaticDataSource(object):
    method __init__ (line 1177) | def __init__(self, config):
    method collect (line 1180) | def collect(self):
    method createCounterVMSLAThroughput (line 1200) | def createCounterVMSLAThroughput(self, throughput):
    method createCounterVMSLAIOPS (line 1207) | def createCounterVMSLAIOPS(self, iops):
    method createCounterCloudProvider (line 1214) | def createCounterCloudProvider(self):
    method createCounterVirtSlnVersion (line 1220) | def createCounterVirtSlnVersion(self, hvVersion):
    method createCounterVirtSln (line 1226) | def createCounterVirtSln(self, hvName):
    method createCounterInstanceType (line 1232) | def createCounterInstanceType(self):
    method createCounterDataSources (line 1238) | def createCounterDataSources(self):
    method createCounterDataProviderVersion (line 1245) | def createCounterDataProviderVersion(self):
    method createCounterMemoryOverCommitted (line 1251) | def createCounterMemoryOverCommitted(self):
    method createCounterCpuOverCommitted (line 1258) | def createCounterCpuOverCommitted(self):
  class PerfCounterType (line 1265) | class PerfCounterType(object):
  class PerfCounter (line 1272) | class PerfCounter(object):
    method __init__ (line 1273) | def __init__(self,
    method __str__ (line 1295) | def __str__(self):
  class EnhancedMonitor (line 1310) | class EnhancedMonitor(object):
    method __init__ (line 1311) | def __init__(self, config):
    method run (line 1318) | def run(self):
  class PerfCounterWriter (line 1326) | class PerfCounterWriter(object):
    method write (line 1327) | def write(self, counters, maxRetry = 3, eventFile=EventFile):
    method _write (line 1346) | def _write(self, counters, eventFile):
  class EnhancedMonitorConfig (line 1350) | class EnhancedMonitorConfig(object):
    method __init__ (line 1351) | def __init__(self, publicConfig, privateConfig):
    method getVmSize (line 1372) | def getVmSize(self):
    method getVmRoleInstance (line 1375) | def getVmRoleInstance(self):
    method getVmDeploymentId (line 1378) | def getVmDeploymentId(self):
    method isMemoryOverCommitted (line 1381) | def isMemoryOverCommitted(self):
    method isCpuOverCommitted (line 1384) | def isCpuOverCommitted(self):
    method getScriptVersion (line 1387) | def getScriptVersion(self):
    method isVerbose (line 1390) | def isVerbose(self):
    method getVMSLAIOPS (line 1394) | def getVMSLAIOPS(self):
    method getVMSLAThroughput (line 1397) | def getVMSLAThroughput(self):
    method getOSDiskName (line 1400) | def getOSDiskName(self):
    method getOSDiskAccount (line 1403) | def getOSDiskAccount(self):
    method getOSDiskConnMinute (line 1407) | def getOSDiskConnMinute(self):
    method getOSDiskConnHour (line 1410) | def getOSDiskConnHour(self):
    method getOSDiskType (line 1413) | def getOSDiskType(self):
    method getOSDiskCaching (line 1416) | def getOSDiskCaching(self):
    method getOSDiskSLAIOPS (line 1419) | def getOSDiskSLAIOPS(self):
    method getOSDiskSLAThroughput (line 1422) | def getOSDiskSLAThroughput(self):
    method getDataDiskCount (line 1425) | def getDataDiskCount(self):
    method getDataDiskLun (line 1428) | def getDataDiskLun(self, index):
    method getDataDiskName (line 1431) | def getDataDiskName(self, index):
    method getDataDiskAccount (line 1434) | def getDataDiskAccount(self, index):
    method getDataDiskConnMinute (line 1437) | def getDataDiskConnMinute(self, index):
    method getDataDiskConnHour (line 1440) | def getDataDiskConnHour(self, index):
    method getDataDiskType (line 1443) | def getDataDiskType(self, index):
    method getDataDiskCaching (line 1446) | def getDataDiskCaching(self, index):
    method getDataDiskSLAIOPS (line 1449) | def getDataDiskSLAIOPS(self, index):
    method getDataDiskSLAThroughput (line 1452) | def getDataDiskSLAThroughput(self, index):
    method getStorageAccountNames (line 1455) | def getStorageAccountNames(self):
    method getStorageAccountKey (line 1458) | def getStorageAccountKey(self, name):
    method getStorageAccountType (line 1461) | def getStorageAccountType(self, name):
    method getStorageHostBase (line 1465) | def getStorageHostBase(self, name):
    method getStorageAccountMinuteUri (line 1468) | def getStorageAccountMinuteUri(self, name):
    method getStorageAccountMinuteTable (line 1471) | def getStorageAccountMinuteTable(self, name):
    method getStorageAccountHourUri (line 1477) | def getStorageAccountHourUri(self, name):
    method isLADEnabled (line 1480) | def isLADEnabled(self):
    method getLADKey (line 1484) | def getLADKey(self):
    method getLADName (line 1487) | def getLADName(self):
    method getLADHostBase (line 1490) | def getLADHostBase(self):
    method getLADUri (line 1493) | def getLADUri(self):

FILE: AzureEnhancedMonitor/ext/handler.py
  function printable (line 32) | def printable(s):
  function enable (line 35) | def enable(hutil):
  function disable (line 64) | def disable(hutil):
  function daemon (line 82) | def daemon(hutil):
  function grace_exit (line 110) | def grace_exit(operation, status, msg):
  function parse_context (line 114) | def parse_context(operation):
  function main (line 119) | def main():

FILE: AzureEnhancedMonitor/ext/installer.py
  function parse_context (line 26) | def parse_context(operation):
  function find_psutil_build (line 31) | def find_psutil_build(buildDir):
  function main (line 42) | def main():

FILE: AzureEnhancedMonitor/ext/test/test_aem.py
  class TestAEM (line 98) | class TestAEM(unittest.TestCase):
    method setUp (line 99) | def setUp(self):
    method test_config (line 102) | def test_config(self):
    method test_static_datasource (line 113) | def test_static_datasource(self):
    method test_cpuinfo (line 160) | def test_cpuinfo(self):
    method test_meminfo (line 172) | def test_meminfo(self):
    method test_networkinfo (line 180) | def test_networkinfo(self):
    method test_hwchangeinfo (line 191) | def test_hwchangeinfo(self):
    method test_linux_metric (line 212) | def test_linux_metric(self):
    method validate_cnm_metric (line 218) | def validate_cnm_metric(self, metric):
    method test_vm_datasource (line 247) | def test_vm_datasource(self):
    method test_storagemetric (line 287) | def test_storagemetric(self):
    method test_disk_info (line 302) | def test_disk_info(self):
    method test_get_storage_key_range (line 307) | def test_get_storage_key_range(self):
    method test_storage_datasource (line 314) | def test_storage_datasource(self):
    method test_writer (line 345) | def test_writer(self):
    method test_easyHash (line 367) | def test_easyHash(self):
    method test_get_ad_key_range (line 377) | def test_get_ad_key_range(self):
    method test_get_mds_timestamp (line 382) | def test_get_mds_timestamp(self):
    method test_get_storage_timestamp (line 389) | def test_get_storage_timestamp(self):
  function mock_getStorageMetrics (line 396) | def mock_getStorageMetrics(*args, **kwargs):

FILE: AzureEnhancedMonitor/ext/test/test_installer.py
  class TestInstall (line 26) | class TestInstall(unittest.TestCase):
    method test_install_psutil (line 27) | def test_install_psutil(self):

FILE: AzureEnhancedMonitor/hvinfo/src/hvinfo.c
  function get_cpuid (line 21) | void get_cpuid(unsigned int leaf, unsigned int *cpuid)
  function u32_to_char_arr (line 29) | void u32_to_char_arr(char* dest, unsigned int i)
  function main (line 37) | int main()

FILE: AzureEnhancedMonitor/nodejs/setaem.js
  function getUserHome (line 546) | function getUserHome() {

FILE: AzureMonitorAgent/agent.py
  function check_output (line 88) | def check_output(*popenargs, **kwargs):
  class CalledProcessError (line 103) | class CalledProcessError(Exception):
    method __init__ (line 104) | def __init__(self, returncode, cmd, output=None):
    method __str__ (line 109) | def __str__(self):
  function main (line 160) | def main():
  function check_disk_space_availability (line 238) | def check_disk_space_availability():
  function get_free_space_mb (line 253) | def get_free_space_mb(dirname):
  function is_systemd (line 260) | def is_systemd():
  function get_service_command (line 266) | def get_service_command(service, *operations):
  function check_kill_process (line 276) | def check_kill_process(pstring):
  function compare_and_copy_bin (line 282) | def compare_and_copy_bin(src, dest):
  function set_metrics_binaries (line 300) | def set_metrics_binaries():
  function copy_amacoreagent_binaries (line 314) | def copy_amacoreagent_binaries():
  function copy_mdsd_fluentbit_binaries (line 337) | def copy_mdsd_fluentbit_binaries():
  function get_installed_package_version (line 369) | def get_installed_package_version():
  function get_current_bundle_file (line 392) | def get_current_bundle_file():
  function install (line 399) | def install():
  function uninstall (line 540) | def uninstall():
  function force_uninstall_azure_monitor_agent (line 629) | def force_uninstall_azure_monitor_agent():
  function _get_package_files_for_cleanup (line 703) | def _get_package_files_for_cleanup():
  function _remove_package_files_from_list (line 752) | def _remove_package_files_from_list(package_files):
  function enable (line 806) | def enable():
  function handle_gcs_config (line 970) | def handle_gcs_config(public_settings, protected_settings, default_confi...
  function handle_mcs_config (line 1087) | def handle_mcs_config(public_settings, protected_settings, default_confi...
  function get_control_plane_mode (line 1166) | def get_control_plane_mode():
  function disable (line 1193) | def disable():
  function update (line 1238) | def update():
  function _get_uninstall_context (line 1261) | def _get_uninstall_context():
  function _cleanup_uninstall_context (line 1284) | def _cleanup_uninstall_context():
  function restart_launcher (line 1298) | def restart_launcher():
  function restart_astextension (line 1304) | def restart_astextension():
  function set_proxy (line 1310) | def set_proxy(address, username, password):
  function unset_proxy (line 1343) | def unset_proxy():
  function get_managed_identity (line 1370) | def get_managed_identity():
  function azureotelcollector_is_active (line 1410) | def azureotelcollector_is_active():
  function install_azureotelcollector (line 1424) | def install_azureotelcollector():
  function get_otelcollector_installation_command (line 1452) | def get_otelcollector_installation_command():
  function find_otelcollector_package_file (line 1468) | def find_otelcollector_package_file(directory, pkg_type):
  function uninstall_azureotelcollector (line 1497) | def uninstall_azureotelcollector():
  function stop_metrics_process (line 1530) | def stop_metrics_process():
  function stop_syslogconfig_process (line 1577) | def stop_syslogconfig_process():
  function is_metrics_process_running (line 1596) | def is_metrics_process_running():
  function is_syslogconfig_process_running (line 1611) | def is_syslogconfig_process_running():
  function is_transformconfig_process_running (line 1626) | def is_transformconfig_process_running():
  function start_metrics_process (line 1641) | def start_metrics_process():
  function start_syslogconfig_process (line 1659) | def start_syslogconfig_process():
  function start_transformconfig_process (line 1676) | def start_transformconfig_process():
  function stop_transformconfig_process (line 1693) | def stop_transformconfig_process():
  function metrics_watcher (line 1712) | def metrics_watcher(hutil_error, hutil_log):
  function syslogconfig_watcher (line 1985) | def syslogconfig_watcher(hutil_error, hutil_log):
  function transformconfig_watcher (line 2029) | def transformconfig_watcher(hutil_error, hutil_log):
  function generate_localsyslog_configs (line 2062) | def generate_localsyslog_configs(uses_gcs = False, uses_mcs = False):
  function remove_localsyslog_configs (line 2196) | def remove_localsyslog_configs():
  function metrics (line 2218) | def metrics():
  function syslogconfig (line 2233) | def syslogconfig():
  function transformconfig (line 2248) | def transformconfig():
  function parse_context (line 2275) | def parse_context(operation):
  function set_os_arch (line 2311) | def set_os_arch(operation):
  function find_package_manager (line 2325) | def find_package_manager(operation):
  function find_vm_distro (line 2355) | def find_vm_distro(operation):
  function is_vm_supported_for_extension (line 2541) | def is_vm_supported_for_extension(operation):
  function exit_if_vm_not_supported (line 2592) | def exit_if_vm_not_supported(operation):
  function is_feature_enabled (line 2604) | def is_feature_enabled(feature):
  function get_ssl_cert_info (line 2631) | def get_ssl_cert_info(operation):
  function copy_astextension_binaries (line 2656) | def copy_astextension_binaries():
  function is_arc_installed (line 2672) | def is_arc_installed():
  function get_arc_endpoint (line 2681) | def get_arc_endpoint():
  function get_imds_endpoint (line 2696) | def get_imds_endpoint():
  function get_azure_environment_and_region (line 2718) | def get_azure_environment_and_region():
  function run_command_and_log (line 2747) | def run_command_and_log(cmd, check_error = True, log_cmd = True, log_out...
  function run_command_with_retries_output (line 2773) | def run_command_with_retries_output(cmd, retries, retry_check, final_che...
  function is_dpkg_or_rpm_locked (line 2812) | def is_dpkg_or_rpm_locked(exit_code, output):
  function retry_if_dpkg_or_rpm_locked (line 2830) | def retry_if_dpkg_or_rpm_locked(exit_code, output):
  function final_check_if_dpkg_or_rpm_locked (line 2844) | def final_check_if_dpkg_or_rpm_locked(exit_code, output):
  function get_settings (line 2854) | def get_settings():
  function update_status_file (line 2941) | def update_status_file(operation, exit_code, exit_status, message):
  function get_handler_env (line 2983) | def get_handler_env():
  function get_latest_seq_no (line 3002) | def get_latest_seq_no():
  function run_get_output (line 3039) | def run_get_output(cmd, chk_err = False, log_cmd = True):
  function init_waagent_logger (line 3082) | def init_waagent_logger():
  function waagent_log_info (line 3094) | def waagent_log_info(message):
  function waagent_log_error (line 3105) | def waagent_log_error(message):
  function hutil_log_info (line 3116) | def hutil_log_info(message):
  function hutil_log_error (line 3127) | def hutil_log_error(message):
  function log_and_exit (line 3138) | def log_and_exit(operation, exit_code = GenericErrorCode, message = ''):
  function validate_port_number (line 3159) | def validate_port_number(port_value, port_name):
  class AzureMonitorAgentForLinuxException (line 3188) | class AzureMonitorAgentForLinuxException(Exception):
    method get_error_message (line 3194) | def get_error_message(self, operation):
  class ParameterMissingException (line 3202) | class ParameterMissingException(AzureMonitorAgentForLinuxException):
    method get_error_message (line 3207) | def get_error_message(self, operation):

FILE: AzureMonitorAgent/ama_tst/modules/connect/check_endpts.py
  function _log_ssl_error (line 18) | def _log_ssl_error(context, exception, show_traceback=True):
  function check_endpt_ssl (line 37) | def check_endpt_ssl(ssl_cmd, endpoint):
  function check_internet_connect (line 82) | def check_internet_connect():
  function resolve_ip (line 97) | def resolve_ip(endpoint):
  function check_endpt_curl (line 108) | def check_endpt_curl(endpoint):
  function check_ama_endpts (line 135) | def check_ama_endpts():

FILE: AzureMonitorAgent/ama_tst/modules/connect/check_imds.py
  function check_metadata (line 19) | def check_metadata():
  function check_token (line 46) | def check_token():
  function check_imds_api (line 70) | def check_imds_api():

FILE: AzureMonitorAgent/ama_tst/modules/connect/connect.py
  function check_parameters (line 17) | def check_parameters():
  function check_workspace (line 31) | def check_workspace():
  function check_subcomponents (line 38) | def check_subcomponents():
  function check_connection (line 65) | def check_connection(interactive, err_codes=True, prev_success=NO_ERROR):

FILE: AzureMonitorAgent/ama_tst/modules/custom_logs/check_clconf.py
  function check_customlog_input (line 9) | def check_customlog_input():
  function check_customlog_conf (line 31) | def check_customlog_conf():

FILE: AzureMonitorAgent/ama_tst/modules/custom_logs/custom_logs.py
  function check_custom_logs (line 5) | def check_custom_logs(interactive, prev_success=NO_ERROR):

FILE: AzureMonitorAgent/ama_tst/modules/errors.py
  function is_error (line 97) | def is_error(err_code):
  function get_input (line 105) | def get_input(question, check_ans, no_fit):
  function print_errors (line 112) | def print_errors(err_code):

FILE: AzureMonitorAgent/ama_tst/modules/general_health/check_status.py
  function check_restart_status (line 9) | def check_restart_status(interactive):

FILE: AzureMonitorAgent/ama_tst/modules/general_health/general_health.py
  function check_err_file (line 9) | def check_err_file():
  function check_general_health (line 35) | def check_general_health(interactive, err_codes=True, prev_success=NO_ER...

FILE: AzureMonitorAgent/ama_tst/modules/helpers.py
  function geninfo_lookup (line 37) | def geninfo_lookup(key):
  function get_input (line 44) | def get_input(question, check_ans=None, no_fit=None):
  function is_arc_installed (line 53) | def is_arc_installed():
  function find_vm_bits (line 61) | def find_vm_bits():
  function find_vm_distro (line 67) | def find_vm_distro():
  function find_package_manager (line 107) | def find_package_manager():
  function get_package_version (line 143) | def get_package_version(pkg):
  function get_dpkg_pkg_version (line 155) | def get_dpkg_pkg_version(pkg):
  function get_rpm_pkg_version (line 174) | def get_rpm_pkg_version(pkg):
  function find_ama_version (line 198) | def find_ama_version():
  function check_ama_installed (line 210) | def check_ama_installed(ama_vers):
  function run_cmd_output (line 218) | def run_cmd_output(cmd):
  function find_dcr_workspace (line 229) | def find_dcr_workspace():
  function find_dce (line 298) | def find_dce():
  function is_metrics_configured (line 330) | def is_metrics_configured():

FILE: AzureMonitorAgent/ama_tst/modules/high_cpu_mem/check_logrot.py
  function hr2bytes (line 10) | def hr2bytes(hr_size):
  function check_size_config (line 30) | def check_size_config(logrotate_configs):
  function check_log_rotation (line 67) | def check_log_rotation():

FILE: AzureMonitorAgent/ama_tst/modules/high_cpu_mem/check_usage.py
  function find_mdsd_pid (line 8) | def find_mdsd_pid():
  function check_usage (line 20) | def check_usage(interactive):

FILE: AzureMonitorAgent/ama_tst/modules/high_cpu_mem/high_cpu_mem.py
  function check_high_cpu_memory (line 6) | def check_high_cpu_memory(interactive, prev_success=NO_ERROR):

FILE: AzureMonitorAgent/ama_tst/modules/install/check_ama.py
  function get_latest_ama_version (line 27) | def get_latest_ama_version(curr_version):
  function comp_versions_ge (line 152) | def comp_versions_ge(version1, version2):
  function ask_update_old_version (line 167) | def ask_update_old_version(ama_version, curr_ama_version):
  function check_ama (line 185) | def check_ama(interactive):

FILE: AzureMonitorAgent/ama_tst/modules/install/check_os.py
  function format_alternate_versions (line 9) | def format_alternate_versions(supported_dist, versions):
  function check_vm_supported (line 21) | def check_vm_supported(vm_dist, vm_ver):
  function check_os (line 74) | def check_os():

FILE: AzureMonitorAgent/ama_tst/modules/install/check_pkgs.py
  function check_packages (line 9) | def check_packages():
  function check_syslog (line 36) | def check_syslog():

FILE: AzureMonitorAgent/ama_tst/modules/install/install.py
  function check_space (line 10) | def check_space():
  function check_pkg_manager (line 24) | def check_pkg_manager():
  function check_syslog_user (line 30) | def check_syslog_user():
  function check_installation (line 37) | def check_installation(interactive, err_codes=True, prev_success=NO_ERROR):

FILE: AzureMonitorAgent/ama_tst/modules/logcollector.py
  function copy_file (line 40) | def copy_file(src, dst):
  function copy_dircontents (line 55) | def copy_dircontents(src, dst):
  function collect_process_environ (line 86) | def collect_process_environ(output_dirpath, process_name, outfile_handle...
  function _write_process_environ_data (line 112) | def _write_process_environ_data(file_handle, process_name, separate_file...
  function collect_logs (line 155) | def collect_logs(output_dirpath, pkg_manager):
  function collect_arc_logs (line 195) | def collect_arc_logs(output_dirpath, pkg_manager):
  function collect_azurevm_logs (line 213) | def collect_azurevm_logs(output_dirpath, pkg_manager):
  function collect_metrics_logs (line 227) | def collect_metrics_logs(output_dirpath):
  function create_outfile (line 269) | def create_outfile(output_dirpath, logs_date, pkg_manager):
  function run_logcollector (line 428) | def run_logcollector(output_location):

FILE: AzureMonitorAgent/ama_tst/modules/main.py
  function check_sudo (line 17) | def check_sudo():
  function check_all (line 26) | def check_all(interactive):
  function collect_logs (line 87) | def collect_logs():
  function print_results (line 97) | def print_results(success):
  function print_next_steps (line 120) | def print_next_steps():
  function run_troubleshooter (line 143) | def run_troubleshooter():

FILE: AzureMonitorAgent/ama_tst/modules/metrics_troubleshooter/metrics_troubleshooter.py
  function run_metrics_troubleshooter (line 10) | def run_metrics_troubleshooter(interactive):

FILE: AzureMonitorAgent/ama_tst/modules/syslog_tst/check_conf.py
  function check_conf_files (line 12) | def check_conf_files():
  function check_socket (line 32) | def check_socket():

FILE: AzureMonitorAgent/ama_tst/modules/syslog_tst/check_rsysng.py
  function check_sys_systemctl (line 13) | def check_sys_systemctl(service):
  function check_services (line 37) | def check_services():

FILE: AzureMonitorAgent/ama_tst/modules/syslog_tst/syslog.py
  function check_syslog (line 6) | def check_syslog(interactive, prev_success=NO_ERROR):

FILE: Common/libpsutil/py2.6-glibc-2.12-pre/psutil/__init__.py
  class Error (line 189) | class Error(Exception):
  class NoSuchProcess (line 195) | class NoSuchProcess(Error):
    method __init__ (line 200) | def __init__(self, pid, name=None, msg=None):
    method __str__ (line 212) | def __str__(self):
  class AccessDenied (line 216) | class AccessDenied(Error):
    method __init__ (line 219) | def __init__(self, pid=None, name=None, msg=None):
    method __str__ (line 232) | def __str__(self):
  class TimeoutExpired (line 236) | class TimeoutExpired(Error):
    method __init__ (line 241) | def __init__(self, seconds, pid=None, name=None):
    method __str__ (line 252) | def __str__(self):
  function _assert_pid_not_reused (line 265) | def _assert_pid_not_reused(fun):
  class Process (line 277) | class Process(object):
    method __init__ (line 310) | def __init__(self, pid=None):
    method _init (line 313) | def _init(self, pid, _ignore_nsp=False):
    method __str__ (line 355) | def __str__(self):
    method __repr__ (line 368) | def __repr__(self):
    method __eq__ (line 371) | def __eq__(self, other):
    method __ne__ (line 378) | def __ne__(self, other):
    method __hash__ (line 381) | def __hash__(self):
    method as_dict (line 388) | def as_dict(self, attrs=None, ad_value=None):
    method parent (line 444) | def parent(self):
    method is_running (line 459) | def is_running(self):
    method pid (line 480) | def pid(self):
    method ppid (line 484) | def ppid(self):
    method name (line 502) | def name(self):
    method exe (line 524) | def exe(self):
    method cmdline (line 563) | def cmdline(self):
    method status (line 567) | def status(self):
    method username (line 571) | def username(self):
    method create_time (line 589) | def create_time(self):
    method cwd (line 598) | def cwd(self):
    method nice (line 602) | def nice(self, value=None):
    method uids (line 613) | def uids(self):
    method gids (line 619) | def gids(self):
    method terminal (line 625) | def terminal(self):
    method num_fds (line 631) | def num_fds(self):
    method io_counters (line 640) | def io_counters(self):
    method ionice (line 652) | def ionice(self, ioclass=None, value=None):
    method rlimit (line 674) | def rlimit(self, resource, limits=None):
    method cpu_affinity (line 692) | def cpu_affinity(self, cpus=None):
    method num_handles (line 705) | def num_handles(self):
    method num_ctx_switches (line 711) | def num_ctx_switches(self):
    method num_threads (line 717) | def num_threads(self):
    method threads (line 721) | def threads(self):
    method children (line 729) | def children(self, recursive=False):
    method cpu_percent (line 824) | def cpu_percent(self, interval=None):
    method cpu_times (line 893) | def cpu_times(self):
    method memory_info (line 900) | def memory_info(self):
    method memory_info_ex (line 911) | def memory_info_ex(self):
    method memory_percent (line 918) | def memory_percent(self):
    method memory_maps (line 930) | def memory_maps(self, grouped=True):
    method open_files (line 957) | def open_files(self):
    method connections (line 964) | def connections(self, kind='inet'):
    method _send_signal (line 986) | def _send_signal(self, sig):
    method send_signal (line 1002) | def send_signal(self, sig):
    method suspend (line 1017) | def suspend(self):
    method resume (line 1028) | def resume(self):
    method terminate (line 1039) | def terminate(self):
    method kill (line 1050) | def kill(self):
    method wait (line 1059) | def wait(self, timeout=None):
    method get_children (line 1080) | def get_children(self):
    method get_connections (line 1084) | def get_connections(self):
    method get_cpu_affinity (line 1089) | def get_cpu_affinity(self):
    method set_cpu_affinity (line 1093) | def set_cpu_affinity(self, cpus):
    method get_cpu_percent (line 1097) | def get_cpu_percent(self):
    method get_cpu_times (line 1101) | def get_cpu_times(self):
    method getcwd (line 1105) | def getcwd(self):
    method get_ext_memory_info (line 1109) | def get_ext_memory_info(self):
    method get_io_counters (line 1114) | def get_io_counters(self):
    method get_ionice (line 1119) | def get_ionice(self):
    method set_ionice (line 1123) | def set_ionice(self, ioclass, value=None):
    method get_memory_info (line 1127) | def get_memory_info(self):
    method get_memory_maps (line 1131) | def get_memory_maps(self):
    method get_memory_percent (line 1135) | def get_memory_percent(self):
    method get_nice (line 1139) | def get_nice(self):
    method get_num_ctx_switches (line 1143) | def get_num_ctx_switches(self):
    method get_num_fds (line 1148) | def get_num_fds(self):
    method get_num_handles (line 1153) | def get_num_handles(self):
    method get_num_threads (line 1157) | def get_num_threads(self):
    method get_open_files (line 1161) | def get_open_files(self):
    method get_rlimit (line 1166) | def get_rlimit(self):
    method set_rlimit (line 1170) | def set_rlimit(self, resource, limits):
    method get_threads (line 1174) | def get_threads(self):
    method set_nice (line 1178) | def set_nice(self, value):
  class Popen (line 1188) | class Popen(Process):
    method __init__ (line 1223) | def __init__(self, *args, **kwargs):
    method __dir__ (line 1230) | def __dir__(self):
    method __getattribute__ (line 1233) | def __getattribute__(self, name):
    method wait (line 1243) | def wait(self, timeout=None):
  function pids (line 1255) | def pids():
  function pid_exists (line 1260) | def pid_exists(pid):
  function process_iter (line 1281) | def process_iter():
  function wait_procs (line 1331) | def wait_procs(procs, timeout=None, callback=None):
  function cpu_count (line 1422) | def cpu_count(logical=True):
  function cpu_times (line 1442) | def cpu_times(percpu=False):
  function cpu_percent (line 1472) | def cpu_percent(interval=None, percpu=False):
  function cpu_times_percent (line 1557) | def cpu_times_percent(interval=None, percpu=False):
  function virtual_memory (line 1631) | def virtual_memory():
  function swap_memory (line 1691) | def swap_memory():
  function disk_usage (line 1711) | def disk_usage(path):
  function disk_partitions (line 1719) | def disk_partitions(all=False):
  function disk_io_counters (line 1731) | def disk_io_counters(perdisk=False):
  function net_io_counters (line 1765) | def net_io_counters(pernic=False):
  function net_connections (line 1795) | def net_connections(kind='inet'):
  function boot_time (line 1824) | def boot_time():
  function users (line 1833) | def users():
  function get_pid_list (line 1851) | def get_pid_list():
  function get_process_list (line 1856) | def get_process_list():
  function get_users (line 1861) | def get_users():
  function phymem_usage (line 1866) | def phymem_usage():
  function virtmem_usage (line 1875) | def virtmem_usage():
  function avail_phymem (line 1880) | def avail_phymem():
  function used_phymem (line 1885) | def used_phymem():
  function total_virtmem (line 1890) | def total_virtmem():
  function used_virtmem (line 1895) | def used_virtmem():
  function avail_virtmem (line 1900) | def avail_virtmem():
  function network_io_counters (line 1905) | def network_io_counters(pernic=False):
  function test (line 1909) | def test():
  function _replace_module (line 1973) | def _replace_module():

FILE: Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_common.py
  function usage_percent (line 58) | def usage_percent(used, total, _round=None):
  function memoize (line 70) | def memoize(fun):
  function deprecated (line 112) | def deprecated(replacement=None):
  function deprecated_method (line 130) | def deprecated_method(replacement):
  function isfile_strict (line 148) | def isfile_strict(path):
  class pconn (line 241) | class pconn(
    method local_address (line 247) | def local_address(self):
    method remote_address (line 253) | def remote_address(self):

FILE: Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_compat.py
  function exec_ (line 35) | def exec_(code, globs=None, locs=None):
  function callable (line 51) | def callable(obj):
  class _HashedSeq (line 72) | class _HashedSeq(list):
    method __init__ (line 75) | def __init__(self, tup, hash=hash):
    method __hash__ (line 79) | def __hash__(self):
  function _make_key (line 82) | def _make_key(args, kwds, typed,
  function lru_cache (line 100) | def lru_cache(maxsize=100, typed=False):

FILE: Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_psbsd.py
  function virtual_memory (line 71) | def virtual_memory():
  function swap_memory (line 82) | def swap_memory():
  function cpu_times (line 89) | def cpu_times():
  function per_cpu_times (line 96) | def per_cpu_times():
  function per_cpu_times (line 112) | def per_cpu_times():
  function cpu_count_logical (line 123) | def cpu_count_logical():
  function cpu_count_physical (line 128) | def cpu_count_physical():
  function boot_time (line 150) | def boot_time():
  function disk_partitions (line 155) | def disk_partitions(all=False):
  function users (line 170) | def users():
  function net_connections (line 182) | def net_connections(kind):
  function wrap_exceptions (line 206) | def wrap_exceptions(fun):
  class Process (line 226) | class Process(object):
    method __init__ (line 231) | def __init__(self, pid):
    method name (line 236) | def name(self):
    method exe (line 240) | def exe(self):
    method cmdline (line 244) | def cmdline(self):
    method terminal (line 248) | def terminal(self):
    method ppid (line 257) | def ppid(self):
    method uids (line 261) | def uids(self):
    method gids (line 266) | def gids(self):
    method cpu_times (line 271) | def cpu_times(self):
    method memory_info (line 276) | def memory_info(self):
    method memory_info_ex (line 281) | def memory_info_ex(self):
    method create_time (line 285) | def create_time(self):
    method num_threads (line 289) | def num_threads(self):
    method num_ctx_switches (line 293) | def num_ctx_switches(self):
    method threads (line 297) | def threads(self):
    method connections (line 306) | def connections(self, kind='inet'):
    method wait (line 321) | def wait(self, timeout=None):
    method nice_get (line 331) | def nice_get(self):
    method nice_set (line 335) | def nice_set(self, value):
    method status (line 339) | def status(self):
    method io_counters (line 347) | def io_counters(self):
    method open_files (line 361) | def open_files(self):
    method cwd (line 367) | def cwd(self):
    method memory_maps (line 374) | def memory_maps(self):
    method num_fds (line 378) | def num_fds(self):
    method _not_implemented (line 383) | def _not_implemented(self):
    method cpu_affinity_get (line 392) | def cpu_affinity_get(self):
    method cpu_affinity_set (line 396) | def cpu_affinity_set(self, cpus):

FILE: Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_pslinux.py
  function _get_cputimes_fields (line 101) | def _get_cputimes_fields():
  function virtual_memory (line 142) | def virtual_memory():
  function swap_memory (line 171) | def swap_memory():
  function cached_phymem (line 197) | def cached_phymem():
  function phymem_buffers (line 202) | def phymem_buffers():
  function cpu_times (line 208) | def cpu_times():
  function per_cpu_times (line 222) | def per_cpu_times():
  function cpu_count_logical (line 240) | def cpu_count_logical():
  function cpu_count_physical (line 269) | def cpu_count_physical():
  function users (line 282) | def users():
  function boot_time (line 300) | def boot_time():
  function pids (line 314) | def pids():
  function pid_exists (line 319) | def pid_exists(pid):
  class Connections (line 326) | class Connections:
    method __init__ (line 338) | def __init__(self):
    method get_proc_inodes (line 358) | def get_proc_inodes(self, pid):
    method get_all_inodes (line 373) | def get_all_inodes(self):
    method decode_address (line 391) | def decode_address(self, addr, family):
    method process_inet (line 438) | def process_inet(self, file, family, type_, inodes, filter_pid=None):
    method process_unix (line 469) | def process_unix(self, file, family, inodes, filter_pid=None):
    method retrieve (line 495) | def retrieve(self, kind, pid=None):
  function net_connections (line 528) | def net_connections(kind='inet'):
  function net_io_counters (line 533) | def net_io_counters():
  function disk_io_counters (line 560) | def disk_io_counters():
  function disk_partitions (line 611) | def disk_partitions(all=False):
  function wrap_exceptions (line 638) | def wrap_exceptions(fun):
  class Process (line 661) | class Process(object):
    method __init__ (line 666) | def __init__(self, pid):
    method name (line 671) | def name(self):
    method exe (line 678) | def exe(self):
    method cmdline (line 706) | def cmdline(self):
    method terminal (line 713) | def terminal(self):
    method io_counters (line 724) | def io_counters(self):
    method io_counters (line 743) | def io_counters(self):
    method cpu_times (line 748) | def cpu_times(self):
    method wait (line 759) | def wait(self, timeout=None):
    method create_time (line 769) | def create_time(self):
    method memory_info (line 784) | def memory_info(self):
    method memory_info_ex (line 791) | def memory_info_ex(self):
    method memory_maps (line 811) | def memory_maps(self):
    method memory_maps (line 869) | def memory_maps(self):
    method cwd (line 876) | def cwd(self):
    method num_ctx_switches (line 884) | def num_ctx_switches(self):
    method num_threads (line 900) | def num_threads(self):
    method threads (line 908) | def threads(self):
    method nice_get (line 938) | def nice_get(self):
    method nice_set (line 947) | def nice_set(self, value):
    method cpu_affinity_get (line 951) | def cpu_affinity_get(self):
    method cpu_affinity_set (line 955) | def cpu_affinity_set(self, cpus):
    method ionice_get (line 971) | def ionice_get(self):
    method ionice_set (line 976) | def ionice_set(self, ioclass, value):
    method rlimit (line 1000) | def rlimit(self, resource, limits=None):
    method status (line 1017) | def status(self):
    method open_files (line 1029) | def open_files(self):
    method connections (line 1061) | def connections(self, kind='inet'):
    method num_fds (line 1068) | def num_fds(self):
    method ppid (line 1072) | def ppid(self):
    method uids (line 1081) | def uids(self):
    method gids (line 1090) | def gids(self):

FILE: Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_psosx.py
  function virtual_memory (line 74) | def virtual_memory():
  function swap_memory (line 84) | def swap_memory():
  function cpu_times (line 91) | def cpu_times():
  function per_cpu_times (line 97) | def per_cpu_times():
  function cpu_count_logical (line 107) | def cpu_count_logical():
  function cpu_count_physical (line 112) | def cpu_count_physical():
  function boot_time (line 117) | def boot_time():
  function disk_partitions (line 122) | def disk_partitions(all=False):
  function users (line 137) | def users():
  function net_connections (line 151) | def net_connections(kind='inet'):
  function wrap_exceptions (line 175) | def wrap_exceptions(fun):
  class Process (line 195) | class Process(object):
    method __init__ (line 200) | def __init__(self, pid):
    method name (line 205) | def name(self):
    method exe (line 209) | def exe(self):
    method cmdline (line 213) | def cmdline(self):
    method ppid (line 219) | def ppid(self):
    method cwd (line 223) | def cwd(self):
    method uids (line 227) | def uids(self):
    method gids (line 232) | def gids(self):
    method terminal (line 237) | def terminal(self):
    method memory_info (line 246) | def memory_info(self):
    method memory_info_ex (line 251) | def memory_info_ex(self):
    method cpu_times (line 256) | def cpu_times(self):
    method create_time (line 261) | def create_time(self):
    method num_ctx_switches (line 265) | def num_ctx_switches(self):
    method num_threads (line 269) | def num_threads(self):
    method open_files (line 273) | def open_files(self):
    method connections (line 285) | def connections(self, kind='inet'):
    method num_fds (line 300) | def num_fds(self):
    method wait (line 306) | def wait(self, timeout=None):
    method nice_get (line 316) | def nice_get(self):
    method nice_set (line 320) | def nice_set(self, value):
    method status (line 324) | def status(self):
    method threads (line 330) | def threads(self):
    method memory_maps (line 339) | def memory_maps(self):

FILE: Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_psposix.py
  class TimeoutExpired (line 19) | class TimeoutExpired(Exception):
  function pid_exists (line 23) | def pid_exists(pid):
  function wait_pid (line 51) | def wait_pid(pid, timeout=None):
  function disk_usage (line 116) | def disk_usage(path):
  function _get_terminal_map (line 144) | def _get_terminal_map():

FILE: Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_pssunos.py
  function virtual_memory (line 77) | def virtual_memory():
  function swap_memory (line 87) | def swap_memory():
  function pids (line 119) | def pids():
  function pid_exists (line 124) | def pid_exists(pid):
  function cpu_times (line 129) | def cpu_times():
  function per_cpu_times (line 135) | def per_cpu_times():
  function cpu_count_logical (line 141) | def cpu_count_logical():
  function cpu_count_physical (line 150) | def cpu_count_physical():
  function boot_time (line 155) | def boot_time():
  function users (line 160) | def users():
  function disk_partitions (line 179) | def disk_partitions(all=False):
  function net_connections (line 200) | def net_connections(kind, _pid=-1):
  function wrap_exceptions (line 229) | def wrap_exceptions(fun):
  class Process (line 251) | class Process(object):
    method __init__ (line 256) | def __init__(self, pid):
    method name (line 261) | def name(self):
    method exe (line 266) | def exe(self):
    method cmdline (line 274) | def cmdline(self):
    method create_time (line 278) | def create_time(self):
    method num_threads (line 282) | def num_threads(self):
    method nice_get (line 286) | def nice_get(self):
    method nice_set (line 303) | def nice_set(self, value):
    method ppid (line 313) | def ppid(self):
    method uids (line 317) | def uids(self):
    method gids (line 322) | def gids(self):
    method cpu_times (line 327) | def cpu_times(self):
    method terminal (line 332) | def terminal(self):
    method cwd (line 350) | def cwd(self):
    method memory_info (line 364) | def memory_info(self):
    method status (line 373) | def status(self):
    method threads (line 379) | def threads(self):
    method open_files (line 403) | def open_files(self):
    method _get_unix_sockets (line 426) | def _get_unix_sockets(self, pid):
    method connections (line 459) | def connections(self, kind='inet'):
    method memory_maps (line 479) | def memory_maps(self):
    method num_fds (line 512) | def num_fds(self):
    method num_ctx_switches (line 516) | def num_ctx_switches(self):
    method wait (line 520) | def wait(self, timeout=None):

FILE: Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_pswindows.py
  function _win32_QueryDosDevice (line 69) | def _win32_QueryDosDevice(s):
  function _convert_raw_path (line 73) | def _convert_raw_path(s):
  function virtual_memory (line 87) | def virtual_memory():
  function swap_memory (line 100) | def swap_memory():
  function disk_usage (line 110) | def disk_usage(path):
  function disk_partitions (line 124) | def disk_partitions(all):
  function cpu_times (line 130) | def cpu_times():
  function per_cpu_times (line 136) | def per_cpu_times():
  function cpu_count_logical (line 146) | def cpu_count_logical():
  function cpu_count_physical (line 151) | def cpu_count_physical():
  function boot_time (line 156) | def boot_time():
  function net_connections (line 161) | def net_connections(kind, _pid=-1):
  function users (line 182) | def users():
  function wrap_exceptions (line 200) | def wrap_exceptions(fun):
  class Process (line 220) | class Process(object):
    method __init__ (line 225) | def __init__(self, pid):
    method name (line 230) | def name(self):
    method exe (line 244) | def exe(self):
    method cmdline (line 256) | def cmdline(self):
    method ppid (line 259) | def ppid(self):
    method _get_raw_meminfo (line 265) | def _get_raw_meminfo(self):
    method memory_info (line 274) | def memory_info(self):
    method memory_info_ex (line 283) | def memory_info_ex(self):
    method memory_maps (line 286) | def memory_maps(self):
    method kill (line 304) | def kill(self):
    method wait (line 308) | def wait(self, timeout=None):
    method username (line 323) | def username(self):
    method create_time (line 329) | def create_time(self):
    method num_threads (line 341) | def num_threads(self):
    method threads (line 345) | def threads(self):
    method cpu_times (line 354) | def cpu_times(self):
    method suspend (line 365) | def suspend(self):
    method resume (line 369) | def resume(self):
    method cwd (line 373) | def cwd(self):
    method open_files (line 382) | def open_files(self):
    method connections (line 399) | def connections(self, kind='inet'):
    method nice_get (line 403) | def nice_get(self):
    method nice_set (line 407) | def nice_set(self, value):
    method ionice_get (line 413) | def ionice_get(self):
    method ionice_set (line 417) | def ionice_set(self, value, _):
    method io_counters (line 427) | def io_counters(self):
    method status (line 438) | def status(self):
    method cpu_affinity_get (line 446) | def cpu_affinity_get(self):
    method cpu_affinity_set (line 452) | def cpu_affinity_set(self, value):
    method num_handles (line 473) | def num_handles(self):
    method num_ctx_switches (line 482) | def num_ctx_switches(self):

FILE: Common/libpsutil/py2.7-glibc-2.12+/psutil/__init__.py
  class Error (line 189) | class Error(Exception):
  class NoSuchProcess (line 195) | class NoSuchProcess(Error):
    method __init__ (line 200) | def __init__(self, pid, name=None, msg=None):
    method __str__ (line 212) | def __str__(self):
  class AccessDenied (line 216) | class AccessDenied(Error):
    method __init__ (line 219) | def __init__(self, pid=None, name=None, msg=None):
    method __str__ (line 232) | def __str__(self):
  class TimeoutExpired (line 236) | class TimeoutExpired(Error):
    method __init__ (line 241) | def __init__(self, seconds, pid=None, name=None):
    method __str__ (line 252) | def __str__(self):
  function _assert_pid_not_reused (line 265) | def _assert_pid_not_reused(fun):
  class Process (line 277) | class Process(object):
    method __init__ (line 310) | def __init__(self, pid=None):
    method _init (line 313) | def _init(self, pid, _ignore_nsp=False):
    method __str__ (line 355) | def __str__(self):
    method __repr__ (line 368) | def __repr__(self):
    method __eq__ (line 371) | def __eq__(self, other):
    method __ne__ (line 378) | def __ne__(self, other):
    method __hash__ (line 381) | def __hash__(self):
    method as_dict (line 388) | def as_dict(self, attrs=None, ad_value=None):
    method parent (line 444) | def parent(self):
    method is_running (line 459) | def is_running(self):
    method pid (line 480) | def pid(self):
    method ppid (line 484) | def ppid(self):
    method name (line 502) | def name(self):
    method exe (line 524) | def exe(self):
    method cmdline (line 563) | def cmdline(self):
    method status (line 567) | def status(self):
    method username (line 571) | def username(self):
    method create_time (line 589) | def create_time(self):
    method cwd (line 598) | def cwd(self):
    method nice (line 602) | def nice(self, value=None):
    method uids (line 613) | def uids(self):
    method gids (line 619) | def gids(self):
    method terminal (line 625) | def terminal(self):
    method num_fds (line 631) | def num_fds(self):
    method io_counters (line 640) | def io_counters(self):
    method ionice (line 652) | def ionice(self, ioclass=None, value=None):
    method rlimit (line 674) | def rlimit(self, resource, limits=None):
    method cpu_affinity (line 692) | def cpu_affinity(self, cpus=None):
    method num_handles (line 705) | def num_handles(self):
    method num_ctx_switches (line 711) | def num_ctx_switches(self):
    method num_threads (line 717) | def num_threads(self):
    method threads (line 721) | def threads(self):
    method children (line 729) | def children(self, recursive=False):
    method cpu_percent (line 824) | def cpu_percent(self, interval=None):
    method cpu_times (line 893) | def cpu_times(self):
    method memory_info (line 900) | def memory_info(self):
    method memory_info_ex (line 911) | def memory_info_ex(self):
    method memory_percent (line 918) | def memory_percent(self):
    method memory_maps (line 930) | def memory_maps(self, grouped=True):
    method open_files (line 957) | def open_files(self):
    method connections (line 964) | def connections(self, kind='inet'):
    method _send_signal (line 986) | def _send_signal(self, sig):
    method send_signal (line 1002) | def send_signal(self, sig):
    method suspend (line 1017) | def suspend(self):
    method resume (line 1028) | def resume(self):
    method terminate (line 1039) | def terminate(self):
    method kill (line 1050) | def kill(self):
    method wait (line 1059) | def wait(self, timeout=None):
    method get_children (line 1080) | def get_children(self):
    method get_connections (line 1084) | def get_connections(self):
    method get_cpu_affinity (line 1089) | def get_cpu_affinity(self):
    method set_cpu_affinity (line 1093) | def set_cpu_affinity(self, cpus):
    method get_cpu_percent (line 1097) | def get_cpu_percent(self):
    method get_cpu_times (line 1101) | def get_cpu_times(self):
    method getcwd (line 1105) | def getcwd(self):
    method get_ext_memory_info (line 1109) | def get_ext_memory_info(self):
    method get_io_counters (line 1114) | def get_io_counters(self):
    method get_ionice (line 1119) | def get_ionice(self):
    method set_ionice (line 1123) | def set_ionice(self, ioclass, value=None):
    method get_memory_info (line 1127) | def get_memory_info(self):
    method get_memory_maps (line 1131) | def get_memory_maps(self):
    method get_memory_percent (line 1135) | def get_memory_percent(self):
    method get_nice (line 1139) | def get_nice(self):
    method get_num_ctx_switches (line 1143) | def get_num_ctx_switches(self):
    method get_num_fds (line 1148) | def get_num_fds(self):
    method get_num_handles (line 1153) | def get_num_handles(self):
    method get_num_threads (line 1157) | def get_num_threads(self):
    method get_open_files (line 1161) | def get_open_files(self):
    method get_rlimit (line 1166) | def get_rlimit(self):
    method set_rlimit (line 1170) | def set_rlimit(self, resource, limits):
    method get_threads (line 1174) | def get_threads(self):
    method set_nice (line 1178) | def set_nice(self, value):
  class Popen (line 1188) | class Popen(Process):
    method __init__ (line 1223) | def __init__(self, *args, **kwargs):
    method __dir__ (line 1230) | def __dir__(self):
    method __getattribute__ (line 1233) | def __getattribute__(self, name):
    method wait (line 1243) | def wait(self, timeout=None):
  function pids (line 1255) | def pids():
  function pid_exists (line 1260) | def pid_exists(pid):
  function process_iter (line 1281) | def process_iter():
  function wait_procs (line 1331) | def wait_procs(procs, timeout=None, callback=None):
  function cpu_count (line 1422) | def cpu_count(logical=True):
  function cpu_times (line 1442) | def cpu_times(percpu=False):
  function cpu_percent (line 1472) | def cpu_percent(interval=None, percpu=False):
  function cpu_times_percent (line 1557) | def cpu_times_percent(interval=None, percpu=False):
  function virtual_memory (line 1631) | def virtual_memory():
  function swap_memory (line 1691) | def swap_memory():
  function disk_usage (line 1711) | def disk_usage(path):
  function disk_partitions (line 1719) | def disk_partitions(all=False):
  function disk_io_counters (line 1731) | def disk_io_counters(perdisk=False):
  function net_io_counters (line 1765) | def net_io_counters(pernic=False):
  function net_connections (line 1795) | def net_connections(kind='inet'):
  function boot_time (line 1824) | def boot_time():
  function users (line 1833) | def users():
  function get_pid_list (line 1851) | def get_pid_list():
  function get_process_list (line 1856) | def get_process_list():
  function get_users (line 1861) | def get_users():
  function phymem_usage (line 1866) | def phymem_usage():
  function virtmem_usage (line 1875) | def virtmem_usage():
  function avail_phymem (line 1880) | def avail_phymem():
  function used_phymem (line 1885) | def used_phymem():
  function total_virtmem (line 1890) | def total_virtmem():
  function used_virtmem (line 1895) | def used_virtmem():
  function avail_virtmem (line 1900) | def avail_virtmem():
  function network_io_counters (line 1905) | def network_io_counters(pernic=False):
  function test (line 1909) | def test():
  function _replace_module (line 1973) | def _replace_module():

FILE: Common/libpsutil/py2.7-glibc-2.12+/psutil/_common.py
  function usage_percent (line 58) | def usage_percent(used, total, _round=None):
  function memoize (line 70) | def memoize(fun):
  function deprecated (line 112) | def deprecated(replacement=None):
  function deprecated_method (line 130) | def deprecated_method(replacement):
  function isfile_strict (line 148) | def isfile_strict(path):
  class pconn (line 241) | class pconn(
    method local_address (line 247) | def local_address(self):
    method remote_address (line 253) | def remote_address(self):

FILE: Common/libpsutil/py2.7-glibc-2.12+/psutil/_compat.py
  function exec_ (line 35) | def exec_(code, globs=None, locs=None):
  function callable (line 51) | def callable(obj):
  class _HashedSeq (line 72) | class _HashedSeq(list):
    method __init__ (line 75) | def __init__(self, tup, hash=hash):
    method __hash__ (line 79) | def __hash__(self):
  function _make_key (line 82) | def _make_key(args, kwds, typed,
  function lru_cache (line 100) | def lru_cache(maxsize=100, typed=False):

FILE: Common/libpsutil/py2.7-glibc-2.12+/psutil/_psbsd.py
  function virtual_memory (line 71) | def virtual_memory():
  function swap_memory (line 82) | def swap_memory():
  function cpu_times (line 89) | def cpu_times():
  function per_cpu_times (line 96) | def per_cpu_times():
  function per_cpu_times (line 112) | def per_cpu_times():
  function cpu_count_logical (line 123) | def cpu_count_logical():
  function cpu_count_physical (line 128) | def cpu_count_physical():
  function boot_time (line 150) | def boot_time():
  function disk_partitions (line 155) | def disk_partitions(all=False):
  function users (line 170) | def users():
  function net_connections (line 182) | def net_connections(kind):
  function wrap_exceptions (line 206) | def wrap_exceptions(fun):
  class Process (line 226) | class Process(object):
    method __init__ (line 231) | def __init__(self, pid):
    method name (line 236) | def name(self):
    method exe (line 240) | def exe(self):
    method cmdline (line 244) | def cmdline(self):
    method terminal (line 248) | def terminal(self):
    method ppid (line 257) | def ppid(self):
    method uids (line 261) | def uids(self):
    method gids (line 266) | def gids(self):
    method cpu_times (line 271) | def cpu_times(self):
    method memory_info (line 276) | def memory_info(self):
    method memory_info_ex (line 281) | def memory_info_ex(self):
    method create_time (line 285) | def create_time(self):
    method num_threads (line 289) | def num_threads(self):
    method num_ctx_switches (line 293) | def num_ctx_switches(self):
    method threads (line 297) | def threads(self):
    method connections (line 306) | def connections(self, kind='inet'):
    method wait (line 321) | def wait(self, timeout=None):
    method nice_get (line 331) | def nice_get(self):
    method nice_set (line 335) | def nice_set(self, value):
    method status (line 339) | def status(self):
    method io_counters (line 347) | def io_counters(self):
    method open_files (line 361) | def open_files(self):
    method cwd (line 367) | def cwd(self):
    method memory_maps (line 374) | def memory_maps(self):
    method num_fds (line 378) | def num_fds(self):
    method _not_implemented (line 383) | def _not_implemented(self):
    method cpu_affinity_get (line 392) | def cpu_affinity_get(self):
    method cpu_affinity_set (line 396) | def cpu_affinity_set(self, cpus):

FILE: Common/libpsutil/py2.7-glibc-2.12+/psutil/_pslinux.py
  function _get_cputimes_fields (line 101) | def _get_cputimes_fields():
  function virtual_memory (line 142) | def virtual_memory():
  function swap_memory (line 171) | def swap_memory():
  function cached_phymem (line 197) | def cached_phymem():
  function phymem_buffers (line 202) | def phymem_buffers():
  function cpu_times (line 208) | def cpu_times():
  function per_cpu_times (line 222) | def per_cpu_times():
  function cpu_count_logical (line 240) | def cpu_count_logical():
  function cpu_count_physical (line 269) | def cpu_count_physical():
  function users (line 282) | def users():
  function boot_time (line 300) | def boot_time():
  function pids (line 314) | def pids():
  function pid_exists (line 319) | def pid_exists(pid):
  class Connections (line 326) | class Connections:
    method __init__ (line 338) | def __init__(self):
    method get_proc_inodes (line 358) | def get_proc_inodes(self, pid):
    method get_all_inodes (line 373) | def get_all_inodes(self):
    method decode_address (line 391) | def decode_address(self, addr, family):
    method process_inet (line 438) | def process_inet(self, file, family, type_, inodes, filter_pid=None):
    method process_unix (line 469) | def process_unix(self, file, family, inodes, filter_pid=None):
    method retrieve (line 495) | def retrieve(self, kind, pid=None):
  function net_connections (line 528) | def net_connections(kind='inet'):
  function net_io_counters (line 533) | def net_io_counters():
  function disk_io_counters (line 560) | def disk_io_counters():
  function disk_partitions (line 611) | def disk_partitions(all=False):
  function wrap_exceptions (line 638) | def wrap_exceptions(fun):
  class Process (line 661) | class Process(object):
    method __init__ (line 666) | def __init__(self, pid):
    method name (line 671) | def name(self):
    method exe (line 678) | def exe(self):
    method cmdline (line 706) | def cmdline(self):
    method terminal (line 713) | def terminal(self):
    method io_counters (line 724) | def io_counters(self):
    method io_counters (line 743) | def io_counters(self):
    method cpu_times (line 748) | def cpu_times(self):
    method wait (line 759) | def wait(self, timeout=None):
    method create_time (line 769) | def create_time(self):
    method memory_info (line 784) | def memory_info(self):
    method memory_info_ex (line 791) | def memory_info_ex(self):
    method memory_maps (line 811) | def memory_maps(self):
    method memory_maps (line 869) | def memory_maps(self):
    method cwd (line 876) | def cwd(self):
    method num_ctx_switches (line 884) | def num_ctx_switches(self):
    method num_threads (line 900) | def num_threads(self):
    method threads (line 908) | def threads(self):
    method nice_get (line 938) | def nice_get(self):
    method nice_set (line 947) | def nice_set(self, value):
    method cpu_affinity_get (line 951) | def cpu_affinity_get(self):
    method cpu_affinity_set (line 955) | def cpu_affinity_set(self, cpus):
    method ionice_get (line 971) | def ionice_get(self):
    method ionice_set (line 976) | def ionice_set(self, ioclass, value):
    method rlimit (line 1000) | def rlimit(self, resource, limits=None):
    method status (line 1017) | def status(self):
    method open_files (line 1029) | def open_files(self):
    method connections (line 1061) | def connections(self, kind='inet'):
    method num_fds (line 1068) | def num_fds(self):
    method ppid (line 1072) | def ppid(self):
    method uids (line 1081) | def uids(self):
    method gids (line 1090) | def gids(self):

FILE: Common/libpsutil/py2.7-glibc-2.12+/psutil/_psosx.py
  function virtual_memory (line 74) | def virtual_memory():
  function swap_memory (line 84) | def swap_memory():
  function cpu_times (line 91) | def cpu_times():
  function per_cpu_times (line 97) | def per_cpu_times():
  function cpu_count_logical (line 107) | def cpu_count_logical():
  function cpu_count_physical (line 112) | def cpu_count_physical():
  function boot_time (line 117) | def boot_time():
  function disk_partitions (line 122) | def disk_partitions(all=False):
  function users (line 137) | def users():
  function net_connections (line 151) | def net_connections(kind='inet'):
  function wrap_exceptions (line 175) | def wrap_exceptions(fun):
  class Process (line 195) | class Process(object):
    method __init__ (line 200) | def __init__(self, pid):
    method name (line 205) | def name(self):
    method exe (line 209) | def exe(self):
    method cmdline (line 213) | def cmdline(self):
    method ppid (line 219) | def ppid(self):
    method cwd (line 223) | def cwd(self):
    method uids (line 227) | def uids(self):
    method gids (line 232) | def gids(self):
    method terminal (line 237) | def terminal(self):
    method memory_info (line 246) | def memory_info(self):
    method memory_info_ex (line 251) | def memory_info_ex(self):
    method cpu_times (line 256) | def cpu_times(self):
    method create_time (line 261) | def create_time(self):
    method num_ctx_switches (line 265) | def num_ctx_switches(self):
    method num_threads (line 269) | def num_threads(self):
    method open_files (line 273) | def open_files(self):
    method connections (line 285) | def connections(self, kind='inet'):
    method num_fds (line 300) | def num_fds(self):
    method wait (line 306) | def wait(self, timeout=None):
    method nice_get (line 316) | def nice_get(self):
    method nice_set (line 320) | def nice_set(self, value):
    method status (line 324) | def status(self):
    method threads (line 330) | def threads(self):
    method memory_maps (line 339) | def memory_maps(self):

FILE: Common/libpsutil/py2.7-glibc-2.12+/psutil/_psposix.py
  class TimeoutExpired (line 19) | class TimeoutExpired(Exception):
  function pid_exists (line 23) | def pid_exists(pid):
  function wait_pid (line 51) | def wait_pid(pid, timeout=None):
  function disk_usage (line 116) | def disk_usage(path):
  function _get_terminal_map (line 144) | def _get_terminal_map():

FILE: Common/libpsutil/py2.7-glibc-2.12+/psutil/_pssunos.py
  function virtual_memory (line 77) | def virtual_memory():
  function swap_memory (line 87) | def swap_memory():
  function pids (line 119) | def pids():
  function pid_exists (line 124) | def pid_exists(pid):
  function cpu_times (line 129) | def cpu_times():
  function per_cpu_times (line 135) | def per_cpu_times():
  function cpu_count_logical (line 141) | def cpu_count_logical():
  function cpu_count_physical (line 150) | def cpu_count_physical():
  function boot_time (line 155) | def boot_time():
  function users (line 160) | def users():
  function disk_partitions (line 179) | def disk_partitions(all=False):
  function net_connections (line 200) | def net_connections(kind, _pid=-1):
  function wrap_exceptions (line 229) | def wrap_exceptions(fun):
  class Process (line 251) | class Process(object):
    method __init__ (line 256) | def __init__(self, pid):
    method name (line 261) | def name(self):
    method exe (line 266) | def exe(self):
    method cmdline (line 274) | def cmdline(self):
    method create_time (line 278) | def create_time(self):
    method num_threads (line 282) | def num_threads(self):
    method nice_get (line 286) | def nice_get(self):
    method nice_set (line 303) | def nice_set(self, value):
    method ppid (line 313) | def ppid(self):
    method uids (line 317) | def uids(self):
    method gids (line 322) | def gids(self):
    method cpu_times (line 327) | def cpu_times(self):
    method terminal (line 332) | def terminal(self):
    method cwd (line 350) | def cwd(self):
    method memory_info (line 364) | def memory_info(self):
    method status (line 373) | def status(self):
    method threads (line 379) | def threads(self):
    method open_files (line 403) | def open_files(self):
    method _get_unix_sockets (line 426) | def _get_unix_sockets(self, pid):
    method connections (line 459) | def connections(self, kind='inet'):
    method memory_maps (line 479) | def memory_maps(self):
    method num_fds (line 512) | def num_fds(self):
    method num_ctx_switches (line 516) | def num_ctx_switches(self):
    method wait (line 520) | def wait(self, timeout=None):

FILE: Common/libpsutil/py2.7-glibc-2.12+/psutil/_pswindows.py
  function _win32_QueryDosDevice (line 69) | def _win32_QueryDosDevice(s):
  function _convert_raw_path (line 73) | def _convert_raw_path(s):
  function virtual_memory (line 87) | def virtual_memory():
  function swap_memory (line 100) | def swap_memory():
  function disk_usage (line 110) | def disk_usage(path):
  function disk_partitions (line 124) | def disk_partitions(all):
  function cpu_times (line 130) | def cpu_times():
  function per_cpu_times (line 136) | def per_cpu_times():
  function cpu_count_logical (line 146) | def cpu_count_logical():
  function cpu_count_physical (line 151) | def cpu_count_physical():
  function boot_time (line 156) | def boot_time():
  function net_connections (line 161) | def net_connections(kind, _pid=-1):
  function users (line 182) | def users():
  function wrap_exceptions (line 200) | def wrap_exceptions(fun):
  class Process (line 220) | class Process(object):
    method __init__ (line 225) | def __init__(self, pid):
    method name (line 230) | def name(self):
    method exe (line 244) | def exe(self):
    method cmdline (line 256) | def cmdline(self):
    method ppid (line 259) | def ppid(self):
    method _get_raw_meminfo (line 265) | def _get_raw_meminfo(self):
    method memory_info (line 274) | def memory_info(self):
    method memory_info_ex (line 283) | def memory_info_ex(self):
    method memory_maps (line 286) | def memory_maps(self):
    method kill (line 304) | def kill(self):
    method wait (line 308) | def wait(self, timeout=None):
    method username (line 323) | def username(self):
    method create_time (line 329) | def create_time(self):
    method num_threads (line 341) | def num_threads(self):
    method threads (line 345) | def threads(self):
    method cpu_times (line 354) | def cpu_times(self):
    method suspend (line 365) | def suspend(self):
    method resume (line 369) | def resume(self):
    method cwd (line 373) | def cwd(self):
    method open_files (line 382) | def open_files(self):
    method connections (line 399) | def connections(self, kind='inet'):
    method nice_get (line 403) | def nice_get(self):
    method nice_set (line 407) | def nice_set(self, value):
    method ionice_get (line 413) | def ionice_get(self):
    method ionice_set (line 417) | def ionice_set(self, value, _):
    method io_counters (line 427) | def io_counters(self):
    method status (line 438) | def status(self):
    method cpu_affinity_get (line 446) | def cpu_affinity_get(self):
    method cpu_affinity_set (line 452) | def cpu_affinity_set(self, value):
    method num_handles (line 473) | def num_handles(self):
    method num_ctx_switches (line 482) | def num_ctx_switches(self):

FILE: Common/waagentloader.py
  function load_waagent (line 23) | def load_waagent(path=None):

FILE: CustomScript/azure/__init__.py
  class WindowsAzureData (line 103) | class WindowsAzureData(object):
  class WindowsAzureError (line 110) | class WindowsAzureError(Exception):
    method __init__ (line 114) | def __init__(self, message):
  class WindowsAzureConflictError (line 118) | class WindowsAzureConflictError(WindowsAzureError):
    method __init__ (line 123) | def __init__(self, message):
  class WindowsAzureMissingResourceError (line 127) | class WindowsAzureMissingResourceError(WindowsAzureError):
    method __init__ (line 132) | def __init__(self, message):
  class WindowsAzureBatchOperationError (line 136) | class WindowsAzureBatchOperationError(WindowsAzureError):
    method __init__ (line 140) | def __init__(self, message, code):
  class Feed (line 145) | class Feed(object):
  class _Base64String (line 149) | class _Base64String(str):
  class HeaderDict (line 153) | class HeaderDict(dict):
    method __getitem__ (line 155) | def __getitem__(self, index):
  function _encode_base64 (line 159) | def _encode_base64(data):
  function _decode_base64_to_bytes (line 166) | def _decode_base64_to_bytes(data):
  function _decode_base64_to_text (line 172) | def _decode_base64_to_text(data):
  function _get_readable_id (line 177) | def _get_readable_id(id_name, id_prefix_to_skip):
  function _get_entry_properties_from_node (line 194) | def _get_entry_properties_from_node(entry, include_id, id_prefix_to_skip...
  function _get_entry_properties (line 219) | def _get_entry_properties(xmlstr, include_id, id_prefix_to_skip=None):
  function _get_first_child_node_value (line 230) | def _get_first_child_node_value(parent_node, node_name):
  function _get_child_nodes (line 239) | def _get_child_nodes(node, tagName):
  function _get_children_from_path (line 244) | def _get_children_from_path(node, *path):
  function _get_child_nodesNS (line 263) | def _get_child_nodesNS(node, ns, tagName):
  function _create_entry (line 268) | def _create_entry(entry_body):
  function _to_datetime (line 283) | def _to_datetime(strtime):
  function _get_serialization_name (line 306) | def _get_serialization_name(element_name):
  function _str (line 325) | def _str(value):
  function _str_or_none (line 335) | def _str_or_none(value):
  function _int_or_none (line 342) | def _int_or_none(value):
  function _bool_or_none (line 349) | def _bool_or_none(value):
  function _convert_class_to_xml (line 362) | def _convert_class_to_xml(source, xml_prefix=True):
  function _find_namespaces_from_child (line 389) | def _find_namespaces_from_child(parent, child, namespaces):
  function _find_namespaces (line 404) | def _find_namespaces(parent, child):
  function _clone_node_with_namespaces (line 413) | def _clone_node_with_namespaces(node_to_clone, original_doc):
  function _convert_response_to_feeds (line 422) | def _convert_response_to_feeds(response, convert_callback):
  function _validate_type_bytes (line 460) | def _validate_type_bytes(param_name, param):
  function _validate_not_none (line 465) | def _validate_not_none(param_name, param):
  function _fill_list_of (line 470) | def _fill_list_of(xmldoc, element_type, xml_element_name):
  function _fill_scalar_list_of (line 476) | def _fill_scalar_list_of(xmldoc, element_type, parent_xml_element_name,
  function _fill_dict (line 499) | def _fill_dict(xmldoc, element_name):
  function _fill_dict_of (line 509) | def _fill_dict_of(xmldoc, parent_xml_element_name, pair_xml_element_name,
  function _fill_instance_child (line 548) | def _fill_instance_child(xmldoc, element_name, return_type):
  function _fill_instance_element (line 563) | def _fill_instance_element(element, return_type):
  function _fill_data_minidom (line 568) | def _fill_data_minidom(xmldoc, element_name, data_member):
  function _get_node_value (line 587) | def _get_node_value(xmlelement, data_type):
  function _get_request_body_bytes_only (line 597) | def _get_request_body_bytes_only(param_name, param_value):
  function _get_request_body (line 617) | def _get_request_body(request_body):
  function _parse_enum_results_list (line 641) | def _parse_enum_results_list(response, return_type, resp_type, item_type):
  function _parse_simple_list (line 686) | def _parse_simple_list(response, type, item_type, list_name):
  function _parse_response (line 700) | def _parse_response(response, return_type):
  function _parse_service_resources_response (line 707) | def _parse_service_resources_response(response, return_type):
  function _fill_data_to_return_object (line 715) | def _fill_data_to_return_object(node, return_obj):
  function _parse_response_body_from_xml_node (line 766) | def _parse_response_body_from_xml_node(node, return_type):
  function _parse_response_body_from_xml_text (line 776) | def _parse_response_body_from_xml_text(respbody, return_type):
  function _parse_response_body_from_service_resources_xml_text (line 788) | def _parse_response_body_from_service_resources_xml_text(respbody, retur...
  class _dict_of (line 801) | class _dict_of(dict):
    method __init__ (line 806) | def __init__(self, pair_xml_element_name, key_xml_element_name,
  class _list_of (line 814) | class _list_of(list):
    method __init__ (line 819) | def __init__(self, list_type, xml_element_name=None):
  class _scalar_list_of (line 828) | class _scalar_list_of(list):
    method __init__ (line 834) | def __init__(self, list_type, xml_element_name):
  class _xml_attribute (line 839) | class _xml_attribute:
    method __init__ (line 845) | def __init__(self, xml_element_name):
  function _update_request_uri_query_local_storage (line 849) | def _update_request_uri_query_local_storage(request, use_local_storage):
  function _update_request_uri_query (line 857) | def _update_request_uri_query(request):
  function _dont_fail_on_exist (line 885) | def _dont_fail_on_exist(error):
  function _dont_fail_not_exist (line 894) | def _dont_fail_not_exist(error):
  function _general_error_handler (line 903) | def _general_error_handler(http_error):
  function _parse_response_for_dict (line 920) | def _parse_response_for_dict(response):
  function _parse_response_for_dict_prefix (line 937) | def _parse_response_for_dict_prefix(response, prefixes):
  function _parse_response_for_dict_filter (line 956) | def _parse_response_for_dict_filter(response, filter):
  function _sign_string (line 972) | def _sign_string(key, string_to_sign, key_is_base64=True):

FILE: CustomScript/azure/http/__init__.py
  class HTTPError (line 19) | class HTTPError(Exception):
    method __init__ (line 23) | def __init__(self, status, message, respheader, respbody):
  class HTTPResponse (line 32) | class HTTPResponse(object):
    method __init__ (line 43) | def __init__(self, status, message, headers, body):
  class HTTPRequest (line 50) | class HTTPRequest(object):
    method __init__ (line 66) | def __init__(self):

FILE: CustomScript/azure/http/batchclient.py
  function _new_boundary (line 43) | def _new_boundary():
  function _new_boundary (line 46) | def _new_boundary():
  class _BatchClient (line 50) | class _BatchClient(_HTTPClient):
    method __init__ (line 57) | def __init__(self, service_instance, account_key, account_name,
    method get_request_table (line 67) | def get_request_table(self, request):
    method get_request_partition_key (line 80) | def get_request_partition_key(self, request):
    method get_request_row_key (line 104) | def get_request_row_key(self, request):
    method validate_request_table (line 129) | def validate_request_table(self, request):
    method validate_request_partition_key (line 142) | def validate_request_partition_key(self, request):
    method validate_request_row_key (line 156) | def validate_request_row_key(self, request):
    method begin_batch (line 169) | def begin_batch(self):
    method insert_request_to_batch (line 185) | def insert_request_to_batch(self, request):
    method commit_batch (line 196) | def commit_batch(self):
    method commit_batch_requests (line 202) | def commit_batch_requests(self):
    method cancel_batch (line 292) | def cancel_batch(self):
    method _parse_batch_response (line 296) | def _parse_batch_response(self, body):
    method _parse_batch_response_part (line 308) | def _parse_batch_response_part(self, part):
    method _report_batch_error (line 329) | def _report_batch_error(self, response):

FILE: CustomScript/azure/http/httpclient.py
  class _HTTPClient (line 40) | class _HTTPClient(object):
    method __init__ (line 46) | def __init__(self, service_instance, cert_file=None, account_name=None,
    method should_use_httplib (line 71) | def should_use_httplib(self):
    method set_proxy (line 94) | def set_proxy(self, host, port, user, password):
    method get_uri (line 108) | def get_uri(self, request):
    method get_connection (line 115) | def get_connection(self, request):
    method send_request_headers (line 156) | def send_request_headers(self, connection, request_headers):
    method send_request_body (line 173) | def send_request_body(self, connection, request_body):
    method perform_request (line 181) | def perform_request(self, request):

FILE: CustomScript/azure/http/winhttp.py
  function unicode (line 38) | def unicode(text):
  class BSTR (line 105) | class BSTR(c_wchar_p):
    method __init__ (line 109) | def __init__(self, value):
    method __del__ (line 112) | def __del__(self):
  class VARIANT (line 116) | class VARIANT(Structure):
    class _tagData (line 124) | class _tagData(Union):
      class _tagRecord (line 126) | class _tagRecord(Structure):
    method create_empty (line 146) | def create_empty():
    method create_safearray_from_str (line 153) | def create_safearray_from_str(text):
    method create_bstr_from_str (line 167) | def create_bstr_from_str(text):
    method create_bool_false (line 174) | def create_bool_false():
    method is_safearray_of_bytes (line 180) | def is_safearray_of_bytes(self):
    method str_from_safearray (line 183) | def str_from_safearray(self):
    method __del__ (line 194) | def __del__(self):
  class GUID (line 202) | class GUID(Structure):
    method __init__ (line 211) | def __init__(self, name=None):
  class _WinHttpRequest (line 216) | class _WinHttpRequest(c_void_p):
    method open (line 265) | def open(self, method, url):
    method set_request_header (line 279) | def set_request_header(self, name, value):
    method get_all_response_headers (line 286) | def get_all_response_headers(self):
    method send (line 296) | def send(self, request=None):
    method status (line 307) | def status(self):
    method status_text (line 314) | def status_text(self):
    method response_body (line 324) | def response_body(self):
    method set_client_certificate (line 341) | def set_client_certificate(self, certificate):
    method set_tunnel (line 346) | def set_tunnel(self, host, port):
    method set_proxy_credentials (line 358) | def set_proxy_credentials(self, user, password):
    method __del__ (line 363) | def __del__(self):
  class _Response (line 368) | class _Response(object):
    method __init__ (line 373) | def __init__(self, _status, _status_text, _length, _headers, _respbody):
    method getheaders (line 380) | def getheaders(self):
    method read (line 384) | def read(self, _length):
  class _HTTPConnection (line 389) | class _HTTPConnection(object):
    method __init__ (line 393) | def __init__(self, host, cert_file=None, key_file=None, protocol='http'):
    method close (line 405) | def close(self):
    method set_tunnel (line 408) | def set_tunnel(self, host, port=None, headers=None):
    method set_proxy_credentials (line 412) | def set_proxy_credentials(self, user, password):
    method putrequest (line 416) | def putrequest(self, method, uri):
    method putheader (line 427) | def putheader(self, name, value):
    method endheaders (line 434) | def endheaders(self):
    method send (line 439) | def send(self, request_body):
    method getresponse (line 446) | def getresponse(self):

FILE: CustomScript/azure/servicebus/__init__.py
  class Queue (line 51) | class Queue(WindowsAzureData):
    method __init__ (line 56) | def __init__(self, lock_duration=None, max_size_in_megabytes=None,
  class Topic (line 79) | class Topic(WindowsAzureData):
    method __init__ (line 84) | def __init__(self, default_message_time_to_live=None,
    method max_size_in_mega_bytes (line 98) | def max_size_in_mega_bytes(self):
    method max_size_in_mega_bytes (line 105) | def max_size_in_mega_bytes(self, value):
  class Subscription (line 109) | class Subscription(WindowsAzureData):
    method __init__ (line 114) | def __init__(self, lock_duration=None, requires_session=None,
  class Rule (line 133) | class Rule(WindowsAzureData):
    method __init__ (line 138) | def __init__(self, filter_type=None, filter_expression=None,
  class Message (line 146) | class Message(WindowsAzureData):
    method __init__ (line 150) | def __init__(self, body=None, service_bus_service=None, location=None,
    method delete (line 182) | def delete(self):
    method unlock (line 199) | def unlock(self):
    method add_headers (line 216) | def add_headers(self, request):
  function _create_message (line 244) | def _create_message(response, service_instance):
  function _convert_response_to_rule (line 300) | def _convert_response_to_rule(response):
  function _convert_xml_to_rule (line 304) | def _convert_xml_to_rule(xmlstr):
  function _convert_response_to_queue (line 357) | def _convert_response_to_queue(response):
  function _parse_bool (line 361) | def _parse_bool(value):
  function _convert_xml_to_queue (line 367) | def _convert_xml_to_queue(xmlstr):
  function _convert_response_to_topic (line 462) | def _convert_response_to_topic(response):
  function _convert_xml_to_topic (line 466) | def _convert_xml_to_topic(xmlstr):
  function _convert_response_to_subscription (line 534) | def _convert_response_to_subscription(response):
  function _convert_xml_to_subscription (line 538) | def _convert_xml_to_subscription(xmlstr):
  function _convert_subscription_to_xml (line 612) | def _convert_subscription_to_xml(subscription):
  function _convert_rule_to_xml (line 675) | def _convert_rule_to_xml(rule):
  function _convert_topic_to_xml (line 718) | def _convert_topic_to_xml(topic):
  function _convert_queue_to_xml (line 769) | def _convert_queue_to_xml(queue):
  function _service_bus_error_handler (line 848) | def _service_bus_error_handler(http_error):

FILE: CustomScript/azure/servicebus/servicebusservice.py
  class ServiceBusService (line 63) | class ServiceBusService(object):
    method __init__ (line 65) | def __init__(self, service_namespace=None, account_key=None, issuer=None,
    method account_key (line 135) | def account_key(self):
    method account_key (line 139) | def account_key(self, value):
    method issuer (line 143) | def issuer(self):
    method issuer (line 147) | def issuer(self, value):
    method with_filter (line 150) | def with_filter(self, filter):
    method set_proxy (line 171) | def set_proxy(self, host, port, user=None, password=None):
    method create_queue (line 182) | def create_queue(self, queue_name, queue=None, fail_on_exist=False):
    method delete_queue (line 211) | def delete_queue(self, queue_name, fail_not_exist=False):
    method get_queue (line 238) | def get_queue(self, queue_name):
    method list_queues (line 255) | def list_queues(self):
    method create_topic (line 269) | def create_topic(self, topic_name, topic=None, fail_on_exist=False):
    method delete_topic (line 298) | def delete_topic(self, topic_name, fail_not_exist=False):
    method get_topic (line 325) | def get_topic(self, topic_name):
    method list_topics (line 342) | def list_topics(self):
    method create_rule (line 356) | def create_rule(self, topic_name, subscription_name, rule_name, rule=N...
    method delete_rule (line 391) | def delete_rule(self, topic_name, subscription_name, rule_name,
    method get_rule (line 426) | def get_rule(self, topic_name, subscription_name, rule_name):
    method list_rules (line 449) | def list_rules(self, topic_name, subscription_name):
    method create_subscription (line 470) | def create_subscription(self, topic_name, subscription_name,
    method delete_subscription (line 503) | def delete_subscription(self, topic_name, subscription_name,
    method get_subscription (line 534) | def get_subscription(self, topic_name, subscription_name):
    method list_subscriptions (line 554) | def list_subscriptions(self, topic_name):
    method send_topic_message (line 572) | def send_topic_message(self, topic_name, message=None):
    method peek_lock_subscription_message (line 596) | def peek_lock_subscription_message(self, topic_name, subscription_name,
    method unlock_subscription_message (line 631) | def unlock_subscription_message(self, topic_name, subscription_name,
    method read_delete_subscription_message (line 663) | def read_delete_subscription_message(self, topic_name, subscription_name,
    method delete_subscription_message (line 690) | def delete_subscription_message(self, topic_name, subscription_name,
    method send_queue_message (line 722) | def send_queue_message(self, queue_name, message=None):
    method peek_lock_queue_message (line 746) | def peek_lock_queue_message(self, queue_name, timeout='60'):
    method unlock_queue_message (line 773) | def unlock_queue_message(self, queue_name, sequence_number, lock_token):
    method read_delete_queue_message (line 801) | def read_delete_queue_message(self, queue_name, timeout='60'):
    method delete_queue_message (line 823) | def delete_queue_message(self, queue_name, sequence_number, lock_token):
    method receive_queue_message (line 851) | def receive_queue_message(self, queue_name, peek_lock=True, timeout=60):
    method receive_subscription_message (line 866) | def receive_subscription_message(self, topic_name, subscription_name,
    method _get_host (line 887) | def _get_host(self):
    method _perform_request (line 890) | def _perform_request(self, request):
    method _update_service_bus_header (line 898) | def _update_service_bus_header(self, request):
  class ServiceBusWrapTokenAuthentication (line 925) | class ServiceBusWrapTokenAuthentication:
    method __init__ (line 926) | def __init__(self, account_key, issuer):
    method sign_request (line 930) | def sign_request(self, request, httpclient):
    method _get_authorization (line 934) | def _get_authorization(self, request, httpclient):
    method _token_is_expired (line 939) | def _token_is_expired(self, token):
    method _get_token (line 950) | def _get_token(self, host, path, httpclient):
  class ServiceBusSASAuthentication (line 986) | class ServiceBusSASAuthentication:
    method __init__ (line 987) | def __init__(self, key_name, key_value):
    method sign_request (line 991) | def sign_request(self, request, httpclient):
    method _get_authorization (line 995) | def _get_authorization(self, request, httpclient):
    method _get_expiry (line 1008) | def _get_expiry(self):

FILE: CustomScript/azure/servicemanagement/__init__.py
  class StorageServices (line 43) | class StorageServices(WindowsAzureData):
    method __init__ (line 45) | def __init__(self):
    method __iter__ (line 48) | def __iter__(self):
    method __len__ (line 51) | def __len__(self):
    method __getitem__ (line 54) | def __getitem__(self, index):
  class StorageService (line 58) | class StorageService(WindowsAzureData):
    method __init__ (line 60) | def __init__(self):
  class StorageAccountProperties (line 70) | class StorageAccountProperties(WindowsAzureData):
    method __init__ (line 72) | def __init__(self):
  class StorageServiceKeys (line 88) | class StorageServiceKeys(WindowsAzureData):
    method __init__ (line 90) | def __init__(self):
  class Locations (line 95) | class Locations(WindowsAzureData):
    method __init__ (line 97) | def __init__(self):
    method __iter__ (line 100) | def __iter__(self):
    method __len__ (line 103) | def __len__(self):
    method __getitem__ (line 106) | def __getitem__(self, index):
  class Location (line 110) | class Location(WindowsAzureData):
    method __init__ (line 112) | def __init__(self):
  class AffinityGroup (line 118) | class AffinityGroup(WindowsAzureData):
    method __init__ (line 120) | def __init__(self):
  class AffinityGroups (line 130) | class AffinityGroups(WindowsAzureData):
    method __init__ (line 132) | def __init__(self):
    method __iter__ (line 135) | def __iter__(self):
    method __len__ (line 138) | def __len__(self):
    method __getitem__ (line 141) | def __getitem__(self, index):
  class HostedServices (line 145) | class HostedServices(WindowsAzureData):
    method __init__ (line 147) | def __init__(self):
    method __iter__ (line 150) | def __iter__(self):
    method __len__ (line 153) | def __len__(self):
    method __getitem__ (line 156) | def __getitem__(self, index):
  class HostedService (line 160) | class HostedService(WindowsAzureData):
    method __init__ (line 162) | def __init__(self):
  class HostedServiceProperties (line 169) | class HostedServiceProperties(WindowsAzureData):
    method __init__ (line 171) | def __init__(self):
  class VirtualNetworkSites (line 183) | class VirtualNetworkSites(WindowsAzureData):
    method __init__ (line 185) | def __init__(self):
    method __iter__ (line 188) | def __iter__(self):
    method __len__ (line 191) | def __len__(self):
    method __getitem__ (line 194) | def __getitem__(self, index):
  class VirtualNetworkSite (line 198) | class VirtualNetworkSite(WindowsAzureData):
    method __init__ (line 200) | def __init__(self):
  class Subnets (line 207) | class Subnets(WindowsAzureData):
    method __init__ (line 209) | def __init__(self):
    method __iter__ (line 212) | def __iter__(self):
    method __len__ (line 215) | def __len__(self):
    method __getitem__ (line 218) | def __getitem__(self, index):
  class Subnet (line 222) | class Subnet(WindowsAzureData):
    method __init__ (line 224) | def __init__(self):
  class Deployments (line 230) | class Deployments(WindowsAzureData):
    method __init__ (line 232) | def __init__(self):
    method __iter__ (line 235) | def __iter__(self):
    method __len__ (line 238) | def __len__(self):
    method __getitem__ (line 241) | def __getitem__(self, index):
  class Deployment (line 245) | class Deployment(WindowsAzureData):
    method __init__ (line 247) | def __init__(self):
  class RoleInstanceList (line 271) | class RoleInstanceList(WindowsAzureData):
    method __init__ (line 273) | def __init__(self):
    method __iter__ (line 276) | def __iter__(self):
    method __len__ (line 279) | def __len__(self):
    method __getitem__ (line 282) | def __getitem__(self, index):
  class RoleInstance (line 286) | class RoleInstance(WindowsAzureData):
    method __init__ (line 288) | def __init__(self):
  class InstanceEndpoints (line 304) | class InstanceEndpoints(WindowsAzureData):
    method __init__ (line 306) | def __init__(self):
    method __iter__ (line 309) | def __iter__(self):
    method __len__ (line 312) | def __len__(self):
    method __getitem__ (line 315) | def __getitem__(self, index):
  class InstanceEndpoint (line 319) | class InstanceEndpoint(WindowsAzureData):
    method __init__ (line 321) | def __init__(self):
  class UpgradeStatus (line 329) | class UpgradeStatus(WindowsAzureData):
    method __init__ (line 331) | def __init__(self):
  class InputEndpoints (line 337) | class InputEndpoints(WindowsAzureData):
    method __init__ (line 339) | def __init__(self):
    method __iter__ (line 342) | def __iter__(self):
    method __len__ (line 345) | def __len__(self):
    method __getitem__ (line 348) | def __getitem__(self, index):
  class InputEndpoint (line 352) | class InputEndpoint(WindowsAzureData):
    method __init__ (line 354) | def __init__(self):
  class RoleList (line 360) | class RoleList(WindowsAzureData):
    method __init__ (line 362) | def __init__(self):
    method __iter__ (line 365) | def __iter__(self):
    method __len__ (line 368) | def __len__(self):
    method __getitem__ (line 371) | def __getitem__(self, index):
  class Role (line 375) | class Role(WindowsAzureData):
    method __init__ (line 377) | def __init__(self):
  class PersistentVMDowntimeInfo (line 389) | class PersistentVMDowntimeInfo(WindowsAzureData):
    method __init__ (line 391) | def __init__(self):
  class Certificates (line 397) | class Certificates(WindowsAzureData):
    method __init__ (line 399) | def __init__(self):
    method __iter__ (line 402) | def __iter__(self):
    method __len__ (line 405) | def __len__(self):
    method __getitem__ (line 408) | def __getitem__(self, index):
  class Certificate (line 412) | class Certificate(WindowsAzureData):
    method __init__ (line 414) | def __init__(self):
  class OperationError (line 421) | class OperationError(WindowsAzureData):
    method __init__ (line 423) | def __init__(self):
  class Operation (line 428) | class Operation(WindowsAzureData):
    method __init__ (line 430) | def __init__(self):
  class OperatingSystem (line 437) | class OperatingSystem(WindowsAzureData):
    method __init__ (line 439) | def __init__(self):
  class OperatingSystems (line 448) | class OperatingSystems(WindowsAzureData):
    method __init__ (line 450) | def __init__(self):
    method __iter__ (line 453) | def __iter__(self):
    method __len__ (line 456) | def __len__(self):
    method __getitem__ (line 459) | def __getitem__(self, index):
  class OperatingSystemFamily (line 463) | class OperatingSystemFamily(WindowsAzureData):
    method __init__ (line 465) | def __init__(self):
  class OperatingSystemFamilies (line 471) | class OperatingSystemFamilies(WindowsAzureData):
    method __init__ (line 473) | def __init__(self):
    method __iter__ (line 476) | def __iter__(self):
    method __len__ (line 479) | def __len__(self):
    method __getitem__ (line 482) | def __getitem__(self, index):
  class Subscription (line 486) | class Subscription(WindowsAzureData):
    method __init__ (line 488) | def __init__(self):
  class AvailabilityResponse (line 505) | class AvailabilityResponse(WindowsAzureData):
    method __init__ (line 507) | def __init__(self):
  class SubscriptionCertificates (line 511) | class SubscriptionCertificates(WindowsAzureData):
    method __init__ (line 513) | def __init__(self):
    method __iter__ (line 516) | def __iter__(self):
    method __len__ (line 519) | def __len__(self):
    method __getitem__ (line 522) | def __getitem__(self, index):
  class SubscriptionCertificate (line 526) | class SubscriptionCertificate(WindowsAzureData):
    method __init__ (line 528) | def __init__(self):
  class Images (line 535) | class Images(WindowsAzureData):
    method __init__ (line 537) | def __init__(self):
    method __iter__ (line 540) | def __iter__(self):
    method __len__ (line 543) | def __len__(self):
    method __getitem__ (line 546) | def __getitem__(self, index):
  class OSImage (line 550) | class OSImage(WindowsAzureData):
    method __init__ (line 552) | def __init__(self):
  class Disks (line 565) | class Disks(WindowsAzureData):
    method __init__ (line 567) | def __init__(self):
    method __iter__ (line 570) | def __iter__(self):
    method __len__ (line 573) | def __len__(self):
    method __getitem__ (line 576) | def __getitem__(self, index):
  class Disk (line 580) | class Disk(WindowsAzureData):
    method __init__ (line 582) | def __init__(self):
  class AttachedTo (line 596) | class AttachedTo(WindowsAzureData):
    method __init__ (line 598) | def __init__(self):
  class PersistentVMRole (line 604) | class PersistentVMRole(WindowsAzureData):
    method __init__ (line 606) | def __init__(self):
  class ConfigurationSets (line 618) | class ConfigurationSets(WindowsAzureData):
    method __init__ (line 620) | def __init__(self):
    method __iter__ (line 623) | def __iter__(self):
    method __len__ (line 626) | def __len__(self):
    method __getitem__ (line 629) | def __getitem__(self, index):
  class ConfigurationSet (line 633) | class ConfigurationSet(WindowsAzureData):
    method __init__ (line 635) | def __init__(self):
  class ConfigurationSetInputEndpoints (line 642) | class ConfigurationSetInputEndpoints(WindowsAzureData):
    method __init__ (line 644) | def __init__(self):
    method __iter__ (line 648) | def __iter__(self):
    method __len__ (line 651) | def __len__(self):
    method __getitem__ (line 654) | def __getitem__(self, index):
  class ConfigurationSetInputEndpoint (line 658) | class ConfigurationSetInputEndpoint(WindowsAzureData):
    method __init__ (line 680) | def __init__(self, name=u'', protocol=u'', port=u'', local_port=u'',
  class WindowsConfigurationSet (line 692) | class WindowsConfigurationSet(WindowsAzureData):
    method __init__ (line 694) | def __init__(self, computer_name=None, admin_password=None,
  class DomainJoin (line 710) | class DomainJoin(WindowsAzureData):
    method __init__ (line 712) | def __init__(self):
  class Credentials (line 718) | class Credentials(WindowsAzureData):
    method __init__ (line 720) | def __init__(self):
  class StoredCertificateSettings (line 726) | class StoredCertificateSettings(WindowsAzureData):
    method __init__ (line 728) | def __init__(self):
    method __iter__ (line 731) | def __iter__(self):
    method __len__ (line 734) | def __len__(self):
    method __getitem__ (line 737) | def __getitem__(self, index):
  class CertificateSetting (line 741) | class CertificateSetting(WindowsAzureData):
    method __init__ (line 757) | def __init__(self, thumbprint=u'', store_name=u'', store_location=u''):
  class WinRM (line 763) | class WinRM(WindowsAzureData):
    method __init__ (line 770) | def __init__(self):
  class Listeners (line 774) | class Listeners(WindowsAzureData):
    method __init__ (line 776) | def __init__(self):
    method __iter__ (line 779) | def __iter__(self):
    method __len__ (line 782) | def __len__(self):
    method __getitem__ (line 785) | def __getitem__(self, index):
  class Listener (line 789) | class Listener(WindowsAzureData):
    method __init__ (line 803) | def __init__(self, protocol=u'', certificate_thumbprint=u''):
  class LinuxConfigurationSet (line 808) | class LinuxConfigurationSet(WindowsAzureData):
    method __init__ (line 810) | def __init__(self, host_name=None, user_name=None, user_password=None,
  class SSH (line 821) | class SSH(WindowsAzureData):
    method __init__ (line 823) | def __init__(self):
  class PublicKeys (line 828) | class PublicKeys(WindowsAzureData):
    method __init__ (line 830) | def __init__(self):
    method __iter__ (line 833) | def __iter__(self):
    method __len__ (line 836) | def __len__(self):
    method __getitem__ (line 839) | def __getitem__(self, index):
  class PublicKey (line 843) | class PublicKey(WindowsAzureData):
    method __init__ (line 845) | def __init__(self, fingerprint=u'', path=u''):
  class KeyPairs (line 850) | class KeyPairs(WindowsAzureData):
    method __init__ (line 852) | def __init__(self):
    method __iter__ (line 855) | def __iter__(self):
    method __len__ (line 858) | def __len__(self):
    method __getitem__ (line 861) | def __getitem__(self, index):
  class KeyPair (line 865) | class KeyPair(WindowsAzureData):
    method __init__ (line 867) | def __init__(self, fingerprint=u'', path=u''):
  class LoadBalancerProbe (line 872) | class LoadBalancerProbe(WindowsAzureData):
    method __init__ (line 874) | def __init__(self):
  class DataVirtualHardDisks (line 880) | class DataVirtualHardDisks(WindowsAzureData):
    method __init__ (line 882) | def __init__(self):
    method __iter__ (line 885) | def __iter__(self):
    method __len__ (line 888) | def __len__(self):
    method __getitem__ (line 891) | def __getitem__(self, index):
  class DataVirtualHardDisk (line 895) | class DataVirtualHardDisk(WindowsAzureData):
    method __init__ (line 897) | def __init__(self):
  class OSVirtualHardDisk (line 906) | class OSVirtualHardDisk(WindowsAzureData):
    method __init__ (line 908) | def __init__(self, source_image_name=None, media_link=None,
  class AsynchronousOperationResult (line 918) | class AsynchronousOperationResult(WindowsAzureData):
    method __init__ (line 920) | def __init__(self, request_id=None):
  class ServiceBusRegion (line 924) | class ServiceBusRegion(WindowsAzureData):
    method __init__ (line 926) | def __init__(self):
  class ServiceBusNamespace (line 931) | class ServiceBusNamespace(WindowsAzureData):
    method __init__ (line 933) | def __init__(self):
  class WebSpaces (line 946) | class WebSpaces(WindowsAzureData):
    method __init__ (line 948) | def __init__(self):
    method __iter__ (line 951) | def __iter__(self):
    method __len__ (line 954) | def __len__(self):
    method __getitem__ (line 957) | def __getitem__(self, index):
  class WebSpace (line 961) | class WebSpace(WindowsAzureData):
    method __init__ (line 963) | def __init__(self):
  class Sites (line 973) | class Sites(WindowsAzureData):
    method __init__ (line 975) | def __init__(self):
    method __iter__ (line 978) | def __iter__(self):
    method __len__ (line 981) | def __len__(self):
    method __getitem__ (line 984) | def __getitem__(self, index):
  class Site (line 988) | class Site(WindowsAzureData):
    method __init__ (line 990) | def __init__(self):
  class HostNameSslStates (line 1010) | class HostNameSslStates(WindowsAzureData):
    method __init__ (line 1012) | def __init__(self):
    method __iter__ (line 1015) | def __iter__(self):
    method __len__ (line 1018) | def __len__(self):
    method __getitem__ (line 1021) | def __getitem__(self, index):
  class HostNameSslState (line 1025) | class HostNameSslState(WindowsAzureData):
    method __init__ (line 1027) | def __init__(self):
  class PublishData (line 1032) | class PublishData(WindowsAzureData):
    method __init__ (line 1035) | def __init__(self):
  class PublishProfile (line 1038) | class PublishProfile(WindowsAzureData):
    method __init__ (line 1040) | def __init__(self):
  class QueueDescription (line 1053) | class QueueDescription(WindowsAzureData):
    method __init__ (line 1055) | def __init__(self):
  class TopicDescription (line 1078) | class TopicDescription(WindowsAzureData):
    method __init__ (line 1080) | def __init__(self):
  class CountDetails (line 1098) | class CountDetails(WindowsAzureData):
    method __init__ (line 1100) | def __init__(self):
  class NotificationHubDescription (line 1107) | class NotificationHubDescription(WindowsAzureData):
    method __init__ (line 1109) | def __init__(self):
  class AuthorizationRules (line 1113) | class AuthorizationRules(WindowsAzureData):
    method __init__ (line 1115) | def __init__(self):
    method __iter__ (line 1118) | def __iter__(self):
    method __len__ (line 1121) | def __len__(self):
    method __getitem__ (line 1124) | def __getitem__(self, index):
  class AuthorizationRule (line 1127) | class AuthorizationRule(WindowsAzureData):
    method __init__ (line 1129) | def __init__(self):
  class RelayDescription (line 1139) | class RelayDescription(WindowsAzureData):
    method __init__ (line 1141) | def __init__(self):
  class MetricResponses (line 1149) | class MetricResponses(WindowsAzureData):
    method __init__ (line 1151) | def __init__(self):
    method __iter__ (line 1154) | def __iter__(self):
    method __len__ (line 1157) | def __len__(self):
    method __getitem__ (line 1160) | def __getitem__(self, index):
  class MetricResponse (line 1164) | class MetricResponse(WindowsAzureData):
    method __init__ (line 1166) | def __init__(self):
  class Data (line 1172) | class Data(WindowsAzureData):
    method __init__ (line 1174) | def __init__(self):
  class Values (line 1185) | class Values(WindowsAzureData):
    method __init__ (line 1187) | def __init__(self):
    method __iter__ (line 1190) | def __iter__(self):
    method __len__ (line 1193) | def __len__(self):
    method __getitem__ (line 1196) | def __getitem__(self, index):
  class MetricSample (line 1200) | class MetricSample(WindowsAzureData):
    method __init__ (line 1202) | def __init__(self):
  class MetricDefinitions (line 1208) | class MetricDefinitions(WindowsAzureData):
    method __init__ (line 1210) | def __init__(self):
    method __iter__ (line 1213) | def __iter__(self):
    method __len__ (line 1216) | def __len__(self):
    method __getitem__ (line 1219) | def __getitem__(self, index):
  class MetricDefinition (line 1223) | class MetricDefinition(WindowsAzureData):
    method __init__ (line 1225) | def __init__(self):
  class MetricAvailabilities (line 1233) | class MetricAvailabilities(WindowsAzureData):
    method __init__ (line 1235) | def __init__(self):
    method __iter__ (line 1238) | def __iter__(self):
    method __len__ (line 1241) | def __len__(self):
    method __getitem__ (line 1244) | def __getitem__(self, index):
  class MetricAvailability (line 1248) | class MetricAvailability(WindowsAzureData):
    method __init__ (line 1250) | def __init__(self):
  class Servers (line 1255) | class Servers(WindowsAzureData):
    method __init__ (line 1257) | def __init__(self):
    method __iter__ (line 1260) | def __iter__(self):
    method __len__ (line 1263) | def __len__(self):
    method __getitem__ (line 1266) | def __getitem__(self, index):
  class Server (line 1270) | class Server(WindowsAzureData):
    method __init__ (line 1272) | def __init__(self):
  class Database (line 1280) | class Database(WindowsAzureData):
    method __init__ (line 1282) | def __init__(self):
  function _update_management_header (line 1297) | def _update_management_header(request):
  function _parse_response_for_async_op (line 1319) | def _parse_response_for_async_op(response):
  function _management_error_handler (line 1334) | def _management_error_handler(http_error):
  function _lower (line 1339) | def _lower(text):
  class _XmlSerializer (line 1343) | class _XmlSerializer(object):
    method create_storage_service_input_to_xml (line 1346) | def create_storage_service_input_to_xml(service_name, description, label,
    method update_storage_service_input_to_xml (line 1361) | def update_storage_service_input_to_xml(description, label,
    method regenerate_keys_to_xml (line 1372) | def regenerate_keys_to_xml(key_type):
    method update_hosted_service_to_xml (line 1377) | def update_hosted_service_to_xml(label, description, extended_properti...
    method create_hosted_service_to_xml (line 1384) | def create_hosted_service_to_xml(service_name, label, description,
    method create_deployment_to_xml (line 1397) | def create_deployment_to_xml(name, package_url, label, configuration,
    method swap_deployment_to_xml (line 1412) | def swap_deployment_to_xml(production, source_deployment):
    method update_deployment_status_to_xml (line 1419) | def update_deployment_status_to_xml(status):
    method change_deployment_to_xml (line 1425) | def change_deployment_to_xml(configuration, treat_warnings_as_error, m...
    method upgrade_deployment_to_xml (line 1435) | def upgrade_deployment_to_xml(mode, package_url, configuration, label,
    method rollback_upgrade_to_xml (line 1448) | def rollback_upgrade_to_xml(mode, force):
    method walk_upgrade_domain_to_xml (line 1455) | def walk_upgrade_domain_to_xml(upgrade_domain):
    method certificate_file_to_xml (line 1461) | def certificate_file_to_xml(data, certificate_format, password):
    method create_affinity_group_to_xml (line 1469) | def create_affinity_group_to_xml(name, label, description, location):
    method update_affinity_group_to_xml (line 1478) | def update_affinity_group_to_xml(label, description):
    method subscription_certificate_to_xml (line 1485) | def subscription_certificate_to_xml(public_key, thumbprint, data):
    method os_image_to_xml (line 1493) | def os_image_to_xml(label, media_link, name, os):
    method data_virtual_hard_disk_to_xml (line 1502) | def data_virtual_hard_disk_to_xml(host_caching, disk_label, disk_name,...
    method disk_to_xml (line 1516) | def disk_to_xml(has_operating_system, label, media_link, name, os):
    method restart_role_operation_to_xml (line 1526) | def restart_role_operation_to_xml():
    method shutdown_role_operation_to_xml (line 1532) | def shutdown_role_operation_to_xml(post_shutdown_action):
    method shutdown_roles_operation_to_xml (line 1539) | def shutdown_roles_operation_to_xml(role_names, post_shutdown_action):
    method start_role_operation_to_xml (line 1551) | def start_role_operation_to_xml():
    method start_roles_operation_to_xml (line 1557) | def start_roles_operation_to_xml(role_names):
    method windows_configuration_to_xml (line 1567) | def windows_configuration_to_xml(configuration):
    method linux_configuration_to_xml (line 1617) | def linux_configuration_to_xml(configuration):
    method network_configuration_to_xml (line 1649) | def network_configuration_to_xml(configuration):
    method role_to_xml (line 1687) | def role_to_xml(availability_set_name, data_virtual_hard_disks,
    method add_role_to_xml (line 1747) | def add_role_to_xml(role_name, system_configuration_set,
    method update_role_to_xml (line 1763) | def update_role_to_xml(role_name, os_virtual_hard_disk, role_type,
    method capture_role_to_xml (line 1778) | def capture_role_to_xml(post_capture_action, target_image_name,
    method virtual_machine_deployment_to_xml (line 1801) | def virtual_machine_deployment_to_xml(deployment_name, deployment_slot,
    method create_website_to_xml (line 1833) | def create_website_to_xml(webspace_name, website_name, geo_region, plan,
    method data_to_xml (line 1853) | def data_to_xml(data):
    method doc_from_xml (line 1878) | def doc_from_xml(document_element_name, inner_xml):
    method doc_from_data (line 1889) | def doc_from_data(document_element_name, data, extended_properties=None):
    method extended_properties_dict_to_xml_fragment (line 1897) | def extended_properties_dict_to_xml_fragment(extended_properties):
  function _parse_bool (line 1914) | def _parse_bool(value):
  class _ServiceBusManagementXmlSerializer (line 1920) | class _ServiceBusManagementXmlSerializer(object):
    method namespace_to_xml (line 1923) | def namespace_to_xml(region):
    method xml_to_namespace (line 1944) | def xml_to_namespace(xmlstr):
    method xml_to_region (line 2000) | def xml_to_region(xmlstr):
    method xml_to_namespace_availability (line 2033) | def xml_to_namespace_availability(xmlstr):

FILE: CustomScript/azure/servicemanagement/servicebusmanagementservice.py
  class ServiceBusManagementService (line 33) | class ServiceBusManagementService(_ServiceManagementClient):
    method __init__ (line 35) | def __init__(self, subscription_id=None, cert_file=None,
    method get_regions (line 41) | def get_regions(self):
    method list_namespaces (line 53) | def list_namespaces(self):
    method get_namespace (line 65) | def get_namespace(self, name):
    method create_namespace (line 78) | def create_namespace(self, name, region):
    method delete_namespace (line 91) | def delete_namespace(self, name):
    method check_namespace_availability (line 103) | def check_namespace_availability(self, name):
    method list_queues (line 119) | def list_queues(self, name):
    method list_topics (line 133) | def list_topics(self, name):
    method list_notification_hubs (line 145) | def list_notification_hubs(self, name):
    method list_relays (line 157) | def list_relays(self, name):
    method _get_list_queues_path (line 170) | def _get_list_queues_path(self, namespace_name):
    method _get_list_topics_path (line 174) | def _get_list_topics_path(self, namespace_name):
    method _get_list_notification_hubs_path (line 178) | def _get_list_notification_hubs_path(self, namespace_name):
    method _get_list_relays_path (line 182) | def _get_list_relays_path(self, namespace_name):

FILE: CustomScript/azure/servicemanagement/servicemanagementclient.py
  class _ServiceManagementClient (line 39) | class _ServiceManagementClient(object):
    method __init__ (line 41) | def __init__(self, subscription_id=None, cert_file=None,
    method with_filter (line 65) | def with_filter(self, filter):
    method set_proxy (line 81) | def set_proxy(self, host, port, user=None, password=None):
    method _perform_request (line 93) | def _perform_request(self, request):
    method _perform_get (line 101) | def _perform_get(self, path, response_type):
    method _perform_put (line 115) | def _perform_put(self, path, body, async=False):
    method _perform_post (line 130) | def _perform_post(self, path, body, response_type=None, async=False):
    method _perform_delete (line 148) | def _perform_delete(self, path, async=False):
    method _get_path (line 162) | def _get_path(self, resource, name):

FILE: CustomScript/azure/servicemanagement/servicemanagementservice.py
  class ServiceManagementService (line 52) | class ServiceManagementService(_ServiceManagementClient):
    method __init__ (line 54) | def __init__(self, subscription_id=None, cert_file=None,
    method list_storage_accounts (line 60) | def list_storage_accounts(self):
    method get_storage_account_properties (line 67) | def get_storage_account_properties(self, service_name):
    method get_storage_account_keys (line 77) | def get_storage_account_keys(self, service_name):
    method regenerate_storage_account_keys (line 89) | def regenerate_storage_account_keys(self, service_name, key_type):
    method create_storage_account (line 108) | def create_storage_account(self, service_name, description, label,
    method update_storage_account (line 169) | def update_storage_account(self, service_name, description=None,
    method delete_storage_account (line 208) | def delete_storage_account(self, service_name):
    method check_storage_account_name_availability (line 218) | def check_storage_account_name_availability(self, service_name):
    method list_hosted_services (line 233) | def list_hosted_services(self):
    method get_hosted_service_properties (line 240) | def get_hosted_service_properties(self, service_name, embed_detail=Fal...
    method create_hosted_service (line 261) | def create_hosted_service(self, service_name, label, description=None,
    method update_hosted_service (line 312) | def update_hosted_service(self, service_name, label=None, description=...
    method delete_hosted_service (line 344) | def delete_hosted_service(self, service_name):
    method get_deployment_by_slot (line 353) | def get_deployment_by_slot(self, service_name, deployment_slot):
    method get_deployment_by_name (line 370) | def get_deployment_by_name(self, service_name, deployment_name):
    method create_deployment (line 385) | def create_deployment(self, service_name, deployment_slot, name,
    method delete_deployment (line 452) | def delete_deployment(self, service_name, deployment_name):
    method swap_deployment (line 466) | def swap_deployment(self, service_name, production, source_deployment):
    method change_deployment_configuration (line 486) | def change_deployment_configuration(self, service_name, deployment_name,
    method update_deployment_status (line 527) | def update_deployment_status(self, service_name, deployment_name, stat...
    method upgrade_deployment (line 547) | def upgrade_deployment(self, service_name, deployment_name, mode,
    method walk_upgrade_domain (line 606) | def walk_upgrade_domain(self, service_name, deployment_name,
    method rollback_update_or_upgrade (line 629) | def rollback_update_or_upgrade(self, service_name, deployment_name, mode,
    method reboot_role_instance (line 660) | def reboot_role_instance(self, service_name, deployment_name,
    method reimage_role_instance (line 680) | def reimage_role_instance(self, service_name, deployment_name,
    method check_hosted_service_name_availability (line 700) | def check_hosted_service_name_availability(self, service_name):
    method list_service_certificates (line 715) | def list_service_certificates(self, service_name):
    method get_service_certificate (line 728) | def get_service_certificate(self, service_name, thumbalgorithm, thumbp...
    method add_service_certificate (line 746) | def add_service_certificate(self, service_name, data, certificate_format,
    method delete_service_certificate (line 768) | def delete_service_certificate(self, service_name, thumbalgorithm,
    method list_management_certificates (line 788) | def list_management_certificates(self):
    method get_management_certificate (line 799) | def get_management_certificate(self, thumbprint):
    method add_management_certificate (line 814) | def add_management_certificate(self, public_key, thumbprint, data):
    method delete_management_certificate (line 837) | def delete_management_certificate(self, thumbprint):
    method list_affinity_groups (line 854) | def list_affinity_groups(self):
    method get_affinity_group_properties (line 862) | def get_affinity_group_properties(self, affinity_group_name):
    method create_affinity_group (line 875) | def create_affinity_group(self, name, label, location, description=None):
    method update_affinity_group (line 900) | def update_affinity_group(self, affinity_group_name, label,
    method delete_affinity_group (line 921) | def delete_affinity_group(self, affinity_group_name):
    method list_locations (line 933) | def list_locations(self):
    method get_operation_status (line 942) | def get_operation_status(self, request_id):
    method list_operating_systems (line 956) | def list_operating_systems(self):
    method list_operating_system_families (line 965) | def list_operating_system_families(self):
    method get_subscription (line 975) | def get_subscription(self):
    method get_role (line 984) | def get_role(self, service_name, deployment_name, role_name):
    method create_virtual_machine_deployment (line 999) | def create_virtual_machine_deployment(self, service_name, deployment_n...
    method add_role (line 1081) | def add_role(self, service_name, deployment_name, role_name, system_co...
    method update_role (line 1141) | def update_role(self, service_name, deployment_name, role_name,
    method delete_role (line 1194) | def delete_role(self, service_name, deployment_name, role_name):
    method capture_role (line 1209) | def capture_role(self, service_name, deployment_name, role_name,
    method start_role (line 1246) | def start_role(self, service_name, deployment_name, role_name):
    method start_roles (line 1263) | def start_roles(self, service_name, deployment_name, role_names):
    method restart_role (line 1279) | def restart_role(self, service_name, deployment_name, role_name):
    method shutdown_role (line 1297) | def shutdown_role(self, service_name, deployment_name, role_name,
    method shutdown_roles (line 1327) | def shutdown_roles(self, service_name, deployment_name, role_names,
    method list_os_images (line 1358) | def list_os_images(self):
    method get_os_image (line 1365) | def get_os_image(self, image_name):
    method add_os_image (line 1372) | def add_os_image(self, label, media_link, name, os):
    method update_os_image (line 1400) | def update_os_image(self, image_name, label, media_link, name, os):
    method delete_os_image (line 1432) | def delete_os_image(self, image_name, delete_vhd=False):
    method get_data_disk (line 1446) | def get_data_disk(self, service_name, deployment_name, role_name, lun):
    method add_data_disk (line 1464) | def add_data_disk(self, service_name, deployment_name, role_name, lun,
    method update_data_disk (line 1523) | def update_data_disk(self, service_name, deployment_name, role_name, lun,
    method delete_data_disk (line 1586) | def delete_data_disk(self, service_name, deployment_name, role_name, l...
    method list_disks (line 1606) | def list_disks(self):
    method get_disk (line 1613) | def get_disk(self, disk_name):
    method add_disk (line 1620) | def add_disk(self, has_operating_system, label, media_link, name, os):
    method update_disk (line 1653) | def update_disk(self, disk_name, has_operating_system, label, media_link,
    method delete_disk (line 1688) | def delete_disk(self, disk_name, delete_vhd=False):
    method list_virtual_network_sites (line 1703) | def list_virtual_network_sites(self):
    method _get_virtual_network_site_path (line 1710) | def _get_virtual_network_site_path(self):
    method _get_storage_service_path (line 1713) | def _get_storage_service_path(self, service_name=None):
    method _get_hosted_service_path (line 1716) | def _get_hosted_service_path(self, service_name=None):
    method _get_deployment_path_using_slot (line 1719) | def _get_deployment_path_using_slot(self, service_name, slot=None):
    method _get_deployment_path_using_name (line 1723) | def _get_deployment_path_using_name(self, service_name,
    method _get_role_path (line 1728) | def _get_role_path(self, service_name, deployment_name, role_name=None):
    method _get_role_instance_operations_path (line 1733) | def _get_role_instance_operations_path(self, service_name, deployment_...
    method _get_roles_operations_path (line 1739) | def _get_roles_operations_path(self, service_name, deployment_name):
    method _get_data_disk_path (line 1744) | def _get_data_disk_path(self, service_name, deployment_name, role_name,
    method _get_disk_path (line 1750) | def _get_disk_path(self, disk_name=None):
    method _get_image_path (line 1753) | def _get_image_path(self, image_name=None):

FILE: CustomScript/azure/servicemanagement/sqldatabasemanagementservice.py
  class SqlDatabaseManagementService (line 27) | class SqlDatabaseManagementService(_ServiceManagementClient):
    method __init__ (line 33) | def __init__(self, subscription_id=None, cert_file=None,
    method list_servers (line 39) | def list_servers(self):
    method list_databases (line 47) | def list_databases(self, name):
    method _get_list_servers_path (line 57) | def _get_list_servers_path(self):
    method _get_list_databases_path (line 60) | def _get_list_databases_path(self, name):

FILE: CustomScript/azure/servicemanagement/websitemanagementservice.py
  class WebsiteManagementService (line 33) | class WebsiteManagementService(_ServiceManagementClient):
    method __init__ (line 39) | def __init__(self, subscription_id=None, cert_file=None,
    method list_webspaces (line 45) | def list_webspaces(self):
    method get_webspace (line 52) | def get_webspace(self, webspace_name):
    method list_sites (line 61) | def list_sites(self, webspace_name):
    method get_site (line 70) | def get_site(self, webspace_name, website_name):
    method create_site (line 81) | def create_site(self, webspace_name, website_name, geo_region, host_na...
    method delete_site (line 118) | def delete_site(self, webspace_name, website_name,
    method restart_site (line 142) | def restart_site(self, webspace_name, website_name):
    method get_historical_usage_metrics (line 153) | def get_historical_usage_metrics(self, webspace_name, website_name,
    method get_metric_definitions (line 176) | def get_metric_definitions(self, webspace_name, website_name):
    method get_publish_profile_xml (line 186) | def get_publish_profile_xml(self, webspace_name, website_name):
    method get_publish_profile (line 196) | def get_publish_profile(self, webspace_name, website_name):
    method _get_list_webspaces_path (line 207) | def _get_list_webspaces_path(self):
    method _get_webspace_details_path (line 210) | def _get_webspace_details_path(self, webspace_name):
    method _get_sites_path (line 213) | def _get_sites_path(self, webspace_name):
    method _get_sites_details_path (line 217) | def _get_sites_details_path(self, webspace_name, website_name):
    method _get_restart_path (line 221) | def _get_restart_path(self, webspace_name, website_name):
    method _get_historical_usage_metrics_path (line 225) | def _get_historical_usage_metrics_path(self, webspace_name, website_na...
    method _get_metric_definitions_path (line 229) | def _get_metric_definitions_path(self, webspace_name, website_name):
    method _get_publishxml_path (line 233) | def _get_publishxml_path(self, webspace_name, website_name):

FILE: CustomScript/azure/storage/__init__.py
  class EnumResultsBase (line 46) | class EnumResultsBase(object):
    method __init__ (line 50) | def __init__(self):
  class ContainerEnumResults (line 57) | class ContainerEnumResults(EnumResultsBase):
    method __init__ (line 61) | def __init__(self):
    method __iter__ (line 65) | def __iter__(self):
    method __len__ (line 68) | def __len__(self):
    method __getitem__ (line 71) | def __getitem__(self, index):
  class Container (line 75) | class Container(WindowsAzureData):
    method __init__ (line 79) | def __init__(self):
  class Properties (line 86) | class Properties(WindowsAzureData):
    method __init__ (line 90) | def __init__(self):
  class RetentionPolicy (line 95) | class RetentionPolicy(WindowsAzureData):
    method __init__ (line 99) | def __init__(self):
    method get_days (line 103) | def get_days(self):
    method set_days (line 107) | def set_days(self, value):
  class Logging (line 114) | class Logging(WindowsAzureData):
    method __init__ (line 118) | def __init__(self):
  class Metrics (line 126) | class Metrics(WindowsAzureData):
    method __init__ (line 130) | def __init__(self):
  class StorageServiceProperties (line 137) | class StorageServiceProperties(WindowsAzureData):
    method __init__ (line 141) | def __init__(self):
  class AccessPolicy (line 146) | class AccessPolicy(WindowsAzureData):
    method __init__ (line 150) | def __init__(self, start=u'', expiry=u'', permission='u'):
  class SignedIdentifier (line 156) | class SignedIdentifier(WindowsAzureData):
    method __init__ (line 160) | def __init__(self):
  class SignedIdentifiers (line 165) | class SignedIdentifiers(WindowsAzureData):
    method __init__ (line 169) | def __init__(self):
    method __iter__ (line 172) | def __iter__(self):
    method __len__ (line 175) | def __len__(self):
    method __getitem__ (line 178) | def __getitem__(self, index):
  class BlobEnumResults (line 182) | class BlobEnumResults(EnumResultsBase):
    method __init__ (line 186) | def __init__(self):
    method __iter__ (line 192) | def __iter__(self):
    method __len__ (line 195) | def __len__(self):
    method __getitem__ (line 198) | def __getitem__(self, index):
  class BlobResult (line 202) | class BlobResult(bytes):
    method __new__ (line 204) | def __new__(cls, blob, properties):
    method __init__ (line 207) | def __init__(self, blob, properties):
  class Blob (line 211) | class Blob(WindowsAzureData):
    method __init__ (line 215) | def __init__(self):
  class BlobProperties (line 223) | class BlobProperties(WindowsAzureData):
    method __init__ (line 227) | def __init__(self):
  class BlobPrefix (line 248) | class BlobPrefix(WindowsAzureData):
    method __init__ (line 252) | def __init__(self):
  class BlobBlock (line 256) | class BlobBlock(WindowsAzureData):
    method __init__ (line 260) | def __init__(self, id=None, size=None):
  class BlobBlockList (line 265) | class BlobBlockList(WindowsAzureData):
    method __init__ (line 269) | def __init__(self):
  class PageRange (line 274) | class PageRange(WindowsAzureData):
    method __init__ (line 278) | def __init__(self):
  class PageList (line 283) | class PageList(object):
    method __init__ (line 287) | def __init__(self):
    method __iter__ (line 290) | def __iter__(self):
    method __len__ (line 293) | def __len__(self):
    method __getitem__ (line 296) | def __getitem__(self, index):
  class QueueEnumResults (line 300) | class QueueEnumResults(EnumResultsBase):
    method __init__ (line 304) | def __init__(self):
    method __iter__ (line 308) | def __iter__(self):
    method __len__ (line 311) | def __len__(self):
    method __getitem__ (line 314) | def __getitem__(self, index):
  class Queue (line 318) | class Queue(WindowsAzureData):
    method __init__ (line 322) | def __init__(self):
  class QueueMessagesList (line 328) | class QueueMessagesList(WindowsAzureData):
    method __init__ (line 332) | def __init__(self):
    method __iter__ (line 335) | def __iter__(self):
    method __len__ (line 338) | def __len__(self):
    method __getitem__ (line 341) | def __getitem__(self, index):
  class QueueMessage (line 345) | class QueueMessage(WindowsAzureData):
    method __init__ (line 349) | def __init__(self):
  class Entity (line 359) | class Entity(WindowsAzureData):
  class EntityProperty (line 365) | class EntityProperty(WindowsAzureData):
    method __init__ (line 369) | def __init__(self, type=None, value=None):
  class Table (line 374) | class Table(WindowsAzureData):
  function _parse_blob_enum_results_list (line 380) | def _parse_blob_enum_results_list(response):
  function _update_storage_header (line 405) | def _update_storage_header(request):
  function _update_storage_blob_header (line 427) | def _update_storage_blob_header(request, account_name, account_key):
  function _update_storage_queue_header (line 443) | def _update_storage_queue_header(request, account_name, account_key):
  function _update_storage_table_header (line 448) | def _update_storage_table_header(request):
  function _sign_storage_blob_request (line 465) | def _sign_storage_blob_request(request, account_name, account_key):
  function _sign_storage_table_request (line 518) | def _sign_storage_table_request(request, account_name, account_key):
  function _to_python_bool (line 542) | def _to_python_bool(value):
  function _to_entity_int (line 548) | def _to_entity_int(data):
  function _to_entity_bool (line 556) | def _to_entity_bool(value):
  function _to_entity_datetime (line 562) | def _to_entity_datetime(value):
  function _to_entity_float (line 566) | def _to_entity_float(value):
  function _to_entity_property (line 570) | def _to_entity_property(value):
  function _to_entity_none (line 577) | def _to_entity_none(value):
  function _to_entity_str (line 581) | def _to_entity_str(value):
  function _from_entity_binary (line 589) | def _from_entity_binary(value):
  function _from_entity_int (line 593) | def _from_entity_int(value):
  function _from_entity_datetime (line 597) | def _from_entity_datetime(value):
  function _convert_entity_to_xml (line 633) | def _convert_entity_to_xml(source):
  function _convert_table_to_xml (line 704) | def _convert_table_to_xml(table_name):
  function _convert_block_list_to_xml (line 715) | def _convert_block_list_to_xml(block_id_list):
  function _create_blob_result (line 732) | def _create_blob_result(response):
  function _convert_response_to_block_list (line 737) | def _convert_response_to_block_list(response):
  function _remove_prefix (line 769) | def _remove_prefix(name):
  function _convert_response_to_entity (line 776) | def _convert_response_to_entity(response):
  function _convert_xml_to_entity (line 782) | def _convert_xml_to_entity(xmlstr):
  function _set_entity_attr (line 865) | def _set_entity_attr(entity, name, value):
  function _convert_xml_to_table (line 874) | def _convert_xml_to_table(xmlstr):
  function _storage_error_handler (line 887) | def _storage_error_handler(http_error):

FILE: CustomScript/azure/storage/blobservice.py
  class BlobService (line 65) | class BlobService(_StorageClient):
    method __init__ (line 71) | def __init__(self, account_name=None, account_key=None, protocol='https',
    method make_blob_url (line 87) | def make_blob_url(self, container_name, blob_name, account_name=None,
    method list_containers (line 117) | def list_containers(self, prefix=None, marker=None, maxresults=None,
    method create_container (line 157) | def create_container(self, container_name, x_ms_meta_name_values=None,
    method get_container_properties (line 196) | def get_container_properties(self, container_name, x_ms_lease_id=None):
    method get_container_metadata (line 220) | def get_container_metadata(self, container_name, x_ms_lease_id=None):
    method set_container_metadata (line 245) | def set_container_metadata(self, container_name,
    method get_container_acl (line 275) | def get_container_acl(self, container_name, x_ms_lease_id=None):
    method set_container_acl (line 299) | def set_container_acl(self, container_name, signed_identifiers=None,
    method delete_container (line 330) | def delete_container(self, container_name, fail_not_exist=False,
    method lease_container (line 362) | def lease_container(self, container_name, x_ms_lease_action,
    method list_blobs (line 421) | def list_blobs(self, container_name, prefix=None, marker=None,
    method set_blob_service_properties (line 489) | def set_blob_service_properties(self, storage_service_properties,
    method get_blob_service_properties (line 515) | def get_blob_service_properties(self, timeout=None):
    method get_blob_properties (line 535) | def get_blob_properties(self, container_name, blob_name,
    method set_blob_properties (line 560) | def set_blob_properties(self, container_name, blob_name,
    method put_blob (line 603) | def put_blob(self, container_name, blob_name, blob, x_ms_blob_type,
    method put_block_blob_from_path (line 695) | def put_block_blob_from_path(self, container_name, blob_name, file_path,
    method put_block_blob_from_file (line 763) | def put_block_blob_from_file(self, container_name, blob_name, stream,
    method put_block_blob_from_bytes (line 894) | def put_block_blob_from_bytes(self, container_name, blob_name, blob,
    method put_block_blob_from_text (line 1001) | def put_block_blob_from_text(self, container_name, blob_name, text,
    method put_page_blob_from_path (line 1074) | def put_page_blob_from_path(self, container_name, blob_name, file_path,
    method put_page_blob_from_file (line 1150) | def put_page_blob_from_file(self, container_name, blob_name, stream, c...
    method put_page_blob_from_bytes (line 1259) | def put_page_blob_from_bytes(self, container_name, blob_name, blob,
    method get_blob (line 1349) | def get_blob(self, container_name, blob_name, snapshot=None,
    method get_blob_to_path (line 1393) | def get_blob_to_path(self, container_name, blob_name, file_path,
    method get_blob_to_file (line 1426) | def get_blob_to_file(self, container_name, blob_name, stream,
    method get_blob_to_bytes (line 1487) | def get_blob_to_bytes(self, container_name, blob_name, snapshot=None,
    method get_blob_to_text (line 1517) | def get_blob_to_text(self, container_name, blob_name, text_encoding='u...
    method get_blob_metadata (line 1548) | def get_blob_metadata(self, container_name, blob_name, snapshot=None,
    method set_blob_metadata (line 1577) | def set_blob_metadata(self, container_name, blob_name,
    method lease_blob (line 1605) | def lease_blob(self, container_name, blob_name, x_ms_lease_action,
    method snapshot_blob (line 1663) | def snapshot_blob(self, container_name, blob_name,
    method copy_blob (line 1706) | def copy_blob(self, container_name, blob_name, x_ms_copy_source,
    method abort_copy_blob (line 1800) | def abort_copy_blob(self, container_name, blob_name, x_ms_copy_id,
    method delete_blob (line 1833) | def delete_blob(self, container_name, blob_name, snapshot=None,
    method put_block (line 1863) | def put_block(self, container_name, blob_name, block, blockid,
    method put_block_list (line 1902) | def put_block_list(self, container_name, blob_name, block_list,
    method get_block_list (line 1970) | def get_block_list(self, container_name, blob_name, snapshot=None,
    method put_page (line 2006) | def put_page(self, container_name, blob_name, page, x_ms_range,
    method get_page_ranges (line 2110) | def get_page_ranges(self, container_name, blob_name, snapshot=None,

FILE: CustomScript/azure/storage/cloudstorageaccount.py
  class CloudStorageAccount (line 20) | class CloudStorageAccount(object):
    method __init__ (line 28) | def __init__(self, account_name=None, account_key=None):
    method create_blob_service (line 32) | def create_blob_service(self):
    method create_table_service (line 35) | def create_table_service(self):
    method create_queue_service (line 38) | def create_queue_service(self):

FILE: CustomScript/azure/storage/queueservice.py
  class QueueService (line 50) | class QueueService(_StorageClient):
    method __init__ (line 56) | def __init__(self, account_name=None, account_key=None, protocol='https',
    method get_queue_service_properties (line 70) | def get_queue_service_properties(self, timeout=None):
    method list_queues (line 90) | def list_queues(self, prefix=None, marker=None, maxresults=None,
    method create_queue (line 131) | def create_queue(self, queue_name, x_ms_meta_name_values=None,
    method delete_queue (line 168) | def delete_queue(self, queue_name, fail_not_exist=False):
    method get_queue_metadata (line 196) | def get_queue_metadata(self, queue_name):
    method set_queue_metadata (line 218) | def set_queue_metadata(self, queue_name, x_ms_meta_name_values=None):
    method put_message (line 240) | def put_message(self, queue_name, message_text, visibilitytimeout=None,
    method get_messages (line 285) | def get_messages(self, queue_name, numofmessages=None,
    method peek_messages (line 321) | def peek_messages(self, queue_name, numofmessages=None):
    method delete_message (line 346) | def delete_message(self, queue_name, message_id, popreceipt):
    method clear_messages (line 371) | def clear_messages(self, queue_name):
    method update_message (line 388) | def update_message(self, queue_name, message_id, message_text, poprece...
    method set_queue_service_properties (line 436) | def set_queue_service_properties(self, storage_service_properties,

FILE: CustomScript/azure/storage/sharedaccesssignature.py
  class WebResource (line 35) | class WebResource(object):
    method __init__ (line 46) | def __init__(self, path=None, request_url=None, properties=None):
  class Permission (line 52) | class Permission(object):
    method __init__ (line 63) | def __init__(self, path=None, query_string=None):
  class SharedAccessPolicy (line 68) | class SharedAccessPolicy(object):
    method __init__ (line 72) | def __init__(self, access_policy, signed_identifier=None):
  class SharedAccessSignature (line 77) | class SharedAccessSignature(object):
    method __init__ (line 88) | def __init__(self, account_name, account_key, permission_set=None):
    method generate_signed_query_string (line 93) | def generate_signed_query_string(self, path, resource_type,
    method sign_request (line 128) | def sign_request(self, web_resource):
    method _convert_query_string (line 149) | def _convert_query_string(self, query_string):
    method _generate_signature (line 174) | def _generate_signature(self, path, shared_access_policy, version):
    method _permission_matches_request (line 206) | def _permission_matches_request(self, shared_access_signature,
    method _sign (line 226) | def _sign(self, string_to_sign):

FILE: CustomScript/azure/storage/storageclient.py
  class _StorageClient (line 37) | class _StorageClient(object):
    method __init__ (line 43) | def __init__(self, account_name=None, account_key=None, protocol='https',
    method with_filter (line 96) | def with_filter(self, filter):
    method set_proxy (line 114) | def set_proxy(self, host, port, user=None, password=None):
    method _get_host (line 125) | def _get_host(self):
    method _perform_request_worker (line 131) | def _perform_request_worker(self, request):
    method _perform_request (line 134) | def _perform_request(self, request, text_encoding='utf-8'):

FILE: CustomScript/azure/storage/tableservice.py
  class TableService (line 48) | class TableService(_StorageClient):
    method __init__ (line 54) | def __init__(self, account_name=None, account_key=None, protocol='https',
    method begin_batch (line 68) | def begin_batch(self):
    method commit_batch (line 76) | def commit_batch(self):
    method cancel_batch (line 83) | def cancel_batch(self):
    method get_table_service_properties (line 86) | def get_table_service_properties(self):
    method set_table_service_properties (line 102) | def set_table_service_properties(self, storage_service_properties):
    method query_tables (line 124) | def query_tables(self, table_name=None, top=None, next_table_name=None):
    method create_table (line 153) | def create_table(self, table, fail_on_exist=False):
    method delete_table (line 183) | def delete_table(self, table_name, fail_not_exist=False):
    method get_entity (line 208) | def get_entity(self, table_name, partition_key, row_key, select=''):
    method query_entities (line 235) | def query_entities(self, table_name, filter=None, select=None, top=None,
    method insert_entity (line 272) | def insert_entity(self, table_name, entity,
    method update_entity (line 299) | def update_entity(self, table_name, partition_key, row_key, entity,
    method merge_entity (line 340) | def merge_entity(self, table_name, partition_key, row_key, entity,
    method delete_entity (line 382) | def delete_entity(self, table_name, partition_key, row_key,
    method insert_or_replace_entity (line 416) | def insert_or_replace_entity(self, table_name, partition_key, row_key,
    method insert_or_merge_entity (line 451) | def insert_or_merge_entity(self, table_name, partition_key, row_key,
    method _perform_request_worker (line 486) | def _perform_request_worker(self, request):

FILE: CustomScript/customscript.py
  function main (line 58) | def main():
  function dummy_command (line 90) | def dummy_command(operation, status, msg):
  function parse_context (line 95) | def parse_context(operation):
  function enable (line 101) | def enable(hutil):
  function download_files_with_retry (line 112) | def download_files_with_retry(hutil, retry_count, wait):
  function check_idns_with_retry (line 145) | def check_idns_with_retry(hutil, retry_count, wait):
  function check_idns (line 177) | def check_idns():
  function download_files (line 182) | def download_files(hutil):
  function start_daemon (line 236) | def start_daemon(hutil):
  function daemon (line 262) | def daemon(hutil):
  function download_blobs (line 307) | def download_blobs(storage_account_name, storage_account_key,
  function download_blob (line 318) | def download_blob(storage_account_name, storage_account_key,
  function download_and_save_blob (line 337) | def download_and_save_blob(storage_account_name,
  function download_external_files (line 361) | def download_external_files(uris, command, hutil):
  function download_external_file (line 367) | def download_external_file(uri, command, hutil):
  function download_and_save_file (line 384) | def download_and_save_file(uri, file_path, timeout=30, buf_size=1024):
  function preprocess_files (line 393) | def preprocess_files(file_path, hutil):
  function to_process (line 408) | def to_process(file_path, extensions=['.sh', ".py"]):
  function dos2unix (line 419) | def dos2unix(file_path):
  function remove_bom (line 428) | def remove_bom(file_path):
  function get_blob_name_from_uri (line 451) | def get_blob_name_from_uri(uri, hutil):
  function get_container_name_from_uri (line 455) | def get_container_name_from_uri(uri, hutil):
  function get_host_base_from_uri (line 459) | def get_host_base_from_uri(blob_uri):
  function get_properties_from_uri (line 467) | def get_properties_from_uri(uri, hutil):
  function get_path_from_uri (line 481) | def get_path_from_uri(uriStr):
  function prepare_download_dir (line 486) | def prepare_download_dir(seqNo):
  function create_directory_if_not_exists (line 494) | def create_directory_if_not_exists(directory):
  function get_command_to_execute (line 500) | def get_command_to_execute(hutil):

FILE: CustomScript/test/MockUtil.py
  class MockUtil (line 19) | class MockUtil:
    method __init__ (line 20) | def __init__(self, test):
    method get_log_dir (line 23) | def get_log_dir(self):
    method log (line 26) | def log(self, msg):
    method error (line 29) | def error(self, msg):
    method get_seq_no (line 32) | def get_seq_no(self):
    method do_status_report (line 35) | def do_status_report(self, operation, status, status_code, message):
    method do_exit (line 38) | def do_exit(self,exit_code,operation,status,code,message):

FILE: CustomScript/test/create_test_blob.py
  function create_blob (line 6) | def create_blob(blob, txt):

FILE: CustomScript/test/test_blob_download.py
  class TestBlobDownload (line 24) | class TestBlobDownload(unittest.TestCase):
    method test_download_blob (line 25) | def test_download_blob(self):

FILE: CustomScript/test/test_file_download.py
  class TestFileDownload (line 24) | class TestFileDownload(unittest.TestCase):
    method test_download_blob (line 25) | def test_download_blob(self):
    method download_to_tmp (line 28) | def download_to_tmp(self, uri):
    method test_download_bin_file (line 37) | def test_download_bin_file(self):
    method test_download_text_file (line 41) | def test_download_text_file(self):

FILE: CustomScript/test/test_preprocess_file.py
  class TestPreprocessFile (line 28) | class TestPreprocessFile(unittest.TestCase):
    method setUpClass (line 30) | def setUpClass(cls):
    method test_bin_file (line 42) | def test_bin_file(self):
    method test_text_file (line 47) | def test_text_file(self):
    method test_bom (line 58) | def test_bom(self):
    method test_windows_line_break (line 74) | def test_windows_line_break(self):

FILE: CustomScript/test/test_uri_utils.py
  class TestUriUtils (line 23) | class TestUriUtils(unittest.TestCase):
    method test_get_path_from_uri (line 24) | def test_get_path_from_uri(self):
    method test_get_blob_name_from_uri (line 29) | def test_get_blob_name_from_uri(self):
    method test_get_container_name_from_uri (line 34) | def test_get_container_name_from_uri(self):
    method test_get_host_base_from_uri (line 39) | def test_get_host_base_from_uri(self):

FILE: DSC/azure/__init__.py
  class WindowsAzureData (line 103) | class WindowsAzureData(object):
  class WindowsAzureError (line 110) | class WindowsAzureError(Exception):
    method __init__ (line 114) | def __init__(self, message):
  class WindowsAzureConflictError (line 118) | class WindowsAzureConflictError(WindowsAzureError):
    method __init__ (line 123) | def __init__(self, message):
  class WindowsAzureMissingResourceError (line 127) | class WindowsAzureMissingResourceError(WindowsAzureError):
    method __init__ (line 132) | def __init__(self, message):
  class WindowsAzureBatchOperationError (line 136) | class WindowsAzureBatchOperationError(WindowsAzureError):
    method __init__ (line 140) | def __init__(self, message, code):
  class Feed (line 145) | class Feed(object):
  class _Base64String (line 149) | class _Base64String(str):
  class HeaderDict (line 153) | class HeaderDict(dict):
    method __getitem__ (line 155) | def __getitem__(self, index):
  function _encode_base64 (line 159) | def _encode_base64(data):
  function _decode_base64_to_bytes (line 166) | def _decode_base64_to_bytes(data):
  function _decode_base64_to_text (line 172) | def _decode_base64_to_text(data):
  function _get_readable_id (line 177) | def _get_readable_id(id_name, id_prefix_to_skip):
  function _get_entry_properties_from_node (line 194) | def _get_entry_properties_from_node(entry, include_id, id_prefix_to_skip...
  function _get_entry_properties (line 219) | def _get_entry_properties(xmlstr, include_id, id_prefix_to_skip=None):
  function _get_first_child_node_value (line 230) | def _get_first_child_node_value(parent_node, node_name):
  function _get_child_nodes (line 239) | def _get_child_nodes(node, tagName):
  function _get_children_from_path (line 244) | def _get_children_from_path(node, *path):
  function _get_child_nodesNS (line 263) | def _get_child_nodesNS(node, ns, tagName):
  function _create_entry (line 268) | def _create_entry(entry_body):
  function _to_datetime (line 283) | def _to_datetime(strtime):
  function _get_serialization_name (line 306) | def _get_serialization_name(element_name):
  function _str (line 325) | def _str(value):
  function _str_or_none (line 335) | def _str_or_none(value):
  function _int_or_none (line 342) | def _int_or_none(value):
  function _bool_or_none (line 349) | def _bool_or_none(value):
  function _convert_class_to_xml (line 362) | def _convert_class_to_xml(source, xml_prefix=True):
  function _find_namespaces_from_child (line 389) | def _find_namespaces_from_child(parent, child, namespaces):
  function _find_namespaces (line 404) | def _find_namespaces(parent, child):
  function _clone_node_with_namespaces (line 413) | def _clone_node_with_namespaces(node_to_clone, original_doc):
  function _convert_response_to_feeds (line 422) | def _convert_response_to_feeds(response, convert_callback):
  function _validate_type_bytes (line 460) | def _validate_type_bytes(param_name, param):
  function _validate_not_none (line 465) | def _validate_not_none(param_name, param):
  function _fill_list_of (line 470) | def _fill_list_of(xmldoc, element_type, xml_element_name):
  function _fill_scalar_list_of (line 476) | def _fill_scalar_list_of(xmldoc, element_type, parent_xml_element_name,
  function _fill_dict (line 499) | def _fill_dict(xmldoc, element_name):
  function _fill_dict_of (line 509) | def _fill_dict_of(xmldoc, parent_xml_element_name, pair_xml_element_name,
  function _fill_instance_child (line 548) | def _fill_instance_child(xmldoc, element_name, return_type):
  function _fill_instance_element (line 563) | def _fill_instance_element(element, return_type):
  function _fill_data_minidom (line 568) | def _fill_data_minidom(xmldoc, element_name, data_member):
  function _get_node_value (line 587) | def _get_node_value(xmlelement, data_type):
  function _get_request_body_bytes_only (line 597) | def _get_request_body_bytes_only(param_name, param_value):
  function _get_request_body (line 617) | def _get_request_body(request_body):
  function _parse_enum_results_list (line 641) | def _parse_enum_results_list(response, return_type, resp_type, item_type):
  function _parse_simple_list (line 686) | def _parse_simple_list(response, type, item_type, list_name):
  function _parse_response (line 700) | def _parse_response(response, return_type):
  function _parse_service_resources_response (line 707) | def _parse_service_resources_response(response, return_type):
  function _fill_data_to_return_object (line 715) | def _fill_data_to_return_object(node, return_obj):
  function _parse_response_body_from_xml_node (line 766) | def _parse_response_body_from_xml_node(node, return_type):
  function _parse_response_body_from_xml_text (line 776) | def _parse_response_body_from_xml_text(respbody, return_type):
  function _parse_response_body_from_service_resources_xml_text (line 788) | def _parse_response_body_from_service_resources_xml_text(respbody, retur...
  class _dict_of (line 801) | class _dict_of(dict):
    method __init__ (line 806) | def __init__(self, pair_xml_element_name, key_xml_element_name,
  class _list_of (line 814) | class _list_of(list):
    method __init__ (line 819) | def __init__(self, list_type, xml_element_name=None):
  class _scalar_list_of (line 828) | class _scalar_list_of(list):
    method __init__ (line 834) | def __init__(self, list_type, xml_element_name):
  class _xml_attribute (line 839) | class _xml_attribute:
    method __init__ (line 845) | def __init__(self, xml_element_name):
  function _update_request_uri_query_local_storage (line 849) | def _update_request_uri_query_local_storage(request, use_local_storage):
  function _update_request_uri_query (line 857) | def _update_request_uri_query(request):
  function _dont_fail_on_exist (line 885) | def _dont_fail_on_exist(error):
  function _dont_fail_not_exist (line 894) | def _dont_fail_not_exist(error):
  function _general_error_handler (line 903) | def _general_error_handler(http_error):
  function _parse_response_for_dict (line 920) | def _parse_response_for_dict(response):
  function _parse_response_for_dict_prefix (line 937) | def _parse_response_for_dict_prefix(response, prefixes):
  function _parse_response_for_dict_filter (line 956) | def _parse_response_for_dict_filter(response, filter):
  function _sign_string (line 972) | def _sign_string(key, string_to_sign, key_is_base64=True):

FILE: DSC/azure/http/__init__.py
  class HTTPError (line 19) | class HTTPError(Exception):
    method __init__ (line 23) | def __init__(self, status, message, respheader, respbody):
  class HTTPResponse (line 32) | class HTTPResponse(object):
    method __init__ (line 43) | def __init__(self, status, message, headers, body):
  class HTTPRequest (line 50) | class HTTPRequest(object):
    method __init__ (line 66) | def __init__(self):

FILE: DSC/azure/http/batchclient.py
  function _new_boundary (line 43) | def _new_boundary():
  function _new_boundary (line 46) | def _new_boundary():
  class _BatchClient (line 50) | class _BatchClient(_HTTPClient):
    method __init__ (line 57) | def __init__(self, service_instance, account_key, account_name,
    method get_request_table (line 67) | def get_request_table(self, request):
    method get_request_partition_key (line 80) | def get_request_partition_key(self, request):
    method get_request_row_key (line 104) | def get_request_row_key(self, request):
    method validate_request_table (line 129) | def validate_request_table(self, request):
    method validate_request_partition_key (line 142) | def validate_request_partition_key(self, request):
    method validate_request_row_key (line 156) | def validate_request_row_key(self, request):
    method begin_batch (line 169) | def begin_batch(self):
    method insert_request_to_batch (line 185) | def insert_request_to_batch(self, request):
    method commit_batch (line 196) | def commit_batch(self):
    method commit_batch_requests (line 202) | def commit_batch_requests(self):
    method cancel_batch (line 292) | def cancel_batch(self):
    method _parse_batch_response (line 296) | def _parse_batch_response(self, body):
    method _parse_batch_response_part (line 308) | def _parse_batch_response_part(self, part):
    method _report_batch_error (line 329) | def _report_batch_error(self, response):

FILE: DSC/azure/http/httpclient.py
  class _HTTPClient (line 40) | class _HTTPClient(object):
    method __init__ (line 46) | def __init__(self, service_instance, cert_file=None, account_name=None,
    method should_use_httplib (line 71) | def should_use_httplib(self):
    method set_proxy (line 94) | def set_proxy(self, host, port, user, password):
    method get_uri (line 108) | def get_uri(self, request):
    method get_connection (line 115) | def get_connection(self, request):
    method send_request_headers (line 156) | def send_request_headers(self, connection, request_headers):
    method send_request_body (line 173) | def send_request_body(self, connection, request_body):
    method perform_request (line 181) | def perform_request(self, request):

FILE: DSC/azure/http/winhttp.py
  function unicode (line 38) | def unicode(text):
  class BSTR (line 105) | class BSTR(c_wchar_p):
    method __init__ (line 109) | def __init__(self, value):
    method __del__ (line 112) | def __del__(self):
  class VARIANT (line 116) | class VARIANT(Structure):
    class _tagData (line 124) | class _tagData(Union):
      class _tagRecord (line 126) | class _tagRecord(Structure):
    method create_empty (line 146) | def create_empty():
    method create_safearray_from_str (line 153) | def create_safearray_from_str(text):
    method create_bstr_from_str (line 167) | def create_bstr_from_str(text):
    method create_bool_false (line 174) | def create_bool_false():
    method is_safearray_of_bytes (line 180) | def is_safearray_of_bytes(self):
    method str_from_safearray (line 183) | def str_from_safearray(self):
    method __del__ (line 194) | def __del__(self):
  class GUID (line 202) | class GUID(Structure):
    method __init__ (line 211) | def __init__(self, name=None):
  class _WinHttpRequest (line 216) | class _WinHttpRequest(c_void_p):
    method open (line 265) | def open(self, method, url):
    method set_request_header (line 279) | def set_request_header(self, name, value):
    method get_all_response_headers (line 286) | def get_all_response_headers(self):
    method send (line 296) | def send(self, request=None):
    method status (line 307) | def status(self):
    method status_text (line 314) | def status_text(self):
    method response_body (line 324) | def response_body(self):
    method set_client_certificate (line 341) | def set_client_certificate(self, certificate):
    method set_tunnel (line 346) | def set_tunnel(self, host, port):
    method set_proxy_credentials (line 358) | def set_proxy_credentials(self, user, password):
    method __del__ (line 363) | def __del__(self):
  class _Response (line 368) | class _Response(object):
    method __init__ (line 373) | def __init__(self, _status, _status_text, _length, _headers, _respbody):
    method getheaders (line 380) | def getheaders(self):
    method read (line 384) | def read(self, _length):
  class _HTTPConnection (line 389) | class _HTTPConnection(object):
    method __init__ (line 393) | def __init__(self, host, cert_file=None, key_file=None, protocol='http'):
    method close (line 405) | def close(self):
    method set_tunnel (line 408) | def set_tunnel(self, host, port=None, headers=None):
    method set_proxy_credentials (line 412) | def set_proxy_credentials(self, user, password):
    method putrequest (line 416) | def putrequest(self, method, uri):
    method putheader (line 427) | def putheader(self, name, value):
    method endheaders (line 434) | def endheaders(self):
    method send (line 439) | def send(self, request_body):
    method getresponse (line 446) | def getresponse(self):

FILE: DSC/azure/servicebus/__init__.py
  class Queue (line 51) | class Queue(WindowsAzureData):
    method __init__ (line 56) | def __init__(self, lock_duration=None, max_size_in_megabytes=None,
  class Topic (line 79) | class Topic(WindowsAzureData):
    method __init__ (line 84) | def __init__(self, default_message_time_to_live=None,
    method max_size_in_mega_bytes (line 98) | def max_size_in_mega_bytes(self):
    method max_size_in_mega_bytes (line 105) | def max_size_in_mega_bytes(self, value):
  class Subscription (line 109) | class Subscription(WindowsAzureData):
    method __init__ (line 114) | def __init__(self, lock_duration=None, requires_session=None,
  class Rule (line 133) | class Rule(WindowsAzureData):
    method __init__ (line 138) | def __init__(self, filter_type=None, filter_expression=None,
  class Message (line 146) | class Message(WindowsAzureData):
    method __init__ (line 150) | def __init__(self, body=None, service_bus_service=None, location=None,
    method delete (line 182) | def delete(self):
    method unlock (line 199) | def unlock(self):
    method add_headers (line 216) | def add_headers(self, request):
  function _create_message (line 244) | def _create_message(response, service_instance):
  function _convert_response_to_rule (line 300) | def _convert_response_to_rule(response):
  function _convert_xml_to_rule (line 304) | def _convert_xml_to_rule(xmlstr):
  function _convert_response_to_queue (line 357) | def _convert_response_to_queue(response):
  function _parse_bool (line 361) | def _parse_bool(value):
  function _convert_xml_to_queue (line 367) | def _convert_xml_to_queue(xmlstr):
  function _convert_response_to_topic (line 462) | def _convert_response_to_topic(response):
  function _convert_xml_to_topic (line 466) | def _convert_xml_to_topic(xmlstr):
  function _convert_response_to_subscription (line 534) | def _convert_response_to_subscription(response):
  function _convert_xml_to_subscription (line 538) | def _convert_xml_to_subscription(xmlstr):
  function _convert_subscription_to_xml (line 612) | def _convert_subscription_to_xml(subscription):
  function _convert_rule_to_xml (line 675) | def _convert_rule_to_xml(rule):
  function _convert_topic_to_xml (line 718) | def _convert_topic_to_xml(topic):
  function _convert_queue_to_xml (line 769) | def _convert_queue_to_xml(queue):
  function _service_bus_error_handler (line 848) | def _service_bus_error_handler(http_error):

FILE: DSC/azure/servicebus/servicebusservice.py
  class ServiceBusService (line 63) | class ServiceBusService(object):
    method __init__ (line 65) | def __init__(self, service_namespace=None, account_key=None, issuer=None,
    method account_key (line 135) | def account_key(self):
    method account_key (line 139) | def account_key(self, value):
    method issuer (line 143) | def issuer(self):
    method issuer (line 147) | def issuer(self, value):
    method with_filter (line 150) | def with_filter(self, filter):
    method set_proxy (line 171) | def set_proxy(self, host, port, user=None, password=None):
    method create_queue (line 182) | def create_queue(self, queue_name, queue=None, fail_on_exist=False):
    method delete_queue (line 211) | def delete_queue(self, queue_name, fail_not_exist=False):
    method get_queue (line 238) | def get_queue(self, queue_name):
    method list_queues (line 255) | def list_queues(self):
    method create_topic (line 269) | def create_topic(self, topic_name, topic=None, fail_on_exist=False):
    method delete_topic (line 298) | def delete_topic(self, topic_name, fail_not_exist=False):
    method get_topic (line 325) | def get_topic(self, topic_name):
    method list_topics (line 342) | def list_topics(self):
    method create_rule (line 356) | def create_rule(self, topic_name, subscription_name, rule_name, rule=N...
    method delete_rule (line 391) | def delete_rule(self, topic_name, subscription_name, rule_name,
    method get_rule (line 426) | def get_rule(self, topic_name, subscription_name, rule_name):
    method list_rules (line 449) | def list_rules(self, topic_name, subscription_name):
    method create_subscription (line 470) | def create_subscription(self, topic_name, subscription_name,
    method delete_subscription (line 503) | def delete_subscription(self, topic_name, subscription_name,
    method get_subscription (line 534) | def get_subscription(self, topic_name, subscription_name):
    method list_subscriptions (line 554) | def list_subscriptions(self, topic_name):
    method send_topic_message (line 572) | def send_topic_message(self, topic_name, message=None):
    method peek_lock_subscription_message (line 596) | def peek_lock_subscription_message(self, topic_name, subscription_name,
    method unlock_subscription_message (line 631) | def unlock_subscription_message(self, topic_name, subscription_name,
    method read_delete_subscription_message (line 663) | def read_delete_subscription_message(self, topic_name, subscription_name,
    method delete_subscription_message (line 690) | def delete_subscription_message(self, topic_name, subscription_name,
    method send_queue_message (line 722) | def send_queue_message(self, queue_name, message=None):
    method peek_lock_queue_message (line 746) | def peek_lock_queue_message(self, queue_name, timeout='60'):
    method unlock_queue_message (line 773) | def unlock_queue_message(self, queue_name, sequence_number, lock_token):
    method read_delete_queue_message (line 801) | def read_delete_queue_message(self, queue_name, timeout='60'):
    method delete_queue_message (line 823) | def delete_queue_message(self, queue_name, sequence_number, lock_token):
    method receive_queue_message (line 851) | def receive_queue_message(self, queue_name, peek_lock=True, timeout=60):
    method receive_subscription_message (line 866) | def receive_subscription_message(self, topic_name, subscription_name,
    method _get_host (line 887) | def _get_host(self):
    method _perform_request (line 890) | def _perform_request(self, request):
    method _update_service_bus_header (line 898) | def _update_service_bus_header(self, request):
  class ServiceBusWrapTokenAuthentication (line 925) | class ServiceBusWrapTokenAuthentication:
    method __init__ (line 926) | def __init__(self, account_key, issuer):
    method sign_request (line 930) | def sign_request(self, request, httpclient):
    method _get_authorization (line 934) | def _get_authorization(self, request, httpclient):
    method _token_is_expired (line 939) | def _token_is_expired(self, token):
    method _get_token (line 950) | def _get_token(self, host, path, httpclient):
  class ServiceBusSASAuthentication (line 986) | class ServiceBusSASAuthentication:
    method __init__ (line 987) | def __init__(self, key_name, key_value):
    method sign_request (line 991) | def sign_request(self, request, httpclient):
    method _get_authorization (line 995) | def _get_authorization(self, request, httpclient):
    method _get_expiry (line 1008) | def _get_expiry(self):

FILE: DSC/azure/servicemanagement/__init__.py
  class StorageServices (line 43) | class StorageServices(WindowsAzureData):
    method __init__ (line 45) | def __init__(self):
    method __iter__ (line 48) | def __iter__(self):
    method __len__ (line 51) | def __len__(self):
    method __getitem__ (line 54) | def __getitem__(self, index):
  class StorageService (line 58) | class StorageService(WindowsAzureData):
    method __init__ (line 60) | def __init__(self):
  class StorageAccountProperties (line 70) | class StorageAccountProperties(WindowsAzureData):
    method __init__ (line 72) | def __init__(self):
  class StorageServiceKeys (line 88) | class StorageServiceKeys(WindowsAzureData):
    method __init__ (line 90) | def __init__(self):
  class Locations (line 95) | class Locations(WindowsAzureData):
    method __init__ (line 97) | def __init__(self):
    method __iter__ (line 100) | def __iter__(self):
    method __len__ (line 103) | def __len__(self):
    method __getitem__ (line 106) | def __getitem__(self, index):
  class Location (line 110) | class Location(WindowsAzureData):
    method __init__ (line 112) | def __init__(self):
  class AffinityGroup (line 118) | class AffinityGroup(WindowsAzureData):
    method __init__ (line 120) | def __init__(self):
  class AffinityGroups (line 130) | class AffinityGroups(WindowsAzureData):
    method __init__ (line 132) | def __init__(self):
    method __iter__ (line 135) | def __iter__(self):
    method __len__ (line 138) | def __len__(self):
    method __getitem__ (line 141) | def __getitem__(self, index):
  class HostedServices (line 145) | class HostedServices(WindowsAzureData):
    method __init__ (line 147) | def __init__(self):
    method __iter__ (line 150) | def __iter__(self):
    method __len__ (line 153) | def __len__(self):
    method __getitem__ (line 156) | def __getitem__(self, index):
  class HostedService (line 160) | class HostedService(WindowsAzureData):
    method __init__ (line 162) | def __init__(self):
  class HostedServiceProperties (line 169) | class HostedServiceProperties(WindowsAzureData):
    method __init__ (line 171) | def __init__(self):
  class VirtualNetworkSites (line 183) | class VirtualNetworkSites(WindowsAzureData):
    method __init__ (line 185) | def __init__(self):
    method __iter__ (line 188) | def __iter__(self):
    method __len__ (line 191) | def __len__(self):
    method __getitem__ (line 194) | def __getitem__(self, index):
  class VirtualNetworkSite (line 198) | class VirtualNetworkSite(WindowsAzureData):
    method __init__ (line 200) | def __init__(self):
  class Subnets (line 207) | class Subnets(WindowsAzureData):
    method __init__ (line 209) | def __init__(self):
    method __iter__ (line 212) | def __iter__(self):
    method __len__ (line 215) | def __len__(self):
    method __getitem__ (line 218) | def __getitem__(self, index):
  class Subnet (line 222) | class Subnet(WindowsAzureData):
    method __init__ (line 224) | def __init__(self):
  class Deployments (line 230) | class Deployments(WindowsAzureData):
    method __init__ (line 232) | def __init__(self):
    method __iter__ (line 235) | def __iter__(self):
    method __len__ (line 238) | def __len__(self):
    method __getitem__ (line 241) | def __getitem__(self, index):
  class Deployment (line 245) | class Deployment(WindowsAzureData):
    method __init__ (line 247) | def __init__(self):
  class RoleInstanceList (line 271) | class RoleInstanceList(WindowsAzureData):
    method __init__ (line 273) | def __init__(self):
    method __iter__ (line 276) | def __iter__(self):
    method __len__ (line 279) | def __len__(self):
    method __getitem__ (line 282) | def __getitem__(self, index):
  class RoleInstance (line 286) | class RoleInstance(WindowsAzureData):
    method __init__ (line 288) | def __init__(self):
  class InstanceEndpoints (line 304) | class InstanceEndpoints(WindowsAzureData):
    method __init__ (line 306) | def __init__(self):
    method __iter__ (line 309) | def __iter__(self):
    method __len__ (line 312) | def __len__(self):
    method __getitem__ (line 315) | def __getitem__(self, index):
  class InstanceEndpoint (line 319) | class InstanceEndpoint(WindowsAzureData):
    method __init__ (line 321) | def __init__(self):
  class UpgradeStatus (line 329) | class UpgradeStatus(WindowsAzureData):
    method __init__ (line 331) | def __init__(self):
  class InputEndpoints (line 337) | class InputEndpoints(WindowsAzureData):
    method __init__ (line 339) | def __init__(self):
    method __iter__ (line 342) | def __iter__(self):
    method __len__ (line 345) | def __len__(self):
    method __getitem__ (line 348) | def __getitem__(self, index):
  class InputEndpoint (line 352) | class InputEndpoint(WindowsAzureData):
    method __init__ (line 354) | def __init__(self):
  class RoleList (line 360) | class RoleList(WindowsAzureData):
    method __init__ (line 362) | def __init__(self):
    method __iter__ (line 365) | def __iter__(self):
    method __len__ (line 368) | def __len__(self):
    method __getitem__ (line 371) | def __getitem__(self, index):
  class Role (line 375) | class Role(WindowsAzureData):
    method __init__ (line 377) | def __init__(self):
  class PersistentVMDowntimeInfo (line 389) | class PersistentVMDowntimeInfo(WindowsAzureData):
    method __init__ (line 391) | def __init__(self):
  class Certificates (line 397) | class Certificates(WindowsAzureData):
    method __init__ (line 399) | def __init__(self):
    method __iter__ (line 402) | def __iter__(self):
    method __len__ (line 405) | def __len__(self):
    method __getitem__ (line 408) | def __getitem__(self, index):
  class Certificate (line 412) | class Certificate(WindowsAzureData):
    method __init__ (line 414) | def __init__(self):
  class OperationError (line 421) | class OperationError(WindowsAzureData):
    method __init__ (line 423) | def __init__(self):
  class Operation (line 428) | class Operation(WindowsAzureData):
    method __init__ (line 430) | def __init__(self):
  class OperatingSystem (line 437) | class OperatingSystem(WindowsAzureData):
    method __init__ (line 439) | def __init__(self):
  class OperatingSystems (line 448) | class OperatingSystems(WindowsAzureData):
    method __init__ (line 450) | def __init__(self):
    method __iter__ (line 453) | def __iter__(self):
    method __len__ (line 456) | def __len__(self):
    method __getitem__ (line 459) | def __getitem__(self, index):
  class OperatingSystemFamily (line 463) | class OperatingSystemFamily(WindowsAzureData):
    method __init__ (line 465) | def __init__(self):
  class OperatingSystemFamilies (line 471) | class OperatingSystemFamilies(WindowsAzureData):
    method __init__ (line 473) | def __init__(self):
    method __iter__ (line 476) | def __iter__(self):
    method __len__ (line 479) | def __len__(self):
    method __getitem__ (line 482) | def __getitem__(self, index):
  class Subscription (line 486) | class Subscription(WindowsAzureData):
    method __init__ (line 488) | def __init__(self):
  class AvailabilityResponse (line 505) | class AvailabilityResponse(WindowsAzureData):
    method __init__ (line 507) | def __init__(self):
  class SubscriptionCertificates (line 511) | class SubscriptionCertificates(WindowsAzureData):
    method __init__ (line 513) | def __init__(self):
    method __iter__ (line 516) | def __iter__(self):
    method __len__ (line 519) | def __len__(self):
    method __getitem__ (line 522) | def __getitem__(self, index):
  class SubscriptionCertificate (line 526) | class SubscriptionCertificate(WindowsAzureData):
    method __init__ (line 528) | def __init__(self):
  class Images (line 535) | class Images(WindowsAzureData):
    method __init__ (line 537) | def __init__(self):
    method __iter__ (line 540) | def __iter__(self):
    method __len__ (line 543) | def __len__(self):
    method __getitem__ (line 546) | def __getitem__(self, index):
  class OSImage (line 550) | class OSImage(WindowsAzureData):
    method __init__ (line 552) | def __init__(self):
  class Disks (line 565) | class Disks(WindowsAzureData):
    method __init__ (line 567) | def __init__(self):
    method __iter__ (line 570) | def __iter__(self):
    method __len__ (line 573) | def __len__(self):
    method __getitem__ (line 576) | def __getitem__(self, index):
  class Disk (line 580) | class Disk(WindowsAzureData):
    method __init__ (line 582) | def __init__(self):
  class AttachedTo (line 596) | class AttachedTo(WindowsAzureData):
    method __init__ (line 598) | def __init__(self):
  class PersistentVMRole (line 604) | class PersistentVMRole(WindowsAzureData):
    method __init__ (line 606) | def __init__(self):
  class ConfigurationSets (line 618) | class ConfigurationSets(WindowsAzureData):
    method __init__ (line 620) | def __init__(self):
    method __iter__ (line 623) | def __iter__(self):
    method __len__ (line 626) | def __len__(self):
    method __getitem__ (line 629) | def __getitem__(self, index):
  class ConfigurationSet (line 633) | class ConfigurationSet(WindowsAzureData):
    method __init__ (line 635) | def __init__(self):
  class ConfigurationSetInputEndpoints (line 642) | class ConfigurationSetInputEndpoints(WindowsAzureData):
    method __init__ (line 644) | def __init__(self):
    method __iter__ (line 648) | def __iter__(self):
    method __len__ (line 651) | def __len__(self):
    method __getitem__ (line 654) | def __getitem__(self, index):
  class ConfigurationSetInputEndpoint (line 658) | class ConfigurationSetInputEndpoint(WindowsAzureData):
    method __init__ (line 680) | def __init__(self, name=u'', protocol=u'', port=u'', local_port=u'',
  class WindowsConfigurationSet (line 692) | class WindowsConfigurationSet(WindowsAzureData):
    method __init__ (line 694) | def __init__(self, computer_name=None, admin_password=None,
  class DomainJoin (line 710) | class DomainJoin(WindowsAzureData):
    method __init__ (line 712) | def __init__(self):
  class Credentials (line 718) | class Credentials(WindowsAzureData):
    method __init__ (line 720) | def __init__(self):
  class StoredCertificateSettings (line 726) | class StoredCertificateSettings(WindowsAzureData):
    method __init__ (line 728) | def __init__(self):
    method __iter__ (line 731) | def __iter__(self):
    method __len__ (line 734) | def __len__(self):
    method __getitem__ (line 737) | def __getitem__(self, index):
  class CertificateSetting (line 741) | class CertificateSetting(WindowsAzureData):
    method __init__ (line 757) | def __init__(self, thumbprint=u'', store_name=u'', store_location=u''):
  class WinRM (line 763) | class WinRM(WindowsAzureData):
    method __init__ (line 770) | def __init__(self):
  class Listeners (line 774) | class Listeners(WindowsAzureData):
    method __init__ (line 776) | def __init__(self):
    method __iter__ (line 779) | def __iter__(self):
    method __len__ (line 782) | def __len__(self):
    method __getitem__ (line 785) | def __getitem__(self, index):
  class Listener (line 789) | class Listener(WindowsAzureData):
    method __init__ (line 803) | def __init__(self, protocol=u'', certificate_thumbprint=u''):
  class LinuxConfigurationSet (line 808) | class LinuxConfigurationSet(WindowsAzureData):
    method __init__ (line 810) | def __init__(self, host_name=None, user_name=None, user_password=None,
  class SSH (line 821) | class SSH(WindowsAzureData):
    method __init__ (line 823) | def __init__(self):
  class PublicKeys (line 828) | class PublicKeys(WindowsAzureData):
    method __init__ (line 830) | def __init__(self):
    method __iter__ (line 833) | def __iter__(self):
    method __len__ (line 836) | def __len__(self):
    method __getitem__ (line 839) | def __getitem__(self, index):
  class PublicKey (line 843) | class PublicKey(WindowsAzureData):
    method __init__ (line 845) | def __init__(self, fingerprint=u'', path=u''):
  class KeyPairs (line 850) | class KeyPairs(WindowsAzureData):
    method __init__ (line 852) | def __init__(self):
    method __iter__ (line 855) | def __iter__(self):
    method __len__ (line 858) | def __len__(self):
    method __getitem__ (line 861) | def __getitem__(self, index):
  class KeyPair (line 865) | class KeyPair(WindowsAzureData):
    method __init__ (line 867) | def __init__(self, fingerprint=u'', path=u''):
  class LoadBalancerProbe (line 872) | class LoadBalancerProbe(WindowsAzureData):
    method __init__ (line 874) | def __init__(self):
  class DataVirtualHardDisks (line 880) | class DataVirtualHardDisks(WindowsAzureData):
    method __init__ (line 882) | def __init__(self):
    method __iter__ (line 885) | def __iter__(self):
    method __len__ (line 888) | def __len__(self):
    method __getitem__ (line 891) | def __getitem__(self, index):
  class DataVirtualHardDisk (line 895) | class DataVirtualHardDisk(WindowsAzureData):
    method __init__ (line 897) | def __init__(self):
  class OSVirtualHardDisk (line 906) | class OSVirtualHardDisk(WindowsAzureData):
    method __init__ (line 908) | def __init__(self, source_image_name=None, media_link=None,
  class AsynchronousOperationResult (line 918) | class AsynchronousOperationResult(WindowsAzureData):
    method __init__ (line 920) | def __init__(self, request_id=None):
  class ServiceBusRegion (line 924) | class ServiceBusRegion(WindowsAzureData):
    method __init__ (line 926) | def __init__(self):
  class ServiceBusNamespace (line 931) | class ServiceBusNamespace(WindowsAzureData):
    method __init__ (line 933) | def __init__(self):
  class WebSpaces (line 946) | class WebSpaces(WindowsAzureData):
    method __init__ (line 948) | def __init__(self):
    method __iter__ (line 951) | def __iter__(self):
    method __len__ (line 954) | def __len__(self):
    method __getitem__ (line 957) | def __getitem__(self, index):
  class WebSpace (line 961) | class WebSpace(WindowsAzureData):
    method __init__ (line 963) | def __init__(self):
  class Sites (line 973) | class Sites(WindowsAzureData):
    method __init__ (line 975) | def __init__(self):
    method __iter__ (line 978) | def __iter__(self):
    method __len__ (line 981) | def __len__(self):
    method __getitem__ (line 984) | def __getitem__(self, index):
  class Site (line 988) | class Site(WindowsAzureData):
    method __init__ (line 990) | def __init__(self):
  class HostNameSslStates (line 1010) | class HostNameSslStates(WindowsAzureData):
    method __init__ (line 1012) | def __init__(self):
    method __iter__ (line 1015) | def __iter__(self):
    method __len__ (line 1018) | def __len__(self):
    method __getitem__ (line 1021) | def __getitem__(self, index):
  class HostNameSslState (line 1025) | class HostNameSslState(WindowsAzureData):
    method __init__ (line 1027) | def __init__(self):
  class PublishData (line 1032) | class PublishData(WindowsAzureData):
    method __init__ (line 1035) | def __init__(self):
  
Condensed preview — 991 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (7,490K chars).
[
  {
    "path": ".gitattributes",
    "chars": 2518,
    "preview": "###############################################################################\n# Set default behavior to automatically "
  },
  {
    "path": ".gitignore",
    "chars": 1938,
    "preview": "DSC/DSC.zip\n\ncompiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*/.py[cod]\n\n# C extensions\n*.so\n\n# Distribution / p"
  },
  {
    "path": ".gitmodules",
    "chars": 355,
    "preview": "[submodule \"Common/azure-sdk-for-python\"]\n\tpath = Common/azure-sdk-for-python\n\turl = https://github.com/Azure/azure-sdk-"
  },
  {
    "path": ".vscode/launch.json",
    "chars": 644,
    "preview": "{\n    // Use IntelliSense to learn about possible attributes.\n    // Hover to view descriptions of existing attributes.\n"
  },
  {
    "path": "AzureEnhancedMonitor/README.md",
    "chars": 1292,
    "preview": "# How to enable Azure Enhanced Monitoring on Linux VM\n\nThis is an instruction about how to enable Azure Enhanced Monitor"
  },
  {
    "path": "AzureEnhancedMonitor/bin/pack.sh",
    "chars": 1855,
    "preview": "#!/bin/bash\nproj_name=\"aem\"\nproj_version=\"1.0\"\n\nproj_full_name=\"$proj_name-$proj_version\"\n\nscript=$(dirname $0)\nroot=$sc"
  },
  {
    "path": "AzureEnhancedMonitor/bin/setup.sh",
    "chars": 2729,
    "preview": "#!/bin/bash\n\ninstall_log=`pwd`/install.log\nroot=$(dirname $0)\ncd $root\nroot=`pwd`\n\nif [[ $EUID -ne 0 ]]; then\n    echo \""
  },
  {
    "path": "AzureEnhancedMonitor/clib/.gitignore",
    "chars": 6,
    "preview": "bin/*\n"
  },
  {
    "path": "AzureEnhancedMonitor/clib/Makefile",
    "chars": 943,
    "preview": "CC := gcc\nSRCDIR := src\nLIBDIR := lib\nINCDIR := include\nBUILDDIR := build\nTARGET := $(LIBDIR)/libazureperf.so\n\nSRCEXT :="
  },
  {
    "path": "AzureEnhancedMonitor/clib/include/azureperf.h",
    "chars": 4905,
    "preview": "//\n// Copyright 2014 Microsoft Corporation\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you "
  },
  {
    "path": "AzureEnhancedMonitor/clib/src/apmetric.c",
    "chars": 10707,
    "preview": "//\n// Copyright 2014 Microsoft Corporation\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you "
  },
  {
    "path": "AzureEnhancedMonitor/clib/src/azureperf.c",
    "chars": 7697,
    "preview": "//\n// Copyright 2014 Microsoft Corporation\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you "
  },
  {
    "path": "AzureEnhancedMonitor/clib/test/cases/positive_case",
    "chars": 3905,
    "preview": "2;cpu;Current Hw Frequency;;0;2194.507;MHz;60;1423450780;aem-suse11sp3;\n2;cpu;Max Hw Frequency;;0;2194.507;MHz;0;1423450"
  },
  {
    "path": "AzureEnhancedMonitor/clib/test/codegen.py",
    "chars": 3326,
    "preview": "#!/usr/bin/env python\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \""
  },
  {
    "path": "AzureEnhancedMonitor/clib/test/counter_names",
    "chars": 2220,
    "preview": "config;Cloud Provider;Cloud Provider\nconfig;CPU Over-Provisioning;CPU Over-Provisioning\nconfig;Memory Over-Provisioning;"
  },
  {
    "path": "AzureEnhancedMonitor/clib/test/runtest.c",
    "chars": 8383,
    "preview": "//\n// Copyright 2014 Microsoft Corporation\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you "
  },
  {
    "path": "AzureEnhancedMonitor/ext/.gitignore",
    "chars": 20,
    "preview": "bin/*\n.ropeproject/\n"
  },
  {
    "path": "AzureEnhancedMonitor/ext/HandlerManifest.json",
    "chars": 361,
    "preview": "[{\n  \"name\": \"AzureEnhancedMonitor\",\n  \"version\": 1.0,\n  \"handlerManifest\": {\n    \"installCommand\": \"installer.py\",\n    "
  },
  {
    "path": "AzureEnhancedMonitor/ext/aem.py",
    "chars": 58364,
    "preview": "#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may n"
  },
  {
    "path": "AzureEnhancedMonitor/ext/handler.py",
    "chars": 5807,
    "preview": "#!/usr/bin/env python\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \""
  },
  {
    "path": "AzureEnhancedMonitor/ext/installer.py",
    "chars": 2315,
    "preview": "#!/usr/bin/env python\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \""
  },
  {
    "path": "AzureEnhancedMonitor/ext/references",
    "chars": 129,
    "preview": "Common/azure-sdk-for-python/azure/\nCommon/psutil/LICENSE\nCommon/libpsutil\nUtils/\nLICENSE-2_0.txt\nAzureEnhancedMonitor/hv"
  },
  {
    "path": "AzureEnhancedMonitor/ext/test/env.py",
    "chars": 858,
    "preview": "#!/usr/bin/env python\n#\n#CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache L"
  },
  {
    "path": "AzureEnhancedMonitor/ext/test/storage_metrics",
    "chars": 923,
    "preview": "[{\"TotalRequests\": 1, \"RowKey\": \"system;All\", \"AverageE2ELatency\": 52.0, \"AverageServerLatency\": 48.0, \"TotalIngress\": 2"
  },
  {
    "path": "AzureEnhancedMonitor/ext/test/test_aem.py",
    "chars": 15568,
    "preview": "#!/usr/bin/env python\n#\n#CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache L"
  },
  {
    "path": "AzureEnhancedMonitor/ext/test/test_installer.py",
    "chars": 1014,
    "preview": "#!/usr/bin/env python\n#\n#CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache L"
  },
  {
    "path": "AzureEnhancedMonitor/hvinfo/.gitignore",
    "chars": 6,
    "preview": "bin/*\n"
  },
  {
    "path": "AzureEnhancedMonitor/hvinfo/Makefile",
    "chars": 611,
    "preview": "CC := gcc\nSRCDIR := src\nLIBDIR := lib\nINCDIR := include\nBUILDDIR := build\nTARGET := bin/hvinfo\n\nSRCEXT := c\nSOURCES := $"
  },
  {
    "path": "AzureEnhancedMonitor/hvinfo/src/hvinfo.c",
    "chars": 2231,
    "preview": "//\n// Copyright 2014 Microsoft Corporation\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you "
  },
  {
    "path": "AzureEnhancedMonitor/nodejs/package.json",
    "chars": 1007,
    "preview": "{\n  \"name\": \"azure-linux-tools\",\n  \"author\": \"Microsoft Corporation\",\n  \"contributors\": [\n    \"Yue, Zhang <yuezha@micros"
  },
  {
    "path": "AzureEnhancedMonitor/nodejs/setaem.js",
    "chars": 22880,
    "preview": "#!/usr/bin/env node\n\n//\n// Copyright (c) Microsoft and contributors.  All rights reserved.\n// \n// Licensed under the Apa"
  },
  {
    "path": "AzureMonitorAgent/.gitignore",
    "chars": 81,
    "preview": "MetricsExtensionBin/\nmetrics_ext_utils/\npackages/\ntelegraf_utils/\nUtils/\nwaagent\n"
  },
  {
    "path": "AzureMonitorAgent/HandlerManifest.json",
    "chars": 1091,
    "preview": "[\n  {\n    \"name\":  \"AzureMonitorLinuxAgent\",\n    \"version\": \"1.5.124\",\n    \"handlerManifest\": {\n      \"installCommand\": "
  },
  {
    "path": "AzureMonitorAgent/README.md",
    "chars": 2151,
    "preview": "# AzureMonitorLinuxAgent Extension\nAllow the owner of the Azure Virtual Machines to install the Azure Monitor Linux Agen"
  },
  {
    "path": "AzureMonitorAgent/agent.py",
    "chars": 148694,
    "preview": "#!/usr/bin/env python\n#\n# AzureMonitoringLinuxAgent Extension\n#\n# Copyright 2021 Microsoft Corporation\n#\n# Licensed unde"
  },
  {
    "path": "AzureMonitorAgent/agent.version",
    "chars": 197,
    "preview": "AGENT_VERSION=\"1.12.0\"\nAGENT_VERSION_DATE=\"\"\nMDSD_DEB_PACKAGE_NAME=\"azuremonitoragent_1.12.0-build.master.89_x86_64.deb\""
  },
  {
    "path": "AzureMonitorAgent/ama_tst/AMA-Troubleshooting-Tool.md",
    "chars": 3761,
    "preview": "# Troubleshooting Tool for Azure Monitor Linux Agent\nThe following document provides quick information on the AMA Troubl"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/__init__.py",
    "chars": 28,
    "preview": "# AMA troubleshooter modules"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/ama_troubleshooter.sh",
    "chars": 1700,
    "preview": "#!/usr/bin/env bash\n\nCOMMAND=\"./modules/main.py\"\nPYTHON=\"\"\nTST_VERSION=\"1.7\"  # update when changes are made to TST\nARG="
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/__init__.py",
    "chars": 28,
    "preview": "# AMA troubleshooter modules"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/connect/__init__.py",
    "chars": 40,
    "preview": "# Connection check helper script for AMA"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/connect/check_endpts.py",
    "chars": 7664,
    "preview": "import subprocess\nimport traceback\n\nfrom error_codes import *\nfrom errors      import error_info\nfrom helpers     import"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/connect/check_imds.py",
    "chars": 3163,
    "preview": "import subprocess\nimport json\n\nfrom error_codes    import *\nfrom errors         import error_info\nfrom helpers        im"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/connect/connect.py",
    "chars": 4080,
    "preview": "import os\nimport json\nimport subprocess\nimport platform\n\nfrom error_codes       import *\nfrom errors            import e"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/custom_logs/__init__.py",
    "chars": 41,
    "preview": "# Custom logs check helper script for AMA"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/custom_logs/check_clconf.py",
    "chars": 2594,
    "preview": "import os\n\nfrom error_codes import *\nfrom errors      import error_info\nfrom helpers     import general_info, geninfo_lo"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/custom_logs/custom_logs.py",
    "chars": 1651,
    "preview": "from error_codes          import *\nfrom errors               import is_error, get_input, print_errors\nfrom .check_clconf"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/error_codes.py",
    "chars": 1081,
    "preview": "# # General Errors\nNO_ERROR = 0\nUSER_EXIT = 1\nERR_SUDO_PERMS = 100\nERR_FOUND = 101\n\n# Warnings\nWARN_INTERNET_CONN = 10\nW"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/errors.py",
    "chars": 7869,
    "preview": "import copy\nimport subprocess\n\nfrom error_codes import *\n\n# backwards compatible input() function for Python 2 vs 3\ntry:"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/general_health/__init__.py",
    "chars": 44,
    "preview": "# General health check helper script for AMA"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/general_health/check_status.py",
    "chars": 2635,
    "preview": "import subprocess\nimport re\nimport platform\n\nfrom error_codes import *\nfrom errors      import error_info\nfrom helpers  "
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/general_health/general_health.py",
    "chars": 1697,
    "preview": "import os\n\nfrom error_codes  import *\nfrom errors       import error_info, is_error, print_errors\nfrom .check_status imp"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/helpers.py",
    "chars": 12759,
    "preview": "import os\nimport json\nimport platform\nimport subprocess\nfrom errors         import error_info\nfrom error_codes    import"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/high_cpu_mem/__init__.py",
    "chars": 40,
    "preview": "# CPU/memory check helper script for AMA"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/high_cpu_mem/check_logrot.py",
    "chars": 3122,
    "preview": "import errno\nimport os\nimport re\n\nfrom error_codes import *\nfrom errors      import error_info\n\nLR_CONFIG_PATH = \"/etc/l"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/high_cpu_mem/check_usage.py",
    "chars": 2123,
    "preview": "import time\nimport subprocess\n\nfrom error_codes import *\nfrom errors      import error_info\nfrom helpers     import get_"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/high_cpu_mem/high_cpu_mem.py",
    "chars": 829,
    "preview": "from error_codes          import *\nfrom errors               import is_error, print_errors\nfrom .check_logrot        imp"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/install/__init__.py",
    "chars": 37,
    "preview": "# Install check helper script for AMA"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/install/check_ama.py",
    "chars": 11437,
    "preview": "import re\nimport sys\nimport socket\nimport xml.dom.minidom\nif sys.version_info[0] == 3:\n    import urllib.request as urll"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/install/check_os.py",
    "chars": 2875,
    "preview": "from __future__ import absolute_import\nimport platform\nfrom error_codes import *\nfrom errors      import error_info\nfrom"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/install/check_pkgs.py",
    "chars": 1598,
    "preview": "import os\n\nfrom error_codes import *\nfrom errors      import error_info\nfrom helpers     import get_package_version, fin"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/install/install.py",
    "chars": 3267,
    "preview": "import os\n\nfrom error_codes  import *\nfrom errors       import error_info, is_error, print_errors\nfrom .check_os    impo"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/install/supported_distros.py",
    "chars": 1410,
    "preview": "supported_dists_x86_64 = {'redhat' : ['7', '8', '9', '10'], # Rhel\n                       'centos' : ['7', '8'], # CentO"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/logcollector.py",
    "chars": 23613,
    "preview": "import datetime\nimport glob\nimport os\nimport platform\nimport shutil\nimport json\n\nimport helpers\nfrom error_codes        "
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/main.py",
    "chars": 10894,
    "preview": "import os\nimport sys\n\nfrom helpers        import get_input\nfrom logcollector   import run_logcollector\nfrom error_codes "
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/metrics_troubleshooter/__init__.py",
    "chars": 39,
    "preview": "# metrics troubleshooter script for AMA"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/metrics_troubleshooter/metrics_troubleshooter.py",
    "chars": 1460,
    "preview": "import os\nimport subprocess\n\nfrom error_codes import *\n\n# Resolve absolute path to the script\nSCRIPT_DIR = os.path.dirna"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/syslog_tst/__init__.py",
    "chars": 36,
    "preview": "# Syslog check helper script for AMA"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/syslog_tst/check_conf.py",
    "chars": 1560,
    "preview": "import os\n\nfrom error_codes       import *\nfrom errors            import error_info\nfrom helpers           import geninf"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/syslog_tst/check_rsysng.py",
    "chars": 1929,
    "preview": "import subprocess\n\nfrom error_codes import *\nfrom errors      import error_info\nfrom helpers     import general_info\n\nRS"
  },
  {
    "path": "AzureMonitorAgent/ama_tst/modules/syslog_tst/syslog.py",
    "chars": 1215,
    "preview": "from error_codes          import *\nfrom errors               import is_error, print_errors\nfrom .check_conf          imp"
  },
  {
    "path": "AzureMonitorAgent/apply_version.sh",
    "chars": 842,
    "preview": "#! /bin/bash\n\nsource ./agent.version\n\necho \"AGENT_VERSION=$AGENT_VERSION\"\necho \"MDSD_DEB_PACKAGE_NAME=$MDSD_DEB_PACKAGE_"
  },
  {
    "path": "AzureMonitorAgent/azuremonitoragentextension.logrotate",
    "chars": 586,
    "preview": "/var/log/azure/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent/extension.log\n{\n    copytruncate\n    rotate 7\n    daily\n  "
  },
  {
    "path": "AzureMonitorAgent/manifest.xml",
    "chars": 961,
    "preview": "<?xml version='1.0' encoding='utf-8' ?>\n<ExtensionImage xmlns=\"http://schemas.microsoft.com/windowsazure\">\n  <ProviderNa"
  },
  {
    "path": "AzureMonitorAgent/packaging.sh",
    "chars": 4569,
    "preview": "#! /bin/bash\nset -e\nsource agent.version\n\nusage()\n{\n    local basename=`basename $0`\n    echo \"usage: ./$basename <path "
  },
  {
    "path": "AzureMonitorAgent/references",
    "chars": 7,
    "preview": "Utils/\n"
  },
  {
    "path": "AzureMonitorAgent/services/metrics-extension-cmv1.service",
    "chars": 428,
    "preview": "[Unit]\nDescription=Metrics Extension service for Linux Agent metrics sourcing\nAfter=network.target\n\n[Service]\nExecStart="
  },
  {
    "path": "AzureMonitorAgent/services/metrics-extension-cmv2.service",
    "chars": 920,
    "preview": "[Unit]\nDescription=Metrics Extension service for Linux Agent metrics sourcing\nAfter=network.target\n\n[Service]\nEnvironmen"
  },
  {
    "path": "AzureMonitorAgent/services/metrics-extension-otlp.service",
    "chars": 566,
    "preview": "[Unit]\nDescription=Metrics Extension service for Linux Agent metrics sourcing\nAfter=network.target\n\n[Service]\nEnvironmen"
  },
  {
    "path": "AzureMonitorAgent/shim.sh",
    "chars": 1511,
    "preview": "#!/usr/bin/env bash\n\n# This is the main driver file for AMA extension. This file first checks if Python 3 or 2 is availa"
  },
  {
    "path": "AzureMonitorAgent/update_version.sh",
    "chars": 910,
    "preview": "#! /bin/bash\nset -x\n\nif [[ \"$1\" == \"--help\" ]]; then\n    echo \"update_version.sh <AGENT_VERSION> <MDSD_DEB_PACKAGE_NAME>"
  },
  {
    "path": "CODEOWNERS",
    "chars": 1541,
    "preview": "# See https://help.github.com/articles/about-codeowners/\n# for more info about CODEOWNERS file\n\n# It uses the same patte"
  },
  {
    "path": "Common/WALinuxAgent-2.0.14/waagent",
    "chars": 244730,
    "preview": "#!/usr/bin/env python\n#\n# Windows Azure Linux Agent\n#\n# Copyright 2015 Microsoft Corporation\n#\n# Licensed under the Apac"
  },
  {
    "path": "Common/WALinuxAgent-2.0.16/waagent",
    "chars": 274366,
    "preview": "#!/usr/bin/env python\n#\n# Azure Linux Agent\n#\n# Copyright 2015 Microsoft Corporation\n#\n# Licensed under the Apache Licen"
  },
  {
    "path": "Common/libpsutil/py2.6-glibc-2.12-pre/psutil/__init__.py",
    "chars": 68720,
    "preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of th"
  },
  {
    "path": "Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_common.py",
    "chars": 7569,
    "preview": "# /usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_compat.py",
    "chars": 6791,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_psbsd.py",
    "chars": 13237,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_pslinux.py",
    "chars": 40720,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_psosx.py",
    "chars": 9772,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_psposix.py",
    "chars": 5065,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_pssunos.py",
    "chars": 18350,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_pswindows.py",
    "chars": 15618,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.7-glibc-2.12+/psutil/__init__.py",
    "chars": 68720,
    "preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of th"
  },
  {
    "path": "Common/libpsutil/py2.7-glibc-2.12+/psutil/_common.py",
    "chars": 7569,
    "preview": "# /usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.7-glibc-2.12+/psutil/_compat.py",
    "chars": 6791,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.7-glibc-2.12+/psutil/_psbsd.py",
    "chars": 13237,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.7-glibc-2.12+/psutil/_pslinux.py",
    "chars": 40708,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.7-glibc-2.12+/psutil/_psosx.py",
    "chars": 9772,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.7-glibc-2.12+/psutil/_psposix.py",
    "chars": 5065,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.7-glibc-2.12+/psutil/_pssunos.py",
    "chars": 18350,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/libpsutil/py2.7-glibc-2.12+/psutil/_pswindows.py",
    "chars": 15618,
    "preview": "#!/usr/bin/env python\n\n# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.\n# Use of this source code is govern"
  },
  {
    "path": "Common/waagentloader.py",
    "chars": 1418,
    "preview": "# Wrapper module for waagent\n#\n# waagent is not written as a module. This wrapper module is created \n# to use the waagen"
  },
  {
    "path": "CustomScript/CHANGELOG.md",
    "chars": 728,
    "preview": "## vNext (yyyy-mm-dd)\n- Error message misleading [#150]\n- Fix for internal DNS check [#98]\n\n## 1.5.2.0 (2016-04-11)\n- Fi"
  },
  {
    "path": "CustomScript/HandlerManifest.json",
    "chars": 349,
    "preview": "[\n  {\n    \"version\": 1.0,\n    \"handlerManifest\": {\n      \"disableCommand\": \"shim.sh -disable\",\n      \"enableCommand\": \"s"
  },
  {
    "path": "CustomScript/README.md",
    "chars": 10625,
    "preview": "# CustomScript Extension\n\nAllow the owner of the Azure Virtual Machines to run customized scripts in the VM.\n\n\n# :warnin"
  },
  {
    "path": "CustomScript/azure/__init__.py",
    "chars": 33598,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/azure.pyproj",
    "chars": 3950,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/ms"
  },
  {
    "path": "CustomScript/azure/http/__init__.py",
    "chars": 2502,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/http/batchclient.py",
    "chars": 13769,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/http/httpclient.py",
    "chars": 8556,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/http/winhttp.py",
    "chars": 15151,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/servicebus/__init__.py",
    "chars": 33795,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/servicebus/servicebusservice.py",
    "chars": 41704,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/servicemanagement/__init__.py",
    "chars": 65202,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/servicemanagement/servicebusmanagementservice.py",
    "chars": 6229,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/servicemanagement/servicemanagementclient.py",
    "chars": 5859,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/servicemanagement/servicemanagementservice.py",
    "chars": 81076,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/servicemanagement/sqldatabasemanagementservice.py",
    "chars": 2557,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/servicemanagement/websitemanagementservice.py",
    "chars": 10015,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/storage/__init__.py",
    "chars": 26885,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/storage/blobservice.py",
    "chars": 105417,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/storage/cloudstorageaccount.py",
    "chars": 1605,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/storage/queueservice.py",
    "chars": 19818,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/storage/sharedaccesssignature.py",
    "chars": 8809,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/storage/storageclient.py",
    "chars": 5800,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/azure/storage/tableservice.py",
    "chars": 20791,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "CustomScript/customscript.py",
    "chars": 19354,
    "preview": "#!/usr/bin/env python\n#\n# CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache "
  },
  {
    "path": "CustomScript/manifest.xml",
    "chars": 966,
    "preview": "<?xml version='1.0' encoding='utf-8' ?>\n<ExtensionImage xmlns=\"http://schemas.microsoft.com/windowsazure\">\n  <ProviderNa"
  },
  {
    "path": "CustomScript/references",
    "chars": 7,
    "preview": "Utils/\n"
  },
  {
    "path": "CustomScript/shim.sh",
    "chars": 924,
    "preview": "#!/usr/bin/env bash\n\n# The shim scripts provide a single entry point for CSE and will invoke the customscript.py entry p"
  },
  {
    "path": "CustomScript/test/HandlerEnvironment.json",
    "chars": 360,
    "preview": "[{  \"name\": \"Microsoft.OSTCExtensions.CustomScriptForLinuxTest\", \"seqNo\": \"0\", \"version\": 1.0,  \"handlerEnvironment\": { "
  },
  {
    "path": "CustomScript/test/MockUtil.py",
    "chars": 1127,
    "preview": "#!/usr/bin/env python\n#\n#CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache L"
  },
  {
    "path": "CustomScript/test/create_test_blob.py",
    "chars": 679,
    "preview": "import blob\nimport blob_mooncake\nimport customscript as cs\nfrom azure.storage import BlobService\n\ndef create_blob(blob, "
  },
  {
    "path": "CustomScript/test/env.py",
    "chars": 748,
    "preview": "#!/usr/bin/env python\n#\n# CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache "
  },
  {
    "path": "CustomScript/test/run_all.sh",
    "chars": 810,
    "preview": "#!/bin/bash\n#\n# This script is used to set up a test env for extensions\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Lic"
  },
  {
    "path": "CustomScript/test/test_blob_download.py",
    "chars": 1334,
    "preview": "#!/usr/bin/env python\n#\n#CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache L"
  },
  {
    "path": "CustomScript/test/test_file_download.py",
    "chars": 1456,
    "preview": "#!/usr/bin/env python\n#\n#CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache L"
  },
  {
    "path": "CustomScript/test/test_preprocess_file.py",
    "chars": 3025,
    "preview": "#!/usr/bin/env python\n#\n#CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache L"
  },
  {
    "path": "CustomScript/test/test_uri_utils.py",
    "chars": 1988,
    "preview": "#!/usr/bin/env python\n#\n#CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache L"
  },
  {
    "path": "CustomScript/test/timeout.sh",
    "chars": 150,
    "preview": "#!/bin/bash\n\nfor i in $(seq 1500)\ndo\n    echo `date` + The script is running...\n    >&2 echo `date` + ERROR:The script i"
  },
  {
    "path": "DSC/HandlerManifest.json",
    "chars": 470,
    "preview": "[\n  {\n    \"name\" : \"DSCForLinux\",   \n    \"version\": 1.0,\n    \"handlerManifest\": {\n      \"disableCommand\": \"./extension_s"
  },
  {
    "path": "DSC/Makefile",
    "chars": 514,
    "preview": "all: package\n\nSOURCES = \\\n\thttpclientfactory.py \\\n    subprocessfactory.py \\\n\tcurlhttpclient.py \\\n    serializerfactory."
  },
  {
    "path": "DSC/README.md",
    "chars": 12159,
    "preview": "# DSCForLinux Extension\nAllow the owner of the Azure Virtual Machines to configure the VM using Desired State Configurat"
  },
  {
    "path": "DSC/azure/__init__.py",
    "chars": 33598,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/azure.pyproj",
    "chars": 3950,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/ms"
  },
  {
    "path": "DSC/azure/http/__init__.py",
    "chars": 2502,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/http/batchclient.py",
    "chars": 13769,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/http/httpclient.py",
    "chars": 8556,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/http/winhttp.py",
    "chars": 15151,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/servicebus/__init__.py",
    "chars": 33795,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/servicebus/servicebusservice.py",
    "chars": 41704,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/servicemanagement/__init__.py",
    "chars": 65202,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/servicemanagement/servicebusmanagementservice.py",
    "chars": 6229,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/servicemanagement/servicemanagementclient.py",
    "chars": 5859,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/servicemanagement/servicemanagementservice.py",
    "chars": 81076,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/servicemanagement/sqldatabasemanagementservice.py",
    "chars": 2557,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/servicemanagement/websitemanagementservice.py",
    "chars": 10015,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/storage/__init__.py",
    "chars": 26885,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/storage/blobservice.py",
    "chars": 105417,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/storage/cloudstorageaccount.py",
    "chars": 1605,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/storage/queueservice.py",
    "chars": 19818,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/storage/sharedaccesssignature.py",
    "chars": 8809,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/storage/storageclient.py",
    "chars": 5800,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/azure/storage/tableservice.py",
    "chars": 20791,
    "preview": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft.  All rights reserv"
  },
  {
    "path": "DSC/curlhttpclient.py",
    "chars": 11206,
    "preview": "#!/usr/bin/env python2\n#\n# Copyright (C) Microsoft Corporation, All rights reserved.\n\n\"\"\"Curl CLI wrapper.\"\"\"\n\nimport ba"
  },
  {
    "path": "DSC/dsc.py",
    "chars": 56101,
    "preview": "#!/usr/bin/env python\n#\n# DSC extension\n#\n# Copyright 2015 Microsoft Corporation\n#\n# Licensed under the Apache License, "
  },
  {
    "path": "DSC/extension_shim.sh",
    "chars": 10841,
    "preview": "#!/usr/bin/env bash\n\n# Keeping the default command\nCOMMAND=\"\"\nPYTHON=\"\"\n\n# We are writing logs to error stream in extens"
  },
  {
    "path": "DSC/httpclient.py",
    "chars": 4555,
    "preview": "#!/usr/bin/env python2\n#\n# Copyright (C) Microsoft Corporation, All rights reserved.\n\n\"\"\"HttpClient base class.\"\"\"\n\nimpo"
  },
  {
    "path": "DSC/httpclientfactory.py",
    "chars": 2234,
    "preview": "#!/usr/bin/env python2\n#\n# Copyright (C) Microsoft Corporation, All rights reserved.\n\nimport os\n\nfrom curlhttpclient imp"
  },
  {
    "path": "DSC/manifest.xml",
    "chars": 936,
    "preview": "<?xml version='1.0' encoding='utf-8' ?>\n<ExtensionImage xmlns=\"http://schemas.microsoft.com/windowsazure\">\n  <ProviderNa"
  },
  {
    "path": "DSC/serializerfactory.py",
    "chars": 889,
    "preview": "#!/usr/bin/env python2\n#\n# Copyright (C) Microsoft Corporation, All rights reserved.\n\n\"\"\"Serializer factory.\"\"\"\n\nPY_MAJO"
  },
  {
    "path": "DSC/subprocessfactory.py",
    "chars": 1827,
    "preview": "#!/usr/bin/env python2\n#\n# Copyright (C) Microsoft Corporation, All rights reserved.\n\n\"\"\"Process factory which returns a"
  },
  {
    "path": "DSC/test/MockUtil.py",
    "chars": 1194,
    "preview": "#!/usr/bin/env python\n#\n#CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache L"
  },
  {
    "path": "DSC/test/env.py",
    "chars": 1260,
    "preview": "#!/usr/bin/env python\n#\n#CustomScript extension\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache L"
  },
  {
    "path": "DSC/test/mof/azureautomation.df.meta.mof",
    "chars": 2206,
    "preview": "\n\tinstance of MSFT_WebDownloadManager as $MSFT_WebDownloadManager1ref\n\t{\n\tResourceID = \"[ConfigurationRepositoryWeb]Azur"
  },
  {
    "path": "DSC/test/status/0.status",
    "chars": 1213,
    "preview": "[{\n    \"version\": 1.0,\n    \"timestampUTC\": \"<current utc time>\",\n    \"status\" : {\n        \"name\": \"<Handler workload nam"
  },
  {
    "path": "DSC/test/test_apply_meta_mof.py",
    "chars": 1234,
    "preview": "#!/usr/bin/env python\n#\n# DSC Extension For Linux\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache"
  },
  {
    "path": "DSC/test/test_apply_mof.py",
    "chars": 1308,
    "preview": "#!/usr/bin/env python\n#\n# DSC Extension For Linux\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache"
  },
  {
    "path": "DSC/test/test_compare_pkg_version.py",
    "chars": 1748,
    "preview": "#!/usr/bin/env python\n#\n# DSC Extension For Linux\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache"
  },
  {
    "path": "DSC/test/test_download_file.py",
    "chars": 1132,
    "preview": "#!/usr/bin/env python\n#\n# DSC Extension For Linux\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache"
  },
  {
    "path": "DSC/test/test_node_extension_properties.py",
    "chars": 2832,
    "preview": "#!/usr/bin/env python\n#\n# DSC Extension For Linux\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache"
  },
  {
    "path": "DSC/test/test_register.py",
    "chars": 2137,
    "preview": "#!/usr/bin/env python\n#\n# DSC Extension For Linux\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache"
  },
  {
    "path": "DSC/test/test_status_update.py",
    "chars": 4924,
    "preview": "#!/usr/bin/env python\n#\n# DSC Extension For Linux\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache"
  },
  {
    "path": "DSC/urllib2httpclient.py",
    "chars": 8632,
    "preview": "#!/usr/bin/env python2\n\n#\n# Copyright (C) Microsoft Corporation, All rights reserved.\n\n\"\"\"Urllib2 HttpClient.\"\"\"\n\ntry:\n "
  },
  {
    "path": "DSC/urllib3httpclient.py",
    "chars": 8779,
    "preview": "#!/usr/bin/env python2\n\n#\n# Copyright (C) Microsoft Corporation, All rights reserved.\n\n\"\"\"Urllib2 HttpClient.\"\"\"\n\ntry:\n "
  },
  {
    "path": "Diagnostic/ChangeLogs",
    "chars": 5855,
    "preview": "2020-11-06: LAD-3.0.131\n    - Fix issue #1262: Crashing bug caused by task synchronization issue in XJsonBlobRequest\n\n20"
  },
  {
    "path": "Diagnostic/DistroSpecific.py",
    "chars": 14843,
    "preview": "#!/usr/bin/env python\n#\n# Azure Linux extension\n# Distribution-specific actions\n#\n# Linux Azure Diagnostic Extension (Cu"
  },
  {
    "path": "Diagnostic/HandlerManifest.json",
    "chars": 390,
    "preview": "[\n  {\n    \"version\": 1.0,\n    \"handlerManifest\": {\n      \"disableCommand\": \"shim.sh -disable\",\n      \"enableCommand\": \"s"
  },
  {
    "path": "Diagnostic/Makefile",
    "chars": 458,
    "preview": "all: package\n.PHONY: all\n.PHONY: clean\n.PHONY: package\n\nLADSOURCES = \\\n\tdiagnostic.py \\\n\twatcherutil.py \\\n\ttests \\\n\tHand"
  },
  {
    "path": "Diagnostic/Providers/Builtin.py",
    "chars": 14587,
    "preview": "#!/usr/bin/env python\n#\n# Azure Linux extension\n#\n# Linux Azure Diagnostic Extension (Current version is specified in ma"
  },
  {
    "path": "Diagnostic/Providers/__init__.py",
    "chars": 27,
    "preview": "# Providers module package\n"
  },
  {
    "path": "Diagnostic/README.md",
    "chars": 2857,
    "preview": "# [DEPRECATED] Linux Azure Diagnostic (LAD) Extension\n\n> :warning: The Azure Diagnostic extension has been **deprecated*"
  },
  {
    "path": "Diagnostic/Utils/LadDiagnosticUtil.py",
    "chars": 6066,
    "preview": "#!/usr/bin/env python\n#\n# Azure Linux extension\n#\n# Copyright (c) Microsoft Corporation  \n# All rights reserved.   \n# MI"
  },
  {
    "path": "Diagnostic/Utils/ProviderUtil.py",
    "chars": 3360,
    "preview": "#!/usr/bin/env python\n#\n# Azure Linux extension\n#\n# Copyright (c) Microsoft Corporation\n# All rights reserved.\n# MIT Lic"
  },
  {
    "path": "Diagnostic/Utils/XmlUtil.py",
    "chars": 2369,
    "preview": "#!/usr/bin/env python\n#\n# Azure Linux extension\n#\n# Copyright (c) Microsoft Corporation  \n# All rights reserved.   \n# MI"
  },
  {
    "path": "Diagnostic/Utils/__init__.py",
    "chars": 27,
    "preview": "# Providers module package\n"
  },
  {
    "path": "Diagnostic/Utils/imds_util.py",
    "chars": 6081,
    "preview": "#!/usr/bin/env python\n#\n# Azure Linux extension\n#\n# Linux Azure Diagnostic Extension (Current version is specified in ma"
  },
  {
    "path": "Diagnostic/Utils/lad_exceptions.py",
    "chars": 1462,
    "preview": "#!/usr/bin/env python\n#\n# Azure Linux extension\n#\n# Copyright (c) Microsoft Corporation\n# All rights reserved.\n# MIT Lic"
  },
  {
    "path": "Diagnostic/Utils/lad_ext_settings.py",
    "chars": 8637,
    "preview": "#!/usr/bin/env python\n#\n# Azure Linux extension\n#\n# Linux Azure Diagnostic Extension (Current version is specified in ma"
  }
]

// ... and 791 more files (download for full content)

About this extraction

This page contains the full source code of the Azure/azure-linux-extensions GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 991 files (6.8 MB), approximately 1.8M tokens, and a symbol index with 8724 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!