Пример #1
0
 def __init__(self):
     self.config = KeyVaultSampleConfig()
     self.credentials = None
     self.keyvault_data_client = None
     self.keyvault_mgmt_client = None
     self.resource_mgmt_client = None
     self._setup_complete = False
     self._haikunator = Haikunator()
 def __init__(self):
     self.config = KeyVaultSampleConfig()
     self.credentials = None
     self.keyvault_data_client = None
     self.keyvault_mgmt_client = None
     self.resource_mgmt_client = None
     self._setup_complete = False
     self.samples = {(name, m) for name, m in inspect.getmembers(self) if getattr(m, 'kv_sample', False)}
     models = {}
     models.update({k: v for k, v in azure.keyvault.models.__dict__.items() if isinstance(v, type)})
     models.update({k: v for k, v in azure.mgmt.keyvault.models.__dict__.items() if isinstance(v, type)})
     self._serializer = Serializer(models)
Пример #3
0
        default=None,
        help='the object id of the service principal to run the sample')
    parser.add_argument(
        '--client-secret',
        dest='client_secret',
        type=str,
        default=None,
        help=
        'the authentication secret of the service principal to run the sample')
    parser.add_argument('--samples',
                        nargs='*',
                        type=str,
                        help='names of specific samples to run')
    args = parser.parse_args()

    config = KeyVaultSampleConfig()

    if args.tenant_id:
        config.tenant_id = args.tenant_id
    if args.subscription_id:
        config.subscription_id = args.subscription_id
    if args.client_id:
        config.client_id = args.client_id
    if args.client_oid:
        config.client_oid = args.client_oid
    if args.client_secret:
        config.client_secret = args.client_secret

    run_all_samples([AuthenticationSample(config=config)],
                    requested=args.samples or [])
Пример #4
0
 def __init__(self):
     self.config = KeyVaultSampleConfig()
     self.keyvault_mgmt_client = None
     self.resource_mgmt_client = None
     self._setup_complete = False
     self.samples = {(name, m) for name, m in inspect.getmembers(self) if getattr(m, 'kv_sample', False)}