Skip to content

Commit

Permalink
Merge pull request #2 from Azure/master
Browse files Browse the repository at this point in the history
Synced with the official repo
  • Loading branch information
ShichaoQiu committed Feb 9, 2021
2 parents 66ece98 + f87fc18 commit 59f14da
Show file tree
Hide file tree
Showing 144 changed files with 28,522 additions and 9,763 deletions.
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

/src/databricks/ @fengzhou-msft @bim-msft

/src/powerbidedicated/ @Juliehzl
/src/powerbidedicated/ @Juliehzl @tarostok @evelyn-ys

/src/blueprint/ @fengzhou-msft

Expand Down Expand Up @@ -177,3 +177,5 @@
/src/providerhub/ @wwendyc @vikashj

/src/cosmosdb-preview/ @wmengmsft @MehaKaushik @kavskalyan

/src/ad/ @evelyn-ys
8 changes: 8 additions & 0 deletions src/ad/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

0.1.0
++++++
* Initial release.
48 changes: 48 additions & 0 deletions src/ad/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Azure CLI ad Extension #
This is the extension for ad

### How to use ###
Install this extension using the below CLI command
```
az extension add --name ad
```

### Included Features ###
#### ad ds ####
##### Create #####
```
az ad ds create --domain "TestDomainService.com" --ntlm-v1 "Enabled" --sync-ntlm-passwords "Enabled" \
--tls-v1 "Disabled" --filtered-sync "Enabled" --external-access "Enabled" --ldaps "Enabled" \
--pfx-certificate "MIIDPDCCAiSgAwIBAgIQQUI9P6tq2p9OFIJa7DLNvTANBgkqhkiG9w0BAQsFADAgMR4w..." \
--pfx-certificate-password "<pfxCertificatePassword>" \
--additional-recipients "jicha@microsoft.com" "caalmont@microsoft.com" --notify-dc-admins "Enabled" \
--notify-global-admins "Enabled" \
--replica-sets location="West US" subnet-id="/subscriptions/1639790a-76a2-4ac4-98d9-8562f5dfcb4d/resourceGroups/TestNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/TestVnetWUS/subnets/TestSubnetWUS" \
--name "TestDomainService.com" --resource-group "TestResourceGroup"
az ad ds wait --created --name "{myDomainService}" --resource-group "{rg}"
```
##### Show #####
```
az ad ds show --name "TestDomainService.com" --resource-group "TestResourceGroup"
```
##### List #####
```
az ad ds list --resource-group "TestResourceGroup"
```
##### Update #####
```
az ad ds update --ntlm-v1 "Enabled" --sync-ntlm-passwords "Enabled" --tls-v1 "Disabled" --filtered-sync "Enabled" \
--external-access "Enabled" --ldaps "Enabled" \
--pfx-certificate "MIIDPDCCAiSgAwIBAgIQQUI9P6tq2p9OFIJa7DLNvTANBgkqhkiG9w0BAQsFADAgMR4w..." \
--pfx-certificate-password "<pfxCertificatePassword>" \
--additional-recipients "jicha@microsoft.com" "caalmont@microsoft.com" --notify-dc-admins "Enabled" \
--notify-global-admins "Enabled" \
--replica-sets location="West US" subnet-id="/subscriptions/1639790a-76a2-4ac4-98d9-8562f5dfcb4d/resourceGroups/TestNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/TestVnetWUS/subnets/TestSubnetWUS" \
--replica-sets location="East US" subnet-id="/subscriptions/1639790a-76a2-4ac4-98d9-8562f5dfcb4d/resourceGroups/TestNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/TestVnetEUS/subnets/TestSubnetEUS" \
--name "TestDomainService.com" --resource-group "TestResourceGroup"
```
##### Delete #####
```
az ad ds delete --name "TestDomainService.com" --resource-group "TestResourceGroup"
```
50 changes: 50 additions & 0 deletions src/ad/azext_ad/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_ad.generated._help import helps # pylint: disable=unused-import
try:
from azext_ad.manual._help import helps # pylint: disable=reimported
except ImportError:
pass


class DomainServicesResourceProviderCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_ad.generated._client_factory import cf_ad_cl
ad_custom = CliCommandType(
operations_tmpl='azext_ad.custom#{}',
client_factory=cf_ad_cl)
parent = super(DomainServicesResourceProviderCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=ad_custom)

def load_command_table(self, args):
from azext_ad.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_ad.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table

def load_arguments(self, command):
from azext_ad.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_ad.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = DomainServicesResourceProviderCommandsLoader
17 changes: 17 additions & 0 deletions src/ad/azext_ad/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError:
pass
3 changes: 3 additions & 0 deletions src/ad/azext_ad/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"azext.minCliCoreVersion": "2.15.0"
}
17 changes: 17 additions & 0 deletions src/ad/azext_ad/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError:
pass
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,4 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.paging import Paged


class OperationPaged(Paged):
"""
A paging container for iterating over a list of :class:`Operation <azure.mgmt.timeseriesinsights.models.Operation>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[Operation]'}
}

def __init__(self, *args, **kwargs):

super(OperationPaged, self).__init__(*args, **kwargs)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
20 changes: 20 additions & 0 deletions src/ad/azext_ad/generated/_client_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_ad_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_ad.vendored_sdks.domainservices import DomainServicesResourceProvider
return get_mgmt_service_client(cli_ctx,
DomainServicesResourceProvider)


def cf_domain_service(cli_ctx, *_):
return cf_ad_cl(cli_ctx).domain_services
148 changes: 148 additions & 0 deletions src/ad/azext_ad/generated/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=too-many-lines

from knack.help_files import helps


helps['ad ds'] = """
type: group
short-summary: Manage domain service with ad
"""

helps['ad ds list'] = """
type: command
short-summary: "The List Domain Services in Resource Group operation lists all the domain services available under \
the given resource group. And The List Domain Services in Subscription operation lists all the domain services \
available under the given subscription (and across all resource groups within that subscription)."
examples:
- name: List Domain Service By Group
text: |-
az ad ds list --resource-group "TestResourceGroup"
- name: List Domain Service By Sub
text: |-
az ad ds list
"""

helps['ad ds show'] = """
type: command
short-summary: "The Get Domain Service operation retrieves a json representation of the Domain Service."
examples:
- name: Get Domain Service
text: |-
az ad ds show --name "TestDomainService.com" --resource-group "TestResourceGroup"
"""

helps['ad ds create'] = """
type: command
short-summary: "The Create Domain Service operation creates a new domain service with the specified parameters. If \
the specific service already exists, then any patchable properties will be updated and any immutable properties will \
remain unchanged."
parameters:
- name: --replica-sets
short-summary: "List of ReplicaSets"
long-summary: |
Usage: --replica-sets location=XX subnet-id=XX
location: Virtual network location
subnet-id: The name of the virtual network that Domain Services will be deployed on. The id of the subnet \
that Domain Services will be deployed on. /virtualNetwork/vnetName/subnets/subnetName.
Multiple actions can be specified by using more than one --replica-sets argument.
- name: --settings
short-summary: "List of settings for Resource Forest"
long-summary: |
Usage: --settings trusted-domain-fqdn=XX trust-direction=XX friendly-name=XX remote-dns-ips=XX \
trust-password=XX
trusted-domain-fqdn: Trusted Domain FQDN
trust-direction: Trust Direction
friendly-name: Friendly Name
remote-dns-ips: Remote Dns ips
trust-password: Trust Password
Multiple actions can be specified by using more than one --settings argument.
examples:
- name: Create Domain Service
text: |-
az ad ds create --domain "TestDomainService.com" --ntlm-v1 "Enabled" --sync-ntlm-pwd "Enabled" --tls-v1 \
"Disabled" --filtered-sync "Enabled" --external-access "Enabled" --ldaps "Enabled" --pfx-cert \
"MIIDPDCCAiSgAwIBAgIQQUI9P6tq2p9OFIJa7DLNvTANBgkqhkiG9w0BAQsFADAgMR4w..." --pfx-cert-pwd "<pfxCertificatePassword>" \
--notify-others "jicha@microsoft.com" "caalmont@microsoft.com" --notify-dc-admins "Enabled" --notify-global-admins \
"Enabled" --replica-sets location="West US" subnet-id="/subscriptions/1639790a-76a2-4ac4-98d9-8562f5dfcb4d/resourceGrou\
ps/TestNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/TestVnetWUS/subnets/TestSubnetWUS" --name \
"TestDomainService.com" --resource-group "TestResourceGroup"
"""

helps['ad ds update'] = """
type: command
short-summary: "The Update Domain Service operation can be used to update the existing deployment. The update call \
only supports the properties listed in the PATCH body."
parameters:
- name: --replica-sets
short-summary: "List of ReplicaSets"
long-summary: |
Usage: --replica-sets location=XX subnet-id=XX
location: Virtual network location
subnet-id: The name of the virtual network that Domain Services will be deployed on. The id of the subnet \
that Domain Services will be deployed on. /virtualNetwork/vnetName/subnets/subnetName.
Multiple actions can be specified by using more than one --replica-sets argument.
- name: --settings
short-summary: "List of settings for Resource Forest"
long-summary: |
Usage: --settings trusted-domain-fqdn=XX trust-direction=XX friendly-name=XX remote-dns-ips=XX \
trust-password=XX
trusted-domain-fqdn: Trusted Domain FQDN
trust-direction: Trust Direction
friendly-name: Friendly Name
remote-dns-ips: Remote Dns ips
trust-password: Trust Password
Multiple actions can be specified by using more than one --settings argument.
examples:
- name: Update Domain Service
text: |-
az ad ds update --ntlm-v1 "Enabled" --sync-ntlm-pwd "Enabled" --tls-v1 "Disabled" --filtered-sync \
"Enabled" --external-access "Enabled" --ldaps "Enabled" --pfx-cert "MIIDPDCCAiSgAwIBAgIQQUI9P6tq2p9OFIJa7DLNvTANBgkqhki\
G9w0BAQsFADAgMR4w..." --pfx-cert-pwd "<pfxCertificatePassword>" --notify-others "jicha@microsoft.com" \
"caalmont@microsoft.com" --notify-dc-admins "Enabled" --notify-global-admins "Enabled" --replica-sets location="West \
US" subnet-id="/subscriptions/1639790a-76a2-4ac4-98d9-8562f5dfcb4d/resourceGroups/TestNetworkResourceGroup/providers/Mi\
crosoft.Network/virtualNetworks/TestVnetWUS/subnets/TestSubnetWUS" --replica-sets location="East US" \
subnet-id="/subscriptions/1639790a-76a2-4ac4-98d9-8562f5dfcb4d/resourceGroups/TestNetworkResourceGroup/providers/Micros\
oft.Network/virtualNetworks/TestVnetEUS/subnets/TestSubnetEUS" --name "TestDomainService.com" --resource-group \
"TestResourceGroup"
"""

helps['ad ds delete'] = """
type: command
short-summary: "The Delete Domain Service operation deletes an existing Domain Service."
examples:
- name: Delete Domain Service
text: |-
az ad ds delete --name "TestDomainService.com" --resource-group "TestResourceGroup"
"""

helps['ad ds wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the ad ds is met.
examples:
- name: Pause executing next line of CLI script until the ad ds is successfully created.
text: |-
az ad ds wait --name "TestDomainService.com" --resource-group "TestResourceGroup" --created
- name: Pause executing next line of CLI script until the ad ds is successfully updated.
text: |-
az ad ds wait --name "TestDomainService.com" --resource-group "TestResourceGroup" --updated
- name: Pause executing next line of CLI script until the ad ds is successfully deleted.
text: |-
az ad ds wait --name "TestDomainService.com" --resource-group "TestResourceGroup" --deleted
"""
Loading

0 comments on commit 59f14da

Please sign in to comment.