-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add aosm extension #6426
Merged
Merged
Add aosm extension #6426
Changes from 250 commits
Commits
Show all changes
297 commits
Select commit
Hold shift + click to select a range
1eaa34f
removed deploy with sdk
21809b2
added artifact list
89636e5
push example cnf bicep
jddarby 715c925
Add temporary build workflow for AOSM extension (#4)
PerfectChaos 0f50403
added output dir; fixing getchartmappingschema
fbba297
Merge branch 'jl/add-cnf-generation' of github.com:jddarby/azure-cli-…
f92435c
Add empty init files to inner modules so setuptools recognises them a…
PerfectChaos 0b1266f
Merge pull request #5 from jddarby/chaos/fixpackages
PerfectChaos 599ac38
Use latest RG model to remove unnecessary dependency on version
PerfectChaos 5437fac
Merge pull request #6 from jddarby/chaos/generalrgmodel
PerfectChaos 2efdba6
Use latest deployment model to remove unnecessary dependency on version
PerfectChaos c80ced8
Merge pull request #7 from jddarby/chaos/generaldeploymodel
PerfectChaos dfd5790
fixed parameter mappings + copied needed files to output folder
4747224
jinja2 and find value paths
jddarby 58d525d
Merge branch 'jl/add-cnf-generation' of github.com:jddarby/azure-cli-…
jddarby 3188399
fixed typos + self.aritfacts only has unique artifacts
30921b8
use regex instead of string to find deploy params
jddarby 3501b82
delete accidentaly commited input.json
jddarby 7064890
fixed deploy params; added indent to mapping file
ae4f8fe
Merge branch 'jl/add-cnf-generation' of github.com:jddarby/azure-cli-…
2604a71
Update readme with install/bug reporting instructions
PerfectChaos 961daad
Adjust headers so rendered readme looks nicer
PerfectChaos 8274996
renamed values.nondef + added cli errors
d4fbc16
Split help command example lines
PerfectChaos 671fb64
Clarify that bug process is internal
PerfectChaos b3573e8
Merge pull request #9 from jddarby/chaos/installinstructions
PerfectChaos eb3c1a5
fixed parameter vals not updating
1a29b43
delete unuseed temoplate and update jinja2 templates
jddarby 13f72f4
Merge pull request #8 from jddarby/jl/add-cnf-generation
jordlay 6099b7a
Update README.md
jordlay 3c52481
Update README.md
jordlay 8c94905
added docstrings; added basic error catching with file handling
aa0b061
small refactor of generate nfd
c988938
Merge pull request #11 from jddarby/jl/tidy-up
jordlay 9d15f95
fixed j2 template captions; added create_nfd to cnf; edited error mes…
1853cba
fixed file not found erroe
c6d6680
Refactor commands to az aosm nfd|nsd build (#10)
sunnycarter 13c27cc
fixed most style errors; ran static checks and azdev style
ff1793c
pre merge commit
651ba78
Merge branch 'add-aosm-extension' of github.com:jddarby/azure-cli-ext…
5bde597
more style changes; renamed vnfbicepnfd to vnfnfd
a79ef57
Update readme with workflow
sunnycarter 168c265
added configfile validation
e43cb92
added temp dir to vnf; renamed shared constants
9694c9b
sunny markups
sunnycarter 9efa296
removed create_nfd_folder; added schema prefix to constant
2d19e34
fixed merge conflicts
a40cc3d
added deploymentparams to constants.py
e63f199
added error catching for get chart name and version
c26369a
Merge pull request #12 from jddarby/jl/post-review-fixes
jordlay 2dee8c4
added meaningful logs; prevent auto overwriting input.json
bb6302a
edited vnf schema to have accepted types
d5b03c6
added templates to setup.py
f43f313
Merge pull request #14 from jddarby/jl/fix-python-wheel
jordlay 276d3ca
Merge pull request #13 from jddarby/jl/first-round-feedback
jordlay d7f1b7a
added location from input file not resourceGroup().location
938b02e
Merge pull request #16 from jddarby/jl/manifest-location-bug
jordlay ab95a7c
added path_to_mappings to input.json; added logic to take mappings fr…
65ac401
renamed non_def_values to mappings_path
371a1ea
Merge pull request #18 from jddarby/jl/change-value-mappings
jordlay dda5957
Pk5/add nsd cli (#15)
patrykkulik-microsoft cdfde0f
fix CNF depends on
jddarby 25d05b1
Merge pull request #19 from jddarby/jdd/fix-depends-on
jddarby 6ed8ffa
Merge remote-tracking branch 'origin/main' into add-aosm-extension
jddarby 5b1e3aa
initial commit; ran python static checks fmt (except on vendored sdks…
a1035f7
Name uploaded VHD correctly
Jamieparsons 77e2e95
Self review markups
Jamieparsons 1c642bb
broken config generation code
jddarby b557b7f
fixed up configuration.py
a7d7574
fixed cnf generator styling
6d0520d
fixed styling for cnf generator
4c1a2ee
fixed up nfd generator base and deploy with arm
8e8db34
fixed styling for artifact.py
44299e6
fixed styling for atrifact manifest .py
e38d425
Code review markups
Jamieparsons 6cda523
Merge pull request #20 from jddarby/JDP/bug-735056
jamiedparsons d0f1276
fixed more linting
a6c292c
fixed merge conflicts
649ace6
Merge pull request #21 from jddarby/jl/fix-style
jordlay 5f7b608
first attempt at regex
09be248
Sunny/choose deploy parameters (#23)
sunnycarter e680931
Fix for oras target string with erroneous spaces
a087421
Merge pull request #26 from jddarby/achurchard/fix_oras_target_string
Cyclam 4c54367
fixed regex; tested on existing charts and sas charts; committing to …
70c7346
changed regex constants + tidied
126c68c
fixed blankspace
cbf8f67
fix merge conflicts
93fb6af
markups
b19dcc3
Merge pull request #28 from jddarby/jl/edit-image-secrets-paths
jordlay c57e4c5
initial commit
63b4346
tidied code and added comments
a88e757
add multi nf config
jddarby 9e67219
Merge branch 'Azure:main' into add-aosm-extension
jddarby 93840e8
Add style and lint check
jddarby 6c9a478
added logic for handling deployparams within lists
3adcb80
one line fix from review
1c0dbe1
Merge pull request #29 from jddarby/jl/refactor-deploy-params
jordlay 85ae247
removing print statement
0f2fb35
Merge pull request #31 from jddarby/jl/refactor-deploy-params
jordlay 7719df2
added new test file and one unit test
077531d
added workflow for unit tests in pipeline + set up rough structure of…
9419ef9
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
sunnycarter d7a4abf
instantiated cnf class; added fake invalid helm package; added new fi…
4013895
Nsd for cnfs (#33)
sunnycarter 689acf4
Add Publish command to the CNF azure CLI (#24)
patrykkulik-microsoft a403856
Expose NFD version and managed identities (#34)
jamiedparsons c492fae
Merge branch 'add-aosm-extension' into jl/add-unit-testing
Jamieparsons aad112f
Add a first VNF test
Jamieparsons f06efc3
achurchard/style fixes (#35)
Cyclam 31672ae
Add CNF UTs that will fail at the moment
Jamieparsons f8b317f
Actually include all files.
Jamieparsons 53e7729
Always run tests
Jamieparsons 51eb04b
Merge branch 'add-aosm-extension' into jl/add-unit-testing
Jamieparsons 9d21900
Add another test that won't pass yet
Jamieparsons 716737e
remove github pipeline tests - they should run in Azure
Jamieparsons 0f86392
Sundry fixes for CNF quickstart (#38)
sunnycarter ad88098
NSD UTs
Jamieparsons 9f4f269
Merge branch 'add-aosm-extension' into jl/add-unit-testing
Jamieparsons de248c1
Update read me.
Jamieparsons 0497ec7
Improve path handling, other small refactorings (#39)
Cyclam 91b7f39
Fix Artifact upload on Windows (#40)
sunnycarter ea3fd77
Black
Jamieparsons e994c60
Mark ups
Jamieparsons 95af0fc
Merge in add-aosm-extension
Jamieparsons b5b70b9
Merge pull request #32 from jddarby/jl/add-unit-testing
jamiedparsons 09f6a45
Sunny/fix artifact upload windows (#41)
sunnycarter 21154ff
Fix VNFD build (#42)
sunnycarter d02bc45
Multiple instances of the same NF
Jamieparsons a299eba
fix vnf deploy schema types (#44)
sunnycarter ebb5b46
Tidy up
Jamieparsons 1f18b8d
Mypy and docs
Jamieparsons 64e9a44
history.rst
Jamieparsons 7460892
Update README with logging info (#43)
patrykkulik-microsoft 8a05139
Merge in add-aosm-extension
Jamieparsons 71ae242
self markups
Jamieparsons 44344ff
Take oras 0.1.19 to fix Windows artifact upload (#46)
sunnycarter 60140e2
Fix merge
Jamieparsons ab98755
Merge pull request #45 from jddarby/JDP/multiple_NFs
jamiedparsons 3199a57
Horrific merge
Jamieparsons 607b2d1
Rename a few things
Jamieparsons 5da563b
Fix another merge
Jamieparsons b40b62c
DRY the deploy_nfd_from_bicep code
3241761
Make conditional statements clearer
5388f19
black
68e11cc
Update custom.py to use new nfd deploy method
b28e5f5
Black with text processing
64c645b
Create new nfRET class
Jamieparsons d11e82c
Merge branch 'achurchard/dry-the-deploy-nfd-code' into jdd/multi-nf-s…
Jamieparsons dc9deca
Mypy passing
Jamieparsons bfdb6dc
UTs passing
Jamieparsons ed20b35
Dry the deploy_nfd_from_bicep() code (#48)
Cyclam 0a7dc2d
Unit tests added
Jamieparsons 17147d7
Versions are wrong in NSD template comments
sunnycarter 980ebc2
Self review markups
Jamieparsons 55a2320
Remove wrong comments
sunnycarter e286c17
Code review markups
Jamieparsons e9925a1
Extra markups
Jamieparsons 6c6ec80
Merge in changes
Jamieparsons 100a844
Fix mypy
Jamieparsons 9483466
Pk5/add integration tests (#51)
patrykkulik-microsoft 6c5bea2
More markups
Jamieparsons ea6e507
Update output in tests
Jamieparsons c087b45
Pk5/minor integration tests changes (#52)
patrykkulik-microsoft 7a4154d
Merge in changes
Jamieparsons 12a2179
Update recordings
Jamieparsons d39d584
Fix up merge
Jamieparsons 687d506
Update developer docs
Jamieparsons b192027
Merge pull request #47 from jddarby/jdd/multi-nf-support
jamiedparsons 5646f52
Remove credentials
Jamieparsons aaf2e39
Merge pull request #53 from jddarby/JDP/remove_creds
jamiedparsons 430f57c
Fix linting
Jamieparsons 8827e75
cheeky extra change
sunnycarter 1ebce61
Merge pull request #55 from jddarby/JDP/fix_linting
jamiedparsons 28096d2
Remove credentials from the integration test recordings (#54)
patrykkulik-microsoft cf6b144
Remove the integration test from the repo (#56)
patrykkulik-microsoft 2d89e7a
prerequisite docker for cnf
sunnycarter 6276a13
Fix bicep render on Windows (#57)
sunnycarter d1c7b8b
Fixes for Windows (#58)
sunnycarter 63ebf43
ADO-880627: Use docker-less ACR login
wbradley94 9250046
docker is not required any more
sunnycarter bfe1cfb
Merge branch 'Azure:main' into add-aosm-extension
sunnycarter 2a9407d
Remove pre-release build and lint files from release branch (#63)
sunnycarter b5372aa
Release markups - release branch (#65)
sunnycarter 485a119
Fix integration tests (#67)
patrykkulik-microsoft df1ca06
Add aosm to service_name.json
sunnycarter a28cbc5
move artifact upload to before nfd/nsd deploy (#62)
sunnycarter dbc2aca
non-working attempt to use token creds
sunnycarter 28e3262
Check for Azure features on deploy and delete (#71)
sunnycarter 535aa95
code working
sunnycarter c98ea0d
Fix generate-config
sunnycarter 362dad8
Fix tests
sunnycarter 2f0df1e
lint
sunnycarter 703ec23
linting
sunnycarter 445c220
Jl/nfdv proxy (#73)
jordlay bfaf93b
Code review mark ups
Jamieparsons 86c3e1e
Merge in main
Jamieparsons e5a6e44
Linting and fix UTs
Jamieparsons 1e5fd22
Merge pull request #72 from jddarby/sunny/credentials-for-cnf-image-u…
jamiedparsons 479ba54
aosm codeowner
sunnycarter 0e5b739
Update HISTORY.rst
jordlay d5e51ff
Merge branch 'Azure:main' into add-aosm-extension
PerfectChaos db5b384
Normalise aosm version to 1.0.0b1 for release
PerfectChaos b9a8997
update hashes in recording
PerfectChaos 0e4d0e7
Temporary test revert of "aosm codeowner"
PerfectChaos c2e58e1
Fix license header formatting
PerfectChaos 98b412f
Revert "Temporary test revert of "aosm codeowner""
PerfectChaos 0d63c7c
Remove nonexistent entry from codeowners
PerfectChaos 246ff48
Fix source_local_docker_image defaults to placeholder text (#79)
jordlay 96c3187
renamed nsdg to nsd
ea7a7b4
Merge pull request #81 from jddarby/jl/nsdg_name_change
jddarby c172f41
Helptext + a little bit of validation
Jamieparsons 3ef7042
Fixed up validation
Jamieparsons ceeeb2d
Return True if _all_ required artifact manifests exist, not just the …
c699258
Code markups + linting.
Jamieparsons 84eff1f
Merge pull request #85 from jddarby/JDP/fix_helptext_and_validation
jamiedparsons b4f07e4
Docs: CNF publish options and permissions (#91)
sunnycarter f5fe6af
Requirement for docker again
sunnycarter 4ebc39d
revert bad markup (#94)
sunnycarter 634447c
Move live tests to swedensouth
9bf49a2
Actually move to uaenorth
b96e7d2
Don't log out ACR passwords when artifact commands fail (#97)
PerfectChaos 8795b87
Fix cnf image take 2 (#101)
sunnycarter 4ee9ab9
Default RG and ACR Values with Publisher Name (#103)
jordlay 5f0e04f
Fix unauthorized error bug
Jamieparsons 68132c5
Add spacing
Jamieparsons b9dc90a
fix unexpected symbol when parsing lists (#107)
sunnycarter 2e426fb
Merge pull request #106 from jddarby/JDP/unauthorized_error_bug
jamiedparsons 2779e8e
Validation requirements on helm names (#109)
sunnycarter 68f6458
Fix error parsing
Jamieparsons bf13498
Merge pull request #111 from jddarby/JDP/fix_error_parsing
jamiedparsons 848ee2e
Lower case acr names (#112)
sunnycarter c756deb
always allow azureDeployLocation to be configurable
jddarby 759727e
Add new optional VHD parameters
jddarby c42157b
Make VNF publish and delete a live test only
jddarby c745388
Validate VHD parameters in build UT
jddarby ba4c4c3
Markups from the CLI team
Jamieparsons 07273b8
Merge pull request #117 from jddarby/JDP/cli_team_markups
jamiedparsons f4b278e
mark-ups
jddarby 744d415
remove azureDeployLocation as a configurable vhd parameter
jddarby 907e27e
add explanitory comments
jddarby 69e03d1
Merge pull request #114 from jddarby/jdarby/image-value-mappings-fixes
jddarby 24c9849
Updates for 2023-09-01 API (#84)
Cyclam 17f2e6a
Merge branch 'Azure:main' into add-aosm-extension
jddarby 8d35266
Correctly get array item types in CNF deployment parameter schemas
PerfectChaos bd1274f
Merge pull request #118 from jddarby/chaos/schemarrays
PerfectChaos 171a873
Revert master .flake8 config
288c8f8
Fix double space in user output.
Cyclam 793adcd
Remove delete message to be consistent with other CLI extensions
84c22ed
Move "Deleted <resource>" messages to logger.info().
cf4bc47
Remove Blob_SAS_URL Option from ArmTemplate in input file (#119)
jordlay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. :changelog: | ||
|
||
Release History | ||
=============== | ||
|
||
1.0.0b1 | ||
++++++++ | ||
* Initial release - beta quality | ||
* `az aosm nfd|nsd generate-config` to generate an example config file to fill in for an NFD or NSD | ||
* `az aosm nfd|nsd build|publish|delete` to prepare files for, publish or delete an NFD or NSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
# Microsoft Azure CLI 'aosm' Extension | ||
|
||
This package is for the 'aosm' extension to support Azure Operator Service Manager | ||
functions. | ||
i.e. `az aosm` | ||
|
||
## Background | ||
|
||
The `az aosm` extension is intended to provide support for working with AOSM | ||
resources and definitions. Currently it only implements commands which aid the | ||
process of publishing Network Function Definitions and Network Service Designs to | ||
use with Azure Operator Service Manager or Network Function Manager. | ||
|
||
## Installation | ||
|
||
`az extension add --name aosm` | ||
|
||
For CNFs you will also need helm, and possibly docker installed. See [CNFs](#cnfs) below for details. | ||
|
||
# nfd and nsd commands | ||
|
||
These commands help with the publishing of Network Function Definition and Network | ||
Service Design resources. | ||
|
||
## Overview of function | ||
A generic workflow of using the tool would be: | ||
- Find the pre-requisite items you require for your use-case | ||
- Run a `generate-config` command to output an example JSON config file for subsequent commands | ||
- Fill in the config file | ||
- Run a `build` command to output one or more bicep templates for your Network Function Definition or Network Service Design | ||
- Review the output of the build command, edit the output as necessary for your requirements | ||
- Run a `publish` command to: | ||
* Create all pre-requisite resources such as Resource Group, Publisher, Artifact Stores, Groups | ||
* Deploy those bicep templates | ||
* Upload artifacts to the artifact stores | ||
|
||
### Pre-requisites | ||
|
||
#### VNFs | ||
|
||
For VNFs, you will need a single ARM template which would create the Azure resources | ||
for your VNF, for example a Virtual Machine, disks and NICs. You'll also need a VHD | ||
image that would be used for the VNF Virtual Machine. | ||
|
||
#### CNFs | ||
|
||
For CNFs you must have these packages installed on the machine you are running the CLI from: | ||
- `helm` package installed . Instructions on how to do this can be found [here](https://helm.sh/docs/intro/install/). | ||
- `docker` installed only in some circumstances, those being if the source image is in your local docker repository, or you do not have subscription-wide permissions required to push charts and images. See the remainder of this section for further details. Docker provides packages that easily configure docker on [Windows](https://docs.docker.com/docker-for-windows/), or [Linux](https://docs.docker.com/engine/install/#supported-platforms) systems. | ||
|
||
For CNFs, you must provide: | ||
* helm packages with an associated schema. These files must be on your disk and will be referenced in the `input.json` config file. | ||
* images for your CNF. For these you have the following options: | ||
- a reference to an existing Azure Container Registry which contains the images for your CNF. Currently, only one ACR and namespace is supported per CNF. The images to be copied from this ACR are populated automatically based on the helm package schema. You must have Reader/AcrPull permissions on this ACR. To use this option, fill in `source_registry` and optionally `source_registry_namespace` in the input.json file. | ||
- or, the image name of the source docker image from local machine. This is for a limited use case where the CNF only requires a single docker image which exists in the local docker repository. To use this option, fill in `source_local_docker_image` in the input.json file. This requires docker to be installed. | ||
* optionally, you can provide a file (on disk) path_to_mappings which is a copy of values.yaml with your chosen values replaced by deployment parameters, thus exposing them as parameters to the CNF. You can get this file auto-generated by leaving the value as a blank string, either having every value as a deployment parameter, or using `--interactive` to interactively choose. | ||
When filling in the input.json file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your input.json should look something like this: | ||
|
||
"helm_packages": [ | ||
{ | ||
"name": "A", | ||
"path_to_chart": "Path to package A", | ||
"path_to_mappings": "Path to package A mappings", | ||
"depends_on": [ | ||
"Names of the Helm packages this package depends on" | ||
] | ||
}, | ||
{ | ||
"name": "B", | ||
"path_to_chart": "Path to package B", | ||
"path_to_mappings": "Path to package B mappings", | ||
"depends_on": [ | ||
"Names of the Helm packages this package depends on" | ||
] | ||
}, | ||
|
||
##### Permissions for publishing CNFs | ||
If sourcing the CNF images from an existing ACR, you need to have `Reader`/`AcrPull` permissions | ||
from this ACR, and ideally, `Contributor` role + `AcrPush` role (or a custom role that allows the `importImage` action and `AcrPush`) over the whole subscription in order to be able to import to the new Artifact store. If you have these, you | ||
do not need docker to be installed locally, and the image copy is very quick. | ||
|
||
If you do not have the subscription-wide permissions then you can run the `az aosm nfd publish` command using the `--no-subscription-permissions` flag to pull the image to your local machine and then push it to the Artifact Store using manifest credentials scoped only to the store. This requires docker to be installed locally. | ||
|
||
#### NSDs | ||
For NSDs, you will need to have a Resource Group with a deployed Publisher, Artifact Store, Network Function Definition and Network Function Definition Version. You can use the `az aosm nfd` commands to create all of these resources. | ||
|
||
|
||
### Command examples | ||
|
||
#### Before you start | ||
`az login` to login to the Azure CLI. | ||
`az account set --subscription <subscription>` to choose the subscription you will work on. | ||
|
||
#### NFDs | ||
|
||
Get help on command arguments | ||
|
||
`az aosm -h` | ||
`az aosm nfd -h` | ||
`az aosm nfd build -h` | ||
etc... | ||
|
||
All these commands take a `--definition-type` argument of `vnf` or `cnf` | ||
|
||
Create an example config file for building a definition | ||
|
||
`az aosm nfd generate-config` | ||
|
||
This will output a file called `input.json` which must be filled in. | ||
Once the config file has been filled in the following commands can be run. | ||
|
||
Build an nfd definition locally | ||
|
||
`az aosm nfd build --config-file input.json` | ||
|
||
More options on building an nfd definition locally: | ||
|
||
Choose which of the VNF ARM template parameters you want to expose as NFD deploymentParameters, with the option of interactively choosing each one. | ||
|
||
`az aosm nfd build --config-file input.json --definition_type vnf --order_params` | ||
`az aosm nfd build --config-file input.json --definition_type vnf --order_params --interactive` | ||
|
||
Choose which of the CNF Helm values parameters you want to expose as NFD deploymentParameters. | ||
|
||
`az aosm nfd build --config-file input.json --definition_type cnf [--interactive]` | ||
|
||
Publish a pre-built definition | ||
|
||
`az aosm nfd publish --config-file input.json` | ||
|
||
Delete a published definition | ||
|
||
`az aosm nfd delete --config-file input.json` | ||
|
||
Delete a published definition and the publisher, artifact stores and NFD group | ||
|
||
`az aosm nfd delete --config-file input.json --clean` | ||
|
||
#### NSDs | ||
|
||
Get help on command arguments | ||
|
||
`az aosm -h` | ||
`az aosm nsd -h` | ||
`az aosm nsd build -h` | ||
etc... | ||
|
||
Create an example config file for building a definition | ||
|
||
`az aosm nsd generate-config` | ||
|
||
This will output a file called `input.json` which must be filled in. | ||
Once the config file has been filled in the following commands can be run. | ||
|
||
Build an nsd locally | ||
|
||
`az aosm nsd build --config-file input.json` | ||
|
||
Publish a pre-built design | ||
|
||
`az aosm nsd publish --config-file input.json` | ||
|
||
Delete a published design | ||
|
||
`az aosm nsd delete --config-file input.json` | ||
|
||
Delete a published design and the publisher, artifact stores and NSD group | ||
|
||
`az aosm nsd delete --config-file input.json --clean` | ||
|
||
## Bug Reporting | ||
|
||
It would be much appreciated if you could report these so that we're aware of them! | ||
|
||
Please see [Logging](#logging) for how to view and collect logs. | ||
|
||
Please describe what you are doing and if possible provide the input and output files. | ||
|
||
The (Microsoft internal) process for bug reporting during development is here: | ||
https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-technologies-organization/azure-for-operators/aiops/aiops-orchestration/aosm-product-docs/processes/bug_process | ||
|
||
CLI issues should be tagged and triaged as UX bugs. | ||
|
||
## Logging | ||
|
||
The CLI uses the standard Azure CLI logging mechanism. To enable logging to the console, you can use the following flags depending on the desired level of logging: | ||
- `--verbose` - This flag changes the logging level to Info and above. | ||
- `--debug` - This flag changes the logging level to Debug and above. | ||
- `--only-show-errors` - This flag changes the logging level to Error only, suppressing Warning. | ||
|
||
It is also possible to enable logging to file by running the following command: | ||
``` | ||
az config set logging.enable_log_file=true | ||
``` | ||
This will create a log file in the `~/.azure/logs` directory. | ||
|
||
**Note:** The above command will enable logging for all Azure CLI commands until the logging is disabled again by the user. Not disabling file logging could slow down the performance of the CLI. To disable file logging, run the following command: | ||
``` | ||
az config set logging.enable_log_file=false | ||
``` | ||
|
||
## Development | ||
Information about setting up and maintaining a development environment for this extension can be found [here](./development.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure.cli.core import AzCommandsLoader | ||
|
||
from azext_aosm._help import helps # pylint: disable=unused-import | ||
|
||
|
||
class AosmCommandsLoader(AzCommandsLoader): | ||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
|
||
aosm_custom = CliCommandType(operations_tmpl="azext_aosm.custom#{}") | ||
super().__init__(cli_ctx=cli_ctx, custom_command_type=aosm_custom) | ||
|
||
def load_command_table(self, args): | ||
from azext_aosm.commands import load_command_table | ||
|
||
load_command_table(self, args) | ||
return self.command_table | ||
|
||
def load_arguments(self, command): | ||
from azext_aosm._params import load_arguments | ||
|
||
load_arguments(self, command) | ||
|
||
|
||
COMMAND_LOADER_CLS = AosmCommandsLoader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
from azure.cli.core.profiles import ResourceType | ||
from azure.mgmt.containerregistry import ContainerRegistryManagementClient | ||
|
||
from .vendored_sdks import HybridNetworkManagementClient | ||
|
||
|
||
def cf_aosm(cli_ctx, *_) -> HybridNetworkManagementClient: | ||
# By default, get_mgmt_service_client() sets a parameter called 'base_url' when creating | ||
# the client. For us, doing so results in a key error. Setting base_url_bound=False prevents | ||
# that from happening | ||
return get_mgmt_service_client(cli_ctx, HybridNetworkManagementClient, base_url_bound=False) | ||
|
||
|
||
def cf_resources(cli_ctx, subscription_id=None): | ||
return get_mgmt_service_client( | ||
cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id | ||
) | ||
|
||
|
||
def cf_features(cli_ctx, subscription_id=None): | ||
"""Return the client for checking feature enablement.""" | ||
return get_mgmt_service_client( | ||
cli_ctx, ResourceType.MGMT_RESOURCE_FEATURES, subscription_id=subscription_id | ||
) | ||
|
||
|
||
def cf_acr_registries(cli_ctx, *_) -> ContainerRegistryManagementClient: | ||
""" | ||
Returns the client for managing container registries. | ||
|
||
:param cli_ctx: CLI context | ||
:return: ContainerRegistryManagementClient object | ||
""" | ||
return get_mgmt_service_client( | ||
cli_ctx, ResourceType.MGMT_CONTAINERREGISTRY | ||
).registries |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to modify this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter complained about the existing format (inline comments and missing commas), so it was modified to keep the linter happy. But you're right, this isn't our file to worry about, so I've reverted it to how it was.