TBD
Project description
CSP Billing Adapter Microsoft Plugin
This is a plugin for csp-billing-adapter that provides CSP hook implementations. This includes the hooks defined in the csp_hookspecs.py module.
Meter billing
The meter_billing function accepts a dictionary mapping of dimension name
to usage quantity. This information is used to bill the customer for
the product ID that is configured in the adapter. If there is an exception
with metered billing the exception is raised.
Get CSP Name
The get_csp_name function returns the name of the CSP provider. In this
case it is microsoft.
Get Account Info
The get_account_info function provides metadata information for the running
instance or container. The structure of this information is as follows:
{
"compute": {
"azEnvironment": "AzurePublicCloud",
"customData": "",
"isHostCompatibilityLayerVm": "false",
"licenseType": "",
"location": "eastus",
"name": "csp-adapter-test",
"offer": "sles-15-sp4-byos",
"osProfile": {
"adminUsername": "foo",
"computerName": "csp-adapter-test"
},
"osType": "Linux",
"placementGroupId": "",
"plan": {
"name": "",
"product": "",
"publisher": ""
},
"platformFaultDomain": "0",
"platformUpdateDomain": "0",
"provider": "Microsoft.Compute",
"publicKeys": [
{
"keyData": ssh_public_key,
"path": "/home/foo/.ssh/authorized_keys"
}
],
"publisher": "suse",
"resourceGroupName": "foo",
"resourceId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/foo/providers/Microsoft.Compute/virtualMachines/csp-adapter-test",
"securityProfile": {
"secureBootEnabled": "false",
"virtualTpmEnabled": "false"
},
"sku": "gen2",
"storageProfile": {
"dataDisks": [],
"imageReference": {
"id": "",
"offer": "sles-15-sp4-byos",
"publisher": "suse",
"sku": "gen2",
"version": "2023.05.06"
},
"osDisk": {
"caching": "ReadWrite",
"createOption": "FromImage",
"diffDiskSettings": {
"option": ""
},
"diskSizeGB": "30",
"encryptionSettings": {
"enabled": "false"
},
"image": {
"uri": ""
},
"managedDisk": {
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/foo/providers/Microsoft.Compute/disks/csp-adapter-test_Os_Disk_1_12345678901234567890",
"storageAccountType": "Premium_LRS"
},
"name": "csp-adapter-test_Os_Disk_1_12345678901234567890",
"osType": "Linux",
"vhd": {
"uri": ""
},
"writeAcceleratorEnabled": "false"
}
},
"subscriptionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"tags": "Cost Center:123456789;Department:foo;Environment:foo;Finance Business Partner:foo;General Ledger Code:123456789;Group:foo;Owner:foo;Stakeholder:foo",
"tagsList": [
{
"name": "Cost Center",
"value": "12345678"
},
{
"name": "Department",
"value": "foo"
},
{
"name": "Environment",
"value": "foo"
},
{
"name": "Finance Business Partner",
"value": "foo"
},
{
"name": "General Ledger Code",
"value": "123456789"
},
{
"name": "Group",
"value": "foo"
},
{
"name": "Owner",
"value": "foo"
},
{
"name": "Stakeholder",
"value": "foo"
}
],
"version": "2023.05.06",
"vmId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"vmScaleSetName": "",
"vmSize": "Standard_B2s",
"zone": ""
},
"network": {
"interface": [
{
"ipv4": {
"ipAddress": [
{
"privateIpAddress": "10.0.0.8",
"publicIpAddress": "192.168.1.1"
}
],
"subnet": [
{
"address": "10.0.0.0",
"prefix": "24"
}
]
},
"ipv6": {
"ipAddress": []
},
"macAddress": "123456789ABCD"
}
]
},
"attestedData": {
"encoding": "pkcs7",
"signature": signature
},
"cloud_provider": "microsoft"
}
This information is pulled from the Azure Instance metadata endpoint: http://169.254.169.254/metadata/instance?api-version=2021-02-01. Note: the exact information in the document entry may vary.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file csp_billing_adapter_microsoft-1.3.1.tar.gz.
File metadata
- Download URL: csp_billing_adapter_microsoft-1.3.1.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ded3903f1ab1778025a4fdc5cdf6bfcdb402ca149d1649f2fa2f78f15ef2de0
|
|
| MD5 |
8d00e0d400575d84504acdc7a8e9acfe
|
|
| BLAKE2b-256 |
2927b7836a4e24b59fb193e9cb3f57c6dfe5d6fc89cb8076c1be6b62f6f8099a
|
Provenance
The following attestation bundles were made for csp_billing_adapter_microsoft-1.3.1.tar.gz:
Publisher:
pypi-publish.yml on SUSE-Enceladus/csp-billing-adapter-microsoft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
csp_billing_adapter_microsoft-1.3.1.tar.gz -
Subject digest:
2ded3903f1ab1778025a4fdc5cdf6bfcdb402ca149d1649f2fa2f78f15ef2de0 - Sigstore transparency entry: 2115379095
- Sigstore integration time:
-
Permalink:
SUSE-Enceladus/csp-billing-adapter-microsoft@89ce36be7b45dc89e453a61856f3ad52d10468c0 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/SUSE-Enceladus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@89ce36be7b45dc89e453a61856f3ad52d10468c0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file csp_billing_adapter_microsoft-1.3.1-py3-none-any.whl.
File metadata
- Download URL: csp_billing_adapter_microsoft-1.3.1-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61ea73986aab2edfa354187626e073e0cb0b97073c94cb25f45ddc223dd62dfd
|
|
| MD5 |
85a0ff126ad57450ad808963fec12e5f
|
|
| BLAKE2b-256 |
2fc6d12b4760626cba97489d7768cd596ab5e480d31028dcfdb65cc259647248
|
Provenance
The following attestation bundles were made for csp_billing_adapter_microsoft-1.3.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on SUSE-Enceladus/csp-billing-adapter-microsoft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
csp_billing_adapter_microsoft-1.3.1-py3-none-any.whl -
Subject digest:
61ea73986aab2edfa354187626e073e0cb0b97073c94cb25f45ddc223dd62dfd - Sigstore transparency entry: 2115379166
- Sigstore integration time:
-
Permalink:
SUSE-Enceladus/csp-billing-adapter-microsoft@89ce36be7b45dc89e453a61856f3ad52d10468c0 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/SUSE-Enceladus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@89ce36be7b45dc89e453a61856f3ad52d10468c0 -
Trigger Event:
push
-
Statement type: