id
int64 0
843k
| repository_name
stringlengths 7
55
| file_path
stringlengths 9
332
| class_name
stringlengths 3
290
| human_written_code
stringlengths 12
4.36M
| class_skeleton
stringlengths 19
2.2M
| total_program_units
int64 1
9.57k
| total_doc_str
int64 0
4.2k
| AvgCountLine
float64 0
7.89k
| AvgCountLineBlank
float64 0
300
| AvgCountLineCode
float64 0
7.89k
| AvgCountLineComment
float64 0
7.89k
| AvgCyclomatic
float64 0
130
| CommentToCodeRatio
float64 0
176
| CountClassBase
float64 0
48
| CountClassCoupled
float64 0
589
| CountClassCoupledModified
float64 0
581
| CountClassDerived
float64 0
5.37k
| CountDeclInstanceMethod
float64 0
4.2k
| CountDeclInstanceVariable
float64 0
299
| CountDeclMethod
float64 0
4.2k
| CountDeclMethodAll
float64 0
4.2k
| CountLine
float64 1
115k
| CountLineBlank
float64 0
9.01k
| CountLineCode
float64 0
94.4k
| CountLineCodeDecl
float64 0
46.1k
| CountLineCodeExe
float64 0
91.3k
| CountLineComment
float64 0
27k
| CountStmt
float64 1
93.2k
| CountStmtDecl
float64 0
46.1k
| CountStmtExe
float64 0
90.2k
| MaxCyclomatic
float64 0
759
| MaxInheritanceTree
float64 0
16
| MaxNesting
float64 0
34
| SumCyclomatic
float64 0
6k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,100 |
Auzzy/1846-routes
|
Auzzy_1846-routes/routes1846/boardtile.py
|
routes1846.boardtile.EastTerminalCity
|
class EastTerminalCity(TerminalCity):
def __init__(self, name, cell, paths, neighbors, value_dict, port_value, meat_value):
super(EastTerminalCity, self).__init__(name, cell, paths, neighbors, value_dict, port_value, meat_value)
self.bonus = value_dict["bonus"]
def value(self, railroad, phase, east_to_west=False):
return super(EastTerminalCity, self).value(railroad, phase) + (self.bonus if east_to_west else 0)
|
class EastTerminalCity(TerminalCity):
def __init__(self, name, cell, paths, neighbors, value_dict, port_value, meat_value):
pass
def value(self, railroad, phase, east_to_west=False):
pass
| 3 | 0 | 3 | 1 | 3 | 0 | 2 | 0 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 12 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 2 | 3 | 0 | 3 |
8,101 |
Auzzy/1846-routes
|
Auzzy_1846-routes/routes1846/tokens.py
|
routes1846.tokens.SeaportToken
|
class SeaportToken(PrivateCompanyToken):
pass
|
class SeaportToken(PrivateCompanyToken):
pass
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
8,102 |
Avsecz/kopt
|
Avsecz_kopt/kopt/hyopt.py
|
kopt.hyopt.CompileFN
|
class CompileFN():
"""Compile an objective function that
- trains the model on the training set
- evaluates the model on the validation set
- reports the performance metric on the validation set as the objective loss
# Arguments
db_name: Database name of the KMongoTrials.
exp_name: Experiment name of the KMongoTrials.
data_fn: Tuple containing training data as the x,y pair at the first (index=0) element:
`((train_x, test_y), ...)`. If `valid_split` and `cv_n_folds` are both `None`,
the second (index=1) tuple is used as the validation dataset.
add_eval_metrics: Additional list of (global) evaluation
metrics. Individual elements can be
a string (referring to kopt.eval_metrics)
or a function taking two numpy arrays: `y_true`, `y_pred`.
These metrics are ment to supplement those specified in
`model.compile(.., metrics = .)`.
optim_metric: str; Metric to optimize. Must be in
`add_eval_metrics` or `model.metrics_names`.
optim_metric_mode: one of {min, max}. In `min` mode,
training will stop when the optimized metric
monitored has stopped decreasing; in `max`
mode it will stop when the optimized metric
monitored has stopped increasing; in `auto`
mode, the direction is automatically inferred
from the name of the optimized metric.
valid_split: Fraction of the training points to use for the validation. If set to None,
the second element returned by data_fn is used as the validation dataset.
cv_n_folds: If not None, use cross-validation with `cv_n_folds`-folds instead of train, validation split.
Overrides `valid_split` and `use_data_fn_valid`.
stratified: boolean. If True, use stratified data splitting in train-validation split or cross-validation.
random_state: Random seed for performing data-splits.
use_tensorboard: If True, tensorboard callback is used. Each trial is written into a separate `log_dir`.
save_model: It not None, the trained model is saved to the `save_dir` directory as hdf5 file.
If save_model="best", save the best model using `keras.callbacks.ModelCheckpoint`, and
if save_model="last", save the model after training it.
save_results: If True, the return value is saved as .json to the `save_dir` directory.
save_dir: Path to the save directory.
custom_objects: argument passed to load_model - Optional dictionary mapping names (strings) to
custom classes or functions to be considered during deserialization.
"""
# TODO - check if we can get (db_name, exp_name) from hyperopt
def __init__(self, db_name, exp_name,
data_fn,
model_fn,
# validation metric
add_eval_metrics=[],
optim_metric="loss", # val_loss
optim_metric_mode="min",
# validation split
valid_split=.2,
cv_n_folds=None,
stratified=False,
random_state=None,
# saving
use_tensorboard=False,
save_model="best",
save_results=True,
save_dir=save_dir(),
custom_objects=None,
**kwargs
):
self.data_fn = data_fn
self.model_fn = model_fn
assert isinstance(add_eval_metrics, (list, tuple, set, dict))
if isinstance(add_eval_metrics, dict):
self.add_eval_metrics = {k: _get_ce_fun(v) for k, v in add_eval_metrics.items()}
else:
self.add_eval_metrics = {_to_string(fn_str): _get_ce_fun(fn_str)
for fn_str in add_eval_metrics}
assert isinstance(optim_metric, str)
# backcompatibility:
# allow only "loss_metric" and "loss_metric_mode" to be passed in kwargs
if "loss_metric" in kwargs and optim_metric == "loss":
optim_metric = kwargs["loss_metric"]
if "loss_metric_mode" in kwargs and optim_metric_mode == "min":
optim_metric_mode = kwargs["loss_metric_mode"]
possible_kwargs = ["loss_metric", "loss_metric_mode"]
add_arguments = set(kwargs.keys()).difference(possible_kwargs)
if len(add_arguments) > 0:
raise ValueError("Unknown argument(s) {0}. **kwargs accepts only arguments: {1}. ".
format(add_arguments, possible_kwargs))
self.optim_metric = optim_metric
assert optim_metric_mode in ["min", "max"]
self.optim_metric_mode = optim_metric_mode
self.data_name = data_fn.__name__
self.model_name = model_fn.__name__
self.db_name = db_name
self.exp_name = exp_name
# validation
self.valid_split = valid_split
self.cv_n_folds = cv_n_folds
self.stratified = stratified
self.random_state = random_state
# saving
self.use_tensorboard = use_tensorboard
self.save_dir = save_dir
self.save_model = save_model if save_model is not None else ""
self.save_results = save_results
# loading
self.custom_objects = custom_objects
# backcompatibility
if self.save_model is True:
self.save_model = "last"
elif self.save_model is False:
self.save_model = ""
assert self.save_model in ["", "last", "best"]
@property
def save_dir_exp(self):
return self.save_dir + "/{db}/{exp}/".format(db=self.db_name, exp=self.exp_name)
def _assert_optim_metric(self, model):
model_metrics = _listify(model.metrics_names)
eval_metrics = list(self.add_eval_metrics.keys())
if self.optim_metric not in model_metrics + eval_metrics:
raise ValueError("optim_metric: '{0}' not in ".format(self.optim_metric) +
"either sets of the losses: \n" +
"model.metrics_names: {0}\n".format(model_metrics) +
"add_eval_metrics: {0}".format(eval_metrics))
def __call__(self, param):
time_start = datetime.now()
# set default early-stop parameters
if param.get("fit") is None:
param["fit"] = {}
if param["fit"].get("epochs") is None:
param["fit"]["epochs"] = 500
# TODO - cleanup callback parameters
# - callbacks/early_stop/patience...
if param["fit"].get("patience") is None:
param["fit"]["patience"] = 10
if param["fit"].get("batch_size") is None:
param["fit"]["batch_size"] = 32
if param["fit"].get("early_stop_monitor") is None:
param["fit"]["early_stop_monitor"] = "val_loss"
callbacks = [EarlyStopping(monitor=param["fit"]["early_stop_monitor"],
patience=param["fit"]["patience"])]
# setup paths for storing the data - TODO check if we can somehow get the id from hyperopt
rid = str(uuid4())
tm_dir = self.save_dir_exp + "/train_models/"
if not os.path.exists(tm_dir):
os.makedirs(tm_dir)
model_path = tm_dir + "{0}.h5".format(rid) if self.save_model else ""
results_path = tm_dir + "{0}.json".format(rid) if self.save_results else ""
if self.use_tensorboard:
max_len = 240 - len(rid) - 1
param_string = _dict_to_filestring(_flatten_dict_ignore(param))[:max_len] + ";" + rid
tb_dir = self.save_dir_exp + "/tensorboard/" + param_string[:240]
callbacks += [TensorBoard(log_dir=tb_dir,
histogram_freq=0, # TODO - set to some number afterwards
write_graph=False,
write_images=True)]
# -----------------
# get data
logger.info("Load data...")
data = get_data(self.data_fn, param)
train = data[0]
if self.cv_n_folds is None and self.valid_split is None:
valid_data = data[1]
del data
time_data_loaded = datetime.now()
# train & evaluate the model
if self.cv_n_folds is None:
# no cross-validation
model = get_model(self.model_fn, train, param)
print(_listify(model.metrics_names))
self._assert_optim_metric(model)
if self.valid_split is not None:
train_idx, valid_idx = split_train_test_idx(train,
self.valid_split,
self.stratified,
self.random_state)
train_data = subset(train, train_idx)
valid_data = subset(train, valid_idx)
else:
train_data = train
c_callbacks = deepcopy(callbacks)
if self.save_model == "best":
c_callbacks += [ModelCheckpoint(model_path,
monitor=param["fit"]["early_stop_monitor"],
save_best_only=True)]
eval_metrics, history = _train_and_eval_single(train=train_data,
valid=valid_data,
model=model,
epochs=param["fit"]["epochs"],
batch_size=param["fit"]["batch_size"],
use_weight=param["fit"].get("use_weight", False),
callbacks=c_callbacks,
eval_best=self.save_model == "best",
add_eval_metrics=self.add_eval_metrics,
custom_objects=self.custom_objects)
if self.save_model == "last":
model.save(model_path)
else:
# cross-validation
eval_metrics_list = []
history = []
for i, (train_idx, valid_idx) in enumerate(split_KFold_idx(train,
self.cv_n_folds,
self.stratified,
self.random_state)):
logger.info("Fold {0}/{1}".format(i + 1, self.cv_n_folds))
model = get_model(self.model_fn, subset(train, train_idx), param)
self._assert_optim_metric(model)
c_model_path = model_path.replace(".h5", "_fold_{0}.h5".format(i))
c_callbacks = deepcopy(callbacks)
if self.save_model == "best":
c_callbacks += [ModelCheckpoint(c_model_path,
monitor=param["fit"]["early_stop_monitor"],
save_best_only=True)]
eval_m, history_elem = _train_and_eval_single(train=subset(train, train_idx),
valid=subset(train, valid_idx),
model=model,
epochs=param["fit"]["epochs"],
batch_size=param["fit"]["batch_size"],
use_weight=param["fit"].get("use_weight", False),
callbacks=c_callbacks,
eval_best=self.save_model == "best",
add_eval_metrics=self.add_eval_metrics,
custom_objects=self.custom_objects)
print("\n")
eval_metrics_list.append(eval_m)
history.append(history_elem)
if self.save_model == "last":
model.save(c_model_path)
# summarize metrics - take average accross folds
eval_metrics = _mean_dict(eval_metrics_list)
# get loss from eval_metrics
loss = eval_metrics[self.optim_metric]
if self.optim_metric_mode == "max":
loss = - loss # loss should get minimized
time_end = datetime.now()
ret = {"loss": loss,
"status": STATUS_OK,
"eval": eval_metrics,
# additional info
"param": param,
"path": {
"model": model_path,
"results": results_path,
},
"name": {
"data": self.data_name,
"model": self.model_name,
"optim_metric": self.optim_metric,
"optim_metric_mode": self.optim_metric,
},
"history": history,
# execution times
"time": {
"start": str(time_start),
"end": str(time_end),
"duration": {
"total": (time_end - time_start).total_seconds(), # in seconds
"dataload": (time_data_loaded - time_start).total_seconds(),
"training": (time_end - time_data_loaded).total_seconds(),
}}}
# optionally save information to disk
if results_path:
write_json(ret, results_path)
logger.info("Done!")
return ret
|
class CompileFN():
'''Compile an objective function that
- trains the model on the training set
- evaluates the model on the validation set
- reports the performance metric on the validation set as the objective loss
# Arguments
db_name: Database name of the KMongoTrials.
exp_name: Experiment name of the KMongoTrials.
data_fn: Tuple containing training data as the x,y pair at the first (index=0) element:
`((train_x, test_y), ...)`. If `valid_split` and `cv_n_folds` are both `None`,
the second (index=1) tuple is used as the validation dataset.
add_eval_metrics: Additional list of (global) evaluation
metrics. Individual elements can be
a string (referring to kopt.eval_metrics)
or a function taking two numpy arrays: `y_true`, `y_pred`.
These metrics are ment to supplement those specified in
`model.compile(.., metrics = .)`.
optim_metric: str; Metric to optimize. Must be in
`add_eval_metrics` or `model.metrics_names`.
optim_metric_mode: one of {min, max}. In `min` mode,
training will stop when the optimized metric
monitored has stopped decreasing; in `max`
mode it will stop when the optimized metric
monitored has stopped increasing; in `auto`
mode, the direction is automatically inferred
from the name of the optimized metric.
valid_split: Fraction of the training points to use for the validation. If set to None,
the second element returned by data_fn is used as the validation dataset.
cv_n_folds: If not None, use cross-validation with `cv_n_folds`-folds instead of train, validation split.
Overrides `valid_split` and `use_data_fn_valid`.
stratified: boolean. If True, use stratified data splitting in train-validation split or cross-validation.
random_state: Random seed for performing data-splits.
use_tensorboard: If True, tensorboard callback is used. Each trial is written into a separate `log_dir`.
save_model: It not None, the trained model is saved to the `save_dir` directory as hdf5 file.
If save_model="best", save the best model using `keras.callbacks.ModelCheckpoint`, and
if save_model="last", save the model after training it.
save_results: If True, the return value is saved as .json to the `save_dir` directory.
save_dir: Path to the save directory.
custom_objects: argument passed to load_model - Optional dictionary mapping names (strings) to
custom classes or functions to be considered during deserialization.
'''
def __init__(self, db_name, exp_name,
data_fn,
model_fn,
# validation metric
add_eval_metrics=[],
optim_metric="loss", # val_loss
optim_metric_mode="min",
# validation split
valid_split=.2,
cv_n_folds=None,
stratified=False,
random_state=None,
# saving
use_tensorboard=False,
save_model="best",
save_results=True,
save_dir=save_dir(),
custom_objects=None,
**kwargs
):
pass
@property
def save_dir_exp(self):
pass
def _assert_optim_metric(self, model):
pass
def __call__(self, param):
pass
| 6 | 1 | 59 | 4 | 49 | 7 | 8 | 0.35 | 0 | 8 | 0 | 0 | 4 | 18 | 4 | 4 | 283 | 23 | 196 | 69 | 174 | 68 | 116 | 52 | 111 | 20 | 0 | 3 | 31 |
8,103 |
Avsecz/kopt
|
Avsecz_kopt/kopt/hyopt.py
|
kopt.hyopt.KMongoTrials
|
class KMongoTrials(MongoTrials):
"""`hyperopt.MonoTrials` extended with the following methods:
- get_trial(tid) - Retrieve trial by tid (Trial ID).
- get_param(tid) - Retrieve used hyper-parameters for a trial.
- best_trial_tid(rank=0) - Return the trial with lowest loss.
- rank - rank=0 means the best model, rank=1 means second best, ...
- optimal_epochs(tid) - Number of optimal epochs (after early-stopping)
- delete_running(timeout_last_refresh=0, dry_run=False) - Delete jobs stalled in the running state for too long
- timeout_last_refresh, int: number of seconds
- dry_run, bool: If True, just simulate the removal but don't actually perform it.
- valid_tid() - List all valid tid's
- train_history(tid=None) - Get train history as pd.DataFrame with columns: `(epoch, loss, val_loss, ...)`
- tid: Trial ID or list of trial ID's. If None, report for all trial ID's.
- get_ok_results - Return a list of trial results with an "ok" status
- load_model(tid) - Load a Keras model of a tid.
- as_df - Returns a tidy `pandas.DataFrame` of the trials database.
# Arguments
db_name: str, MongoTrials database name
exp_name: strm, MongoTrials experiment name
ip: str, MongoDB IP address.
port: int, MongoDB port.
kill_timeout: int, Maximum runtime of a job (in seconds) before it gets killed. None for infinite.
**kwargs: Additional keyword arguments passed to the `hyperopt.MongoTrials` constructor.
"""
def __init__(self, db_name, exp_name,
ip=db_host(), port=db_port(), kill_timeout=None, **kwargs):
self.kill_timeout = kill_timeout
if self.kill_timeout is not None and self.kill_timeout < 60:
logger.warning("kill_timeout < 60 -> Very short time for " +
"each job to complete before it gets killed!")
super(KMongoTrials, self).__init__(
'mongo://{ip}:{p}/{n}/jobs'.format(ip=ip, p=port, n=db_name), exp_key=exp_name, **kwargs)
def get_trial(self, tid):
"""Retrieve trial by tid
"""
lid = np.where(np.array(self.tids) == tid)[0][0]
return self.trials[lid]
def get_param(self, tid):
# TODO - return a dictionary - add .to_dict()
return self.get_trial(tid)["result"]["param"]
def best_trial_tid(self, rank=0):
"""Get tid of the best trial
rank=0 means the best model
rank=1 means second best
...
"""
candidates = [t for t in self.trials
if t['result']['status'] == STATUS_OK]
if len(candidates) == 0:
return None
losses = [float(t['result']['loss']) for t in candidates]
assert not np.any(np.isnan(losses))
lid = np.where(np.argsort(losses).argsort() == rank)[0][0]
return candidates[lid]["tid"]
def optimal_epochs(self, tid):
trial = self.get_trial(tid)
patience = trial["result"]["param"]["fit"]["patience"]
epochs = trial["result"]["param"]["fit"]["epochs"]
def optimal_len(hist):
c_epoch = max(hist["loss"]["epoch"]) + 1
if c_epoch == epochs:
return epochs
else:
return c_epoch - patience
hist = trial["result"]["history"]
if isinstance(hist, list):
return int(np.floor(np.array([optimal_len(h) for h in hist]).mean()))
else:
return optimal_len(hist)
# def refresh(self):
# """Extends the original object
# """
# self.refresh_tids(None)
# if self.kill_timeout is not None:
# # TODO - remove dry_run
# self.delete_running(self.kill_timeout, dry_run=True)
def count_by_state_unsynced(self, arg):
"""Extends the original object in order to inject checking
for stalled jobs and killing them if they are running for too long
"""
if self.kill_timeout is not None:
self.delete_running(self.kill_timeout)
return super(KMongoTrials, self).count_by_state_unsynced(arg)
def delete_running(self, timeout_last_refresh=0, dry_run=False):
"""Delete jobs stalled in the running state for too long
timeout_last_refresh, int: number of seconds
"""
running_all = self.handle.jobs_running()
running_timeout = [job for job in running_all
if coarse_utcnow() > job["refresh_time"] +
timedelta(seconds=timeout_last_refresh)]
if len(running_timeout) == 0:
# Nothing to stop
self.refresh_tids(None)
return None
if dry_run:
logger.warning("Dry run. Not removing anything.")
logger.info("Removing {0}/{1} running jobs. # all jobs: {2} ".
format(len(running_timeout), len(running_all), len(self)))
now = coarse_utcnow()
logger.info("Current utc time: {0}".format(now))
logger.info("Time horizont: {0}".format(now - timedelta(seconds=timeout_last_refresh)))
for job in running_timeout:
logger.info("Removing job: ")
pjob = job.to_dict()
del pjob["misc"] # ignore misc when printing
logger.info(pprint.pformat(pjob))
if not dry_run:
self.handle.delete(job)
logger.info("Job deleted")
self.refresh_tids(None)
# def delete_trial(self, tid):
# trial = self.get_trial(tid)
# return self.handle.delete(trial)
def valid_tid(self):
"""List all valid tid's
"""
return [t["tid"] for t in self.trials if t["result"]["status"] == "ok"]
def train_history(self, tid=None):
"""Get train history as pd.DataFrame
"""
def result2history(result):
if isinstance(result["history"], list):
return pd.concat([pd.DataFrame(hist["loss"]).assign(fold=i)
for i, hist in enumerate(result["history"])])
else:
return pd.DataFrame(result["history"]["loss"])
# use all
if tid is None:
tid = self.valid_tid()
res = [result2history(t["result"]).assign(tid=t["tid"]) for t in self.trials
if t["tid"] in _listify(tid)]
df = pd.concat(res)
# reorder columns
fold_name = ["fold"] if "fold" in df else []
df = _put_first(df, ["tid"] + fold_name + ["epoch"])
return df
def plot_history(self, tid, scores=["loss", "f1", "accuracy"],
figsize=(15, 3)):
"""Plot the loss curves"""
history = self.train_history(tid)
import matplotlib.pyplot as plt
fig = plt.figure(figsize=figsize)
for i, score in enumerate(scores):
plt.subplot(1, len(scores), i + 1)
plt.tight_layout()
plt.plot(history[score], label="train")
plt.plot(history['val_' + score], label="validation")
plt.title(score)
plt.ylabel(score)
plt.xlabel('epoch')
plt.legend(loc='best')
return fig
def load_model(self, tid, custom_objects=None):
"""Load saved keras model of the trial.
If tid = None, get the best model
Not applicable for trials ran in cross validion (i.e. not applicable
for `CompileFN.cv_n_folds is None`
"""
if tid is None:
tid = self.best_trial_tid()
model_path = self.get_trial(tid)["result"]["path"]["model"]
return load_model(model_path, custom_objects=custom_objects)
def n_ok(self):
"""Number of ok trials()
"""
if len(self.trials) == 0:
return 0
else:
return np.sum(np.array(self.statuses()) == "ok")
def get_ok_results(self, verbose=True):
"""Return a list of results with ok status
"""
if len(self.trials) == 0:
return []
not_ok = np.where(np.array(self.statuses()) != "ok")[0]
if len(not_ok) > 0 and verbose:
print("{0}/{1} trials were not ok.".format(len(not_ok), len(self.trials)))
print("Trials: " + str(not_ok))
print("Statuses: " + str(np.array(self.statuses())[not_ok]))
r = [merge_dicts({"tid": t["tid"]}, t["result"].to_dict())
for t in self.trials if t["result"]["status"] == "ok"]
return r
def as_df(self, ignore_vals=["history"], separator=".", verbose=True):
"""Return a pd.DataFrame view of the whole experiment
"""
def add_eval(res):
if "eval" not in res:
if isinstance(res["history"], list):
# take the average across all folds
eval_names = list(res["history"][0]["loss"].keys())
eval_metrics = np.array([[v[-1] for k, v in hist["loss"].items()]
for hist in res["history"]]).mean(axis=0).tolist()
res["eval"] = {eval_names[i]: eval_metrics[i] for i in range(len(eval_metrics))}
else:
res["eval"] = {k: v[-1] for k, v in res["history"]["loss"].items()}
return res
def add_n_epoch(df):
df_epoch = self.train_history().groupby("tid")["epoch"].max().reset_index()
df_epoch.rename(columns={"epoch": "n_epoch"}, inplace=True)
return pd.merge(df, df_epoch, on="tid", how="left")
results = self.get_ok_results(verbose=verbose)
rp = [_flatten_dict(_delete_keys(add_eval(x), ignore_vals), separator) for x in results]
df = pd.DataFrame.from_records(rp)
df = add_n_epoch(df)
first = ["tid", "loss", "status"]
return _put_first(df, first)
|
class KMongoTrials(MongoTrials):
'''`hyperopt.MonoTrials` extended with the following methods:
- get_trial(tid) - Retrieve trial by tid (Trial ID).
- get_param(tid) - Retrieve used hyper-parameters for a trial.
- best_trial_tid(rank=0) - Return the trial with lowest loss.
- rank - rank=0 means the best model, rank=1 means second best, ...
- optimal_epochs(tid) - Number of optimal epochs (after early-stopping)
- delete_running(timeout_last_refresh=0, dry_run=False) - Delete jobs stalled in the running state for too long
- timeout_last_refresh, int: number of seconds
- dry_run, bool: If True, just simulate the removal but don't actually perform it.
- valid_tid() - List all valid tid's
- train_history(tid=None) - Get train history as pd.DataFrame with columns: `(epoch, loss, val_loss, ...)`
- tid: Trial ID or list of trial ID's. If None, report for all trial ID's.
- get_ok_results - Return a list of trial results with an "ok" status
- load_model(tid) - Load a Keras model of a tid.
- as_df - Returns a tidy `pandas.DataFrame` of the trials database.
# Arguments
db_name: str, MongoTrials database name
exp_name: strm, MongoTrials experiment name
ip: str, MongoDB IP address.
port: int, MongoDB port.
kill_timeout: int, Maximum runtime of a job (in seconds) before it gets killed. None for infinite.
**kwargs: Additional keyword arguments passed to the `hyperopt.MongoTrials` constructor.
'''
def __init__(self, db_name, exp_name,
ip=db_host(), port=db_port(), kill_timeout=None, **kwargs):
pass
def get_trial(self, tid):
'''Retrieve trial by tid
'''
pass
def get_param(self, tid):
pass
def best_trial_tid(self, rank=0):
'''Get tid of the best trial
rank=0 means the best model
rank=1 means second best
...
'''
pass
def optimal_epochs(self, tid):
pass
def optimal_len(hist):
pass
def count_by_state_unsynced(self, arg):
'''Extends the original object in order to inject checking
for stalled jobs and killing them if they are running for too long
'''
pass
def delete_running(self, timeout_last_refresh=0, dry_run=False):
'''Delete jobs stalled in the running state for too long
timeout_last_refresh, int: number of seconds
'''
pass
def valid_tid(self):
'''List all valid tid's
'''
pass
def train_history(self, tid=None):
'''Get train history as pd.DataFrame
'''
pass
def result2history(result):
pass
def plot_history(self, tid, scores=["loss", "f1", "accuracy"],
figsize=(15, 3)):
'''Plot the loss curves'''
pass
def load_model(self, tid, custom_objects=None):
'''Load saved keras model of the trial.
If tid = None, get the best model
Not applicable for trials ran in cross validion (i.e. not applicable
for `CompileFN.cv_n_folds is None`
'''
pass
def n_ok(self):
'''Number of ok trials()
'''
pass
def get_ok_results(self, verbose=True):
'''Return a list of results with ok status
'''
pass
def as_df(self, ignore_vals=["history"], separator=".", verbose=True):
'''Return a pd.DataFrame view of the whole experiment
'''
pass
def add_eval(res):
pass
def add_n_epoch(df):
pass
| 19 | 12 | 12 | 1 | 9 | 2 | 2 | 0.49 | 1 | 8 | 0 | 0 | 14 | 1 | 14 | 14 | 250 | 43 | 140 | 52 | 118 | 69 | 123 | 50 | 103 | 5 | 1 | 2 | 37 |
8,104 |
Avsecz/kopt
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Avsecz_kopt/kopt/utils.py
|
kopt.utils.write_json.NumpyAwareJSONEncoder
|
class NumpyAwareJSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.ndarray):
return obj.tolist()
elif isinstance(obj, np.generic):
return obj.item()
return json.JSONEncoder.default(self, obj)
|
class NumpyAwareJSONEncoder(json.JSONEncoder):
def default(self, obj):
pass
| 2 | 0 | 6 | 0 | 6 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 5 | 8 | 1 | 7 | 2 | 5 | 0 | 6 | 2 | 4 | 3 | 2 | 1 | 3 |
8,105 |
Azure/Azure-MachineLearning-ClientLibrary-Python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_Azure-MachineLearning-ClientLibrary-Python/tests/__init__.py
|
tests.TestSettings.Storage
|
class Storage(object):
def __init__(self, settings):
self.settings = settings
@property
def account_name(self):
return self.settings['accountName']
@property
def account_key(self):
return self.settings['accountKey']
@property
def container(self):
return self.settings['container']
@property
def medium_size_blob(self):
return self.settings['mediumSizeBlob']
@property
def blobs(self):
return self.settings['blobs']
|
class Storage(object):
def __init__(self, settings):
pass
@property
def account_name(self):
pass
@property
def account_key(self):
pass
@property
def container(self):
pass
@property
def medium_size_blob(self):
pass
@property
def blobs(self):
pass
| 12 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 6 | 1 | 6 | 6 | 23 | 5 | 18 | 13 | 6 | 0 | 13 | 8 | 6 | 1 | 1 | 0 | 6 |
8,106 |
Azure/Azure-MachineLearning-ClientLibrary-Python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_Azure-MachineLearning-ClientLibrary-Python/tests/__init__.py
|
tests.TestSettings.Diagnostics
|
class Diagnostics(object):
def __init__(self, settings):
self.settings = settings
@property
def write_blob_contents(self):
return self.settings['writeBlobContents']
@property
def write_serialized_frame(self):
return self.settings['writeSerializedFrame']
|
class Diagnostics(object):
def __init__(self, settings):
pass
@property
def write_blob_contents(self):
pass
@property
def write_serialized_frame(self):
pass
| 6 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 3 | 1 | 3 | 3 | 11 | 2 | 9 | 7 | 3 | 0 | 7 | 5 | 3 | 1 | 1 | 0 | 3 |
8,107 |
Azure/Azure-MachineLearning-ClientLibrary-Python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_Azure-MachineLearning-ClientLibrary-Python/tests/__init__.py
|
tests.TestSettings.IntermediateDataset
|
class IntermediateDataset(object):
def __init__(self, settings):
self.settings = settings
@property
def experiment_id(self):
return self.settings['experimentId']
@property
def node_id(self):
return self.settings['nodeId']
@property
def port_name(self):
return self.settings['portName']
@property
def data_type_id(self):
return self.settings['dataTypeId']
|
class IntermediateDataset(object):
def __init__(self, settings):
pass
@property
def experiment_id(self):
pass
@property
def node_id(self):
pass
@property
def port_name(self):
pass
@property
def data_type_id(self):
pass
| 10 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 5 | 1 | 5 | 5 | 19 | 4 | 15 | 11 | 5 | 0 | 11 | 7 | 5 | 1 | 1 | 0 | 5 |
8,108 |
Azure/Azure-MachineLearning-ClientLibrary-Python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_Azure-MachineLearning-ClientLibrary-Python/tests/__init__.py
|
tests.TestSettings.Workspace
|
class Workspace(object):
def __init__(self, settings):
self.settings = settings
@property
def id(self):
return self.settings['id']
@property
def token(self):
return self.settings['token']
@property
def endpoint(self):
return self.settings['endpoint']
@property
def management_endpoint(self):
return self.settings['management_endpoint']
|
class Workspace(object):
def __init__(self, settings):
pass
@property
def id(self):
pass
@property
def token(self):
pass
@property
def endpoint(self):
pass
@property
def management_endpoint(self):
pass
| 10 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 5 | 1 | 5 | 5 | 19 | 4 | 15 | 11 | 5 | 0 | 11 | 7 | 5 | 1 | 1 | 0 | 5 |
8,109 |
Azure/Azure-MachineLearning-ClientLibrary-Python
|
Azure_Azure-MachineLearning-ClientLibrary-Python/tests/roundtriptests.py
|
tests.roundtriptests.RoundTripTests
|
class RoundTripTests(unittest.TestCase):
def setUp(self):
self.workspace = Workspace(
settings.workspace.id,
settings.workspace.token,
settings.workspace.endpoint
)
self.blob = BlobService(
settings.storage.account_name,
settings.storage.account_key
)
def _write_blob_contents(self, filename, data):
if settings.diagnostics.write_blob_contents:
with open('original-blob-' + filename, 'wb') as data_file:
data_file.write(data)
def _write_serialized_frame(self, filename, data):
if settings.diagnostics.write_serialized_frame:
with open('serialized-frame-' + filename, 'wb') as data_file:
data_file.write(data)
def test_download_blob_then_upload_as_dataframe_then_read_dataset(self):
def datatypeid_from_header_and_format(header, format):
if format == 'csv':
if header == 'wh':
return DataTypeIds.GenericCSV
else:
return DataTypeIds.GenericCSVNoHeader
elif format == 'tsv':
if header == 'wh':
return DataTypeIds.GenericTSV
else:
return DataTypeIds.GenericTSVNoHeader
elif format == 'txt':
return DataTypeIds.PlainText
else:
self.assertTrue(False, 'Unexpected format')
def split_blob_name(blob_name):
# blob naming convention:
# name_<header>.<format>
# <header>: WH: with header
# NH: no header
# <format>: CSV: comma separated
# TSV: tab separated
# TXT: newline separated
name, format = blob_name.lower().split('.')
if format != 'txt':
name, header = name.split('_')
else:
header = 'nh'
return name, format, header
for blob_name in settings.storage.blobs:
print(blob_name)
name, format, header = split_blob_name(blob_name)
# Read the data from blob storage
original_data = self.blob.get_blob_to_bytes(settings.storage.container, blob_name)
self._write_blob_contents(blob_name, original_data)
# Parse the data to a dataframe using Pandas
original_dataframe = pd.read_csv(
BytesIO(original_data),
header=0 if header == 'wh' else None,
sep=',' if format == 'csv' else '\t' if format == 'tsv' else '\n',
encoding='utf-8-sig'
)
# Upload the dataframe as a new dataset
dataset_name = 'unittest' + name + id_generator()
description = 'safe to be deleted - ' + dataset_name
data_type_id = datatypeid_from_header_and_format(header, format)
self.workspace.datasets.add_from_dataframe(
original_dataframe,
data_type_id,
dataset_name,
description,
)
# Get the new dataset
dataset = self.workspace.datasets[dataset_name]
self.assertIsNotNone(dataset)
# Read the dataset as a dataframe
result_data = dataset.read_as_binary()
self._write_serialized_frame(blob_name, result_data)
result_dataframe = dataset.to_dataframe()
# Verify that the dataframes are equal
assert_frame_equal(original_dataframe, result_dataframe)
def test_azureml_example_datasets(self):
max_size = 10 * 1024 * 1024
skip = [
'Restaurant feature data',
'IMDB Movie Titles',
'Book Reviews from Amazon',
]
for dataset in self.workspace.example_datasets:
if not hasattr(dataset, 'to_dataframe'):
print('skipped (unsupported format): {0}'.format(dataset.name))
continue
if dataset.size > max_size:
print('skipped (max size): {0}'.format(dataset.name))
continue
if dataset.name in skip:
print('skipped: {0}'.format(dataset.name))
continue
print('downloading: ' + dataset.name)
frame = dataset.to_dataframe()
print('uploading: ' + dataset.name)
dataset_name = 'unittest' + dataset.name + id_generator()
description = 'safe to be deleted - ' + dataset_name
self.workspace.datasets.add_from_dataframe(frame, dataset.data_type_id, dataset_name, description)
|
class RoundTripTests(unittest.TestCase):
def setUp(self):
pass
def _write_blob_contents(self, filename, data):
pass
def _write_serialized_frame(self, filename, data):
pass
def test_download_blob_then_upload_as_dataframe_then_read_dataset(self):
pass
def datatypeid_from_header_and_format(header, format):
pass
def split_blob_name(blob_name):
pass
def test_azureml_example_datasets(self):
pass
| 8 | 0 | 21 | 2 | 16 | 3 | 3 | 0.14 | 1 | 2 | 2 | 0 | 5 | 2 | 5 | 77 | 123 | 19 | 91 | 30 | 83 | 13 | 64 | 28 | 56 | 6 | 2 | 2 | 23 |
8,110 |
Azure/Azure-MachineLearning-ClientLibrary-Python
|
Azure_Azure-MachineLearning-ClientLibrary-Python/tests/performancetests.py
|
tests.performancetests.PerformanceTests
|
class PerformanceTests(unittest.TestCase):
def setUp(self):
self.workspace = Workspace(
settings.workspace.id,
settings.workspace.token,
settings.workspace.endpoint
)
self.blob = BlobService(
settings.storage.account_name,
settings.storage.account_key
)
def _write_blob_contents(self, filename, data):
if settings.diagnostics.write_blob_contents:
with open('original-blob-' + filename, 'wb') as data_file:
data_file.write(data)
def _write_serialized_frame(self, filename, data):
if settings.diagnostics.write_serialized_frame:
with open('serialized-frame-' + filename, 'wb') as data_file:
data_file.write(data)
def test_serialize_40mb_dataframe(self):
# Arrange
blob_name = settings.storage.medium_size_blob
original_data = self.blob.get_blob_to_bytes(settings.storage.container, blob_name)
original_dataframe = pd.read_csv(BytesIO(original_data), header=0, sep=",", encoding='utf-8-sig')
self._write_blob_contents(blob_name, original_data)
# Act
start_time = datetime.now()
writer = BytesIO()
serialize_dataframe(writer, DataTypeIds.GenericCSV, original_dataframe)
elapsed_time = datetime.now() - start_time
result_data = writer.getvalue()
self._write_serialized_frame(blob_name, result_data)
# Assert
result_dataframe = pd.read_csv(BytesIO(result_data), header=0, sep=",", encoding='utf-8-sig')
assert_frame_equal(original_dataframe, result_dataframe)
self.assertLess(elapsed_time.total_seconds(), 10)
|
class PerformanceTests(unittest.TestCase):
def setUp(self):
pass
def _write_blob_contents(self, filename, data):
pass
def _write_serialized_frame(self, filename, data):
pass
def test_serialize_40mb_dataframe(self):
pass
| 5 | 0 | 10 | 1 | 8 | 1 | 2 | 0.09 | 1 | 3 | 2 | 0 | 4 | 2 | 4 | 76 | 43 | 7 | 33 | 17 | 28 | 3 | 26 | 15 | 21 | 2 | 2 | 2 | 6 |
8,111 |
Azure/Azure-MachineLearning-ClientLibrary-Python
|
Azure_Azure-MachineLearning-ClientLibrary-Python/tests/__init__.py
|
tests.TestSettings
|
class TestSettings(object):
class Workspace(object):
def __init__(self, settings):
self.settings = settings
@property
def id(self):
return self.settings['id']
@property
def token(self):
return self.settings['token']
@property
def endpoint(self):
return self.settings['endpoint']
@property
def management_endpoint(self):
return self.settings['management_endpoint']
class Storage(object):
def __init__(self, settings):
self.settings = settings
@property
def account_name(self):
return self.settings['accountName']
@property
def account_key(self):
return self.settings['accountKey']
@property
def container(self):
return self.settings['container']
@property
def medium_size_blob(self):
return self.settings['mediumSizeBlob']
@property
def blobs(self):
return self.settings['blobs']
class IntermediateDataset(object):
def __init__(self, settings):
self.settings = settings
@property
def experiment_id(self):
return self.settings['experimentId']
@property
def node_id(self):
return self.settings['nodeId']
@property
def port_name(self):
return self.settings['portName']
@property
def data_type_id(self):
return self.settings['dataTypeId']
class Diagnostics(object):
def __init__(self, settings):
self.settings = settings
@property
def write_blob_contents(self):
return self.settings['writeBlobContents']
@property
def write_serialized_frame(self):
return self.settings['writeSerializedFrame']
def __init__(self, settings):
self.workspace = TestSettings.Workspace(settings['workspace'])
self.storage = TestSettings.Storage(settings['storage'])
self.intermediateDataset = TestSettings.IntermediateDataset(settings['intermediateDataset'])
self.diagnostics = TestSettings.Diagnostics(settings['diagnostics'])
|
class TestSettings(object):
class Workspace(object):
def __init__(self, settings):
pass
@property
def id(self):
pass
@property
def token(self):
pass
@property
def endpoint(self):
pass
@property
def management_endpoint(self):
pass
class Storage(object):
def __init__(self, settings):
pass
@property
def account_name(self):
pass
@property
def account_key(self):
pass
@property
def container(self):
pass
@property
def medium_size_blob(self):
pass
@property
def blobs(self):
pass
class IntermediateDataset(object):
def __init__(self, settings):
pass
@property
def experiment_id(self):
pass
@property
def node_id(self):
pass
@property
def port_name(self):
pass
@property
def data_type_id(self):
pass
class Diagnostics(object):
def __init__(self, settings):
pass
@property
def write_blob_contents(self):
pass
@property
def write_serialized_frame(self):
pass
def __init__(self, settings):
pass
| 40 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 4 | 4 | 0 | 1 | 4 | 1 | 1 | 82 | 19 | 63 | 48 | 23 | 0 | 48 | 33 | 23 | 1 | 1 | 0 | 20 |
8,112 |
Azure/Azure-MachineLearning-ClientLibrary-Python
|
Azure_Azure-MachineLearning-ClientLibrary-Python/azureml/serialization.py
|
azureml.serialization.DataTypeIds
|
class DataTypeIds(object):
"""Constants for the known dataset data type id strings."""
ARFF = 'ARFF'
PlainText = 'PlainText'
GenericCSV = 'GenericCSV'
GenericTSV = 'GenericTSV'
GenericCSVNoHeader = 'GenericCSVNoHeader'
GenericTSVNoHeader = 'GenericTSVNoHeader'
|
class DataTypeIds(object):
'''Constants for the known dataset data type id strings.'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.14 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0 | 7 | 7 | 6 | 1 | 7 | 7 | 6 | 0 | 1 | 0 | 0 |
8,113 |
Azure/azure-cli-extensions
|
src/load/azext_load/vendored_sdks/loadtesting/models/_enums.py
|
azext_load.vendored_sdks.loadtesting.models._enums.PFResult
|
class PFResult(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Pass/fail criteria result."""
PASSED = "passed"
"""Given pass fail criteria metric has passed."""
UNDETERMINED = "undetermined"
"""Given pass fail criteria metric couldn't determine."""
FAILED = "failed"
"""Given pass fail criteria metric has failed."""
|
class PFResult(str, Enum, metaclass=CaseInsensitiveEnumMeta):
'''Pass/fail criteria result.'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 9 | 1 | 4 | 4 | 3 | 4 | 4 | 4 | 3 | 0 | 4 | 0 | 0 |
8,114 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.QueryDatasetConfiguration
|
class QueryDatasetConfiguration(msrest.serialization.Model):
"""The configuration of dataset in the query.
:param columns: Array of column names to be included in the query. Any valid query column name
is allowed. If not provided, then query includes all columns.
:type columns: list[str]
"""
_attribute_map = {
'columns': {'key': 'columns', 'type': '[str]'},
}
def __init__(
self,
*,
columns: Optional[List[str]] = None,
**kwargs
):
super(QueryDatasetConfiguration, self).__init__(**kwargs)
self.columns = columns
|
class QueryDatasetConfiguration(msrest.serialization.Model):
'''The configuration of dataset in the query.
:param columns: Array of column names to be included in the query. Any valid query column name
is allowed. If not provided, then query includes all columns.
:type columns: list[str]
'''
def __init__(
self,
*,
columns: Optional[List[str]] = None,
**kwargs
):
pass
| 2 | 1 | 8 | 0 | 8 | 0 | 1 | 0.42 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 1 | 20 | 3 | 12 | 9 | 5 | 5 | 5 | 4 | 3 | 1 | 1 | 0 | 1 |
8,115 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.QueryDefinition
|
class QueryDefinition(msrest.serialization.Model):
"""The definition of a query.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of the query. Possible values include: "Usage", "ActualCost",
"AmortizedCost".
:type type: str or ~azure.mgmt.costmanagement.models.ExportType
:param timeframe: Required. The time frame for pulling data for the query. If custom, then a
specific time period must be provided. Possible values include: "MonthToDate",
"BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom".
:type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType
:param time_period: Has time period for pulling data for the query.
:type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod
:param dataset: Has definition for data in this query.
:type dataset: ~azure.mgmt.costmanagement.models.QueryDataset
"""
_validation = {
'type': {'required': True},
'timeframe': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'timeframe': {'key': 'timeframe', 'type': 'str'},
'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'},
'dataset': {'key': 'dataset', 'type': 'QueryDataset'},
}
def __init__(
self,
*,
type: Union[str, "ExportType"],
timeframe: Union[str, "TimeframeType"],
time_period: Optional["QueryTimePeriod"] = None,
dataset: Optional["QueryDataset"] = None,
**kwargs
):
super(QueryDefinition, self).__init__(**kwargs)
self.type = type
self.timeframe = timeframe
self.time_period = time_period
self.dataset = dataset
|
class QueryDefinition(msrest.serialization.Model):
'''The definition of a query.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of the query. Possible values include: "Usage", "ActualCost",
"AmortizedCost".
:type type: str or ~azure.mgmt.costmanagement.models.ExportType
:param timeframe: Required. The time frame for pulling data for the query. If custom, then a
specific time period must be provided. Possible values include: "MonthToDate",
"BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom".
:type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType
:param time_period: Has time period for pulling data for the query.
:type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod
:param dataset: Has definition for data in this query.
:type dataset: ~azure.mgmt.costmanagement.models.QueryDataset
'''
def __init__(
self,
*,
type: Union[str, "ExportType"],
timeframe: Union[str, "TimeframeType"],
time_period: Optional["QueryTimePeriod"] = None,
dataset: Optional["QueryDataset"] = None,
**kwargs
):
pass
| 2 | 1 | 14 | 0 | 14 | 0 | 1 | 0.56 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 1 | 44 | 5 | 25 | 16 | 15 | 14 | 9 | 8 | 7 | 1 | 1 | 0 | 1 |
8,116 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.QueryFilter
|
class QueryFilter(msrest.serialization.Model):
"""The filter expression to be used in the export.
:param and_property: The logical "AND" expression. Must have at least 2 items.
:type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter]
:param or_property: The logical "OR" expression. Must have at least 2 items.
:type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter]
:param not_property: The logical "NOT" expression.
:type not_property: ~azure.mgmt.costmanagement.models.QueryFilter
:param dimension: Has comparison expression for a dimension.
:type dimension: ~azure.mgmt.costmanagement.models.QueryComparisonExpression
:param tag: Has comparison expression for a tag.
:type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression
"""
_validation = {
'and_property': {'min_items': 2},
'or_property': {'min_items': 2},
}
_attribute_map = {
'and_property': {'key': 'and', 'type': '[QueryFilter]'},
'or_property': {'key': 'or', 'type': '[QueryFilter]'},
'not_property': {'key': 'not', 'type': 'QueryFilter'},
'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'},
'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'},
}
def __init__(
self,
*,
and_property: Optional[List["QueryFilter"]] = None,
or_property: Optional[List["QueryFilter"]] = None,
not_property: Optional["QueryFilter"] = None,
dimension: Optional["QueryComparisonExpression"] = None,
tag: Optional["QueryComparisonExpression"] = None,
**kwargs
):
super(QueryFilter, self).__init__(**kwargs)
self.and_property = and_property
self.or_property = or_property
self.not_property = not_property
self.dimension = dimension
self.tag = tag
|
class QueryFilter(msrest.serialization.Model):
'''The filter expression to be used in the export.
:param and_property: The logical "AND" expression. Must have at least 2 items.
:type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter]
:param or_property: The logical "OR" expression. Must have at least 2 items.
:type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter]
:param not_property: The logical "NOT" expression.
:type not_property: ~azure.mgmt.costmanagement.models.QueryFilter
:param dimension: Has comparison expression for a dimension.
:type dimension: ~azure.mgmt.costmanagement.models.QueryComparisonExpression
:param tag: Has comparison expression for a tag.
:type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression
'''
def __init__(
self,
*,
and_property: Optional[List["QueryFilter"]] = None,
or_property: Optional[List["QueryFilter"]] = None,
not_property: Optional["QueryFilter"] = None,
dimension: Optional["QueryComparisonExpression"] = None,
tag: Optional["QueryComparisonExpression"] = None,
**kwargs
):
pass
| 2 | 1 | 16 | 0 | 16 | 0 | 1 | 0.43 | 1 | 1 | 0 | 0 | 1 | 5 | 1 | 1 | 44 | 4 | 28 | 18 | 17 | 12 | 10 | 9 | 8 | 1 | 1 | 0 | 1 |
8,117 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.QueryGrouping
|
class QueryGrouping(msrest.serialization.Model):
"""The group by expression to be used in the query.
All required parameters must be populated in order to send to Azure.
:param type: Required. Has type of the column to group. Possible values include: "Tag",
"Dimension".
:type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType
:param name: Required. The name of the column to group.
:type name: str
"""
_validation = {
'type': {'required': True},
'name': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
}
def __init__(
self,
*,
type: Union[str, "QueryColumnType"],
name: str,
**kwargs
):
super(QueryGrouping, self).__init__(**kwargs)
self.type = type
self.name = name
|
class QueryGrouping(msrest.serialization.Model):
'''The group by expression to be used in the query.
All required parameters must be populated in order to send to Azure.
:param type: Required. Has type of the column to group. Possible values include: "Tag",
"Dimension".
:type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType
:param name: Required. The name of the column to group.
:type name: str
'''
def __init__(
self,
*,
type: Union[str, "QueryColumnType"],
name: str,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.42 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 32 | 5 | 19 | 12 | 11 | 8 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,118 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.QueryResult
|
class QueryResult(Resource):
"""Result of query. It contains all columns listed under groupings and aggregation.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar tags: A set of tags. Resource tags.
:vartype tags: dict[str, str]
:param next_link: The link (url) to the next page of results.
:type next_link: str
:param columns: Array of columns.
:type columns: list[~azure.mgmt.costmanagement.models.QueryColumn]
:param rows: Array of rows.
:type rows: list[list[object]]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'tags': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'next_link': {'key': 'properties.nextLink', 'type': 'str'},
'columns': {'key': 'properties.columns', 'type': '[QueryColumn]'},
'rows': {'key': 'properties.rows', 'type': '[[object]]'},
}
def __init__(
self,
*,
next_link: Optional[str] = None,
columns: Optional[List["QueryColumn"]] = None,
rows: Optional[List[List[object]]] = None,
**kwargs
):
super(QueryResult, self).__init__(**kwargs)
self.next_link = next_link
self.columns = columns
self.rows = rows
|
class QueryResult(Resource):
'''Result of query. It contains all columns listed under groupings and aggregation.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar tags: A set of tags. Resource tags.
:vartype tags: dict[str, str]
:param next_link: The link (url) to the next page of results.
:type next_link: str
:param columns: Array of columns.
:type columns: list[~azure.mgmt.costmanagement.models.QueryColumn]
:param rows: Array of rows.
:type rows: list[list[object]]
'''
def __init__(
self,
*,
next_link: Optional[str] = None,
columns: Optional[List["QueryColumn"]] = None,
rows: Optional[List[List[object]]] = None,
**kwargs
):
pass
| 2 | 1 | 12 | 0 | 12 | 0 | 1 | 0.61 | 1 | 3 | 0 | 0 | 1 | 3 | 1 | 2 | 50 | 5 | 28 | 14 | 19 | 17 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
8,119 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.QueryTimePeriod
|
class QueryTimePeriod(msrest.serialization.Model):
"""The start and end date for pulling data for the query.
All required parameters must be populated in order to send to Azure.
:param from_property: Required. The start date to pull data from.
:type from_property: ~datetime.datetime
:param to: Required. The end date to pull data to.
:type to: ~datetime.datetime
"""
_validation = {
'from_property': {'required': True},
'to': {'required': True},
}
_attribute_map = {
'from_property': {'key': 'from', 'type': 'iso-8601'},
'to': {'key': 'to', 'type': 'iso-8601'},
}
def __init__(
self,
*,
from_property: datetime.datetime,
to: datetime.datetime,
**kwargs
):
super(QueryTimePeriod, self).__init__(**kwargs)
self.from_property = from_property
self.to = to
|
class QueryTimePeriod(msrest.serialization.Model):
'''The start and end date for pulling data for the query.
All required parameters must be populated in order to send to Azure.
:param from_property: Required. The start date to pull data from.
:type from_property: ~datetime.datetime
:param to: Required. The end date to pull data to.
:type to: ~datetime.datetime
'''
def __init__(
self,
*,
from_property: datetime.datetime,
to: datetime.datetime,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.37 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 31 | 5 | 19 | 12 | 11 | 7 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,120 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigAggregation
|
class ReportConfigAggregation(msrest.serialization.Model):
"""The aggregation expression to be used in the report.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to aggregate.
:type name: str
:param function: Required. The name of the aggregation function to use. Possible values
include: "Sum".
:type function: str or ~azure.mgmt.costmanagement.models.FunctionType
"""
_validation = {
'name': {'required': True},
'function': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'function': {'key': 'function', 'type': 'str'},
}
def __init__(
self,
*,
name: str,
function: Union[str, "FunctionType"],
**kwargs
):
super(ReportConfigAggregation, self).__init__(**kwargs)
self.name = name
self.function = function
|
class ReportConfigAggregation(msrest.serialization.Model):
'''The aggregation expression to be used in the report.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to aggregate.
:type name: str
:param function: Required. The name of the aggregation function to use. Possible values
include: "Sum".
:type function: str or ~azure.mgmt.costmanagement.models.FunctionType
'''
def __init__(
self,
*,
name: str,
function: Union[str, "FunctionType"],
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.42 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 32 | 5 | 19 | 12 | 11 | 8 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,121 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigComparisonExpression
|
class ReportConfigComparisonExpression(msrest.serialization.Model):
"""The comparison expression to be used in the report.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to use in comparison.
:type name: str
:param operator: Required. The operator to use for comparison. Possible values include: "In",
"Contains".
:type operator: str or ~azure.mgmt.costmanagement.models.OperatorType
:param values: Required. Array of values to use for comparison.
:type values: list[str]
"""
_validation = {
'name': {'required': True},
'operator': {'required': True},
'values': {'required': True, 'min_items': 1},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'values': {'key': 'values', 'type': '[str]'},
}
def __init__(
self,
*,
name: str,
operator: Union[str, "OperatorType"],
values: List[str],
**kwargs
):
super(ReportConfigComparisonExpression, self).__init__(**kwargs)
self.name = name
self.operator = operator
self.values = values
|
class ReportConfigComparisonExpression(msrest.serialization.Model):
'''The comparison expression to be used in the report.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to use in comparison.
:type name: str
:param operator: Required. The operator to use for comparison. Possible values include: "In",
"Contains".
:type operator: str or ~azure.mgmt.costmanagement.models.OperatorType
:param values: Required. Array of values to use for comparison.
:type values: list[str]
'''
def __init__(
self,
*,
name: str,
operator: Union[str, "OperatorType"],
values: List[str],
**kwargs
):
pass
| 2 | 1 | 12 | 0 | 12 | 0 | 1 | 0.43 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 1 | 38 | 5 | 23 | 14 | 14 | 10 | 8 | 7 | 6 | 1 | 1 | 0 | 1 |
8,122 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigDatasetConfiguration
|
class ReportConfigDatasetConfiguration(msrest.serialization.Model):
"""The configuration of dataset in the report.
:param columns: Array of column names to be included in the report. Any valid report column
name is allowed. If not provided, then report includes all columns.
:type columns: list[str]
"""
_attribute_map = {
'columns': {'key': 'columns', 'type': '[str]'},
}
def __init__(
self,
*,
columns: Optional[List[str]] = None,
**kwargs
):
super(ReportConfigDatasetConfiguration, self).__init__(**kwargs)
self.columns = columns
|
class ReportConfigDatasetConfiguration(msrest.serialization.Model):
'''The configuration of dataset in the report.
:param columns: Array of column names to be included in the report. Any valid report column
name is allowed. If not provided, then report includes all columns.
:type columns: list[str]
'''
def __init__(
self,
*,
columns: Optional[List[str]] = None,
**kwargs
):
pass
| 2 | 1 | 8 | 0 | 8 | 0 | 1 | 0.42 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 1 | 20 | 3 | 12 | 9 | 5 | 5 | 5 | 4 | 3 | 1 | 1 | 0 | 1 |
8,123 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigDatasetAutoGenerated
|
class ReportConfigDatasetAutoGenerated(msrest.serialization.Model):
"""The definition of data present in the report.
:param granularity: The granularity of rows in the report. Possible values include: "Daily",
"Monthly".
:type granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType
:param configuration: Has configuration information for the data in the report. The
configuration will be ignored if aggregation and grouping are provided.
:type configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration
:param aggregation: Dictionary of aggregation expression to use in the report. The key of each
item in the dictionary is the alias for the aggregated column. Report can have up to 2
aggregation clauses.
:type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation]
:param grouping: Array of group by expression to use in the report. Report can have up to 2
group by clauses.
:type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping]
:param sorting: Array of order by expression to use in the report.
:type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting]
:param filter: Has filter expression to use in the report.
:type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated
"""
_validation = {
'grouping': {'max_items': 2, 'min_items': 0},
}
_attribute_map = {
'granularity': {'key': 'granularity', 'type': 'str'},
'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'},
'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'},
'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'},
'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'},
'filter': {'key': 'filter', 'type': 'ReportConfigFilterAutoGenerated'},
}
def __init__(
self,
*,
granularity: Optional[Union[str, "ReportGranularityType"]] = None,
configuration: Optional["ReportConfigDatasetConfiguration"] = None,
aggregation: Optional[Dict[str, "ReportConfigAggregation"]] = None,
grouping: Optional[List["ReportConfigGrouping"]] = None,
sorting: Optional[List["ReportConfigSorting"]] = None,
filter: Optional["ReportConfigFilterAutoGenerated"] = None,
**kwargs
):
super(ReportConfigDatasetAutoGenerated, self).__init__(**kwargs)
self.granularity = granularity
self.configuration = configuration
self.aggregation = aggregation
self.grouping = grouping
self.sorting = sorting
self.filter = filter
|
class ReportConfigDatasetAutoGenerated(msrest.serialization.Model):
'''The definition of data present in the report.
:param granularity: The granularity of rows in the report. Possible values include: "Daily",
"Monthly".
:type granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType
:param configuration: Has configuration information for the data in the report. The
configuration will be ignored if aggregation and grouping are provided.
:type configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration
:param aggregation: Dictionary of aggregation expression to use in the report. The key of each
item in the dictionary is the alias for the aggregated column. Report can have up to 2
aggregation clauses.
:type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation]
:param grouping: Array of group by expression to use in the report. Report can have up to 2
group by clauses.
:type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping]
:param sorting: Array of order by expression to use in the report.
:type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting]
:param filter: Has filter expression to use in the report.
:type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated
'''
def __init__(
self,
*,
granularity: Optional[Union[str, "ReportGranularityType"]] = None,
configuration: Optional["ReportConfigDatasetConfiguration"] = None,
aggregation: Optional[Dict[str, "ReportConfigAggregation"]] = None,
grouping: Optional[List["ReportConfigGrouping"]] = None,
sorting: Optional[List["ReportConfigSorting"]] = None,
filter: Optional["ReportConfigFilterAutoGenerated"] = None,
**kwargs
):
pass
| 2 | 1 | 18 | 0 | 18 | 0 | 1 | 0.63 | 1 | 2 | 0 | 0 | 1 | 6 | 1 | 1 | 53 | 4 | 30 | 20 | 18 | 19 | 11 | 10 | 9 | 1 | 1 | 0 | 1 |
8,124 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.QueryDataset
|
class QueryDataset(msrest.serialization.Model):
"""The definition of data present in the query.
:param granularity: The granularity of rows in the query. Possible values include: "Daily".
:type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType
:param configuration: Has configuration information for the data in the export. The
configuration will be ignored if aggregation and grouping are provided.
:type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration
:param aggregation: Dictionary of aggregation expression to use in the query. The key of each
item in the dictionary is the alias for the aggregated column. Query can have up to 2
aggregation clauses.
:type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation]
:param grouping: Array of group by expression to use in the query. Query can have up to 2 group
by clauses.
:type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping]
:param filter: Has filter expression to use in the query.
:type filter: ~azure.mgmt.costmanagement.models.QueryFilter
"""
_validation = {
'grouping': {'max_items': 2, 'min_items': 0},
}
_attribute_map = {
'granularity': {'key': 'granularity', 'type': 'str'},
'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'},
'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'},
'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'},
'filter': {'key': 'filter', 'type': 'QueryFilter'},
}
def __init__(
self,
*,
granularity: Optional[Union[str, "GranularityType"]] = None,
configuration: Optional["QueryDatasetConfiguration"] = None,
aggregation: Optional[Dict[str, "QueryAggregation"]] = None,
grouping: Optional[List["QueryGrouping"]] = None,
filter: Optional["QueryFilter"] = None,
**kwargs
):
super(QueryDataset, self).__init__(**kwargs)
self.granularity = granularity
self.configuration = configuration
self.aggregation = aggregation
self.grouping = grouping
self.filter = filter
|
class QueryDataset(msrest.serialization.Model):
'''The definition of data present in the query.
:param granularity: The granularity of rows in the query. Possible values include: "Daily".
:type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType
:param configuration: Has configuration information for the data in the export. The
configuration will be ignored if aggregation and grouping are provided.
:type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration
:param aggregation: Dictionary of aggregation expression to use in the query. The key of each
item in the dictionary is the alias for the aggregated column. Query can have up to 2
aggregation clauses.
:type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation]
:param grouping: Array of group by expression to use in the query. Query can have up to 2 group
by clauses.
:type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping]
:param filter: Has filter expression to use in the query.
:type filter: ~azure.mgmt.costmanagement.models.QueryFilter
'''
def __init__(
self,
*,
granularity: Optional[Union[str, "GranularityType"]] = None,
configuration: Optional["QueryDatasetConfiguration"] = None,
aggregation: Optional[Dict[str, "QueryAggregation"]] = None,
grouping: Optional[List["QueryGrouping"]] = None,
filter: Optional["QueryFilter"] = None,
**kwargs
):
pass
| 2 | 1 | 16 | 0 | 16 | 0 | 1 | 0.59 | 1 | 2 | 0 | 0 | 1 | 5 | 1 | 1 | 47 | 4 | 27 | 18 | 16 | 16 | 10 | 9 | 8 | 1 | 1 | 0 | 1 |
8,125 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigDefinition
|
class ReportConfigDefinition(msrest.serialization.Model):
"""The definition of a report config.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of the report. Usage represents actual usage, forecast
represents forecasted data and UsageAndForecast represents both usage and forecasted data.
Actual usage and forecasted data can be differentiated based on dates. Possible values include:
"Usage".
:type type: str or ~azure.mgmt.costmanagement.models.ReportType
:param timeframe: Required. The time frame for pulling data for the report. If custom, then a
specific time period must be provided. Possible values include: "WeekToDate", "MonthToDate",
"YearToDate", "Custom".
:type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType
:param time_period: Has time period for pulling data for the report.
:type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod
:param dataset: Has definition for data in this report config.
:type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDatasetAutoGenerated
"""
_validation = {
'type': {'required': True},
'timeframe': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'timeframe': {'key': 'timeframe', 'type': 'str'},
'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'},
'dataset': {'key': 'dataset', 'type': 'ReportConfigDatasetAutoGenerated'},
}
def __init__(
self,
*,
type: Union[str, "ReportType"],
timeframe: Union[str, "ReportTimeframeType"],
time_period: Optional["ReportConfigTimePeriod"] = None,
dataset: Optional["ReportConfigDatasetAutoGenerated"] = None,
**kwargs
):
super(ReportConfigDefinition, self).__init__(**kwargs)
self.type = type
self.timeframe = timeframe
self.time_period = time_period
self.dataset = dataset
|
class ReportConfigDefinition(msrest.serialization.Model):
'''The definition of a report config.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of the report. Usage represents actual usage, forecast
represents forecasted data and UsageAndForecast represents both usage and forecasted data.
Actual usage and forecasted data can be differentiated based on dates. Possible values include:
"Usage".
:type type: str or ~azure.mgmt.costmanagement.models.ReportType
:param timeframe: Required. The time frame for pulling data for the report. If custom, then a
specific time period must be provided. Possible values include: "WeekToDate", "MonthToDate",
"YearToDate", "Custom".
:type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType
:param time_period: Has time period for pulling data for the report.
:type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod
:param dataset: Has definition for data in this report config.
:type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDatasetAutoGenerated
'''
def __init__(
self,
*,
type: Union[str, "ReportType"],
timeframe: Union[str, "ReportTimeframeType"],
time_period: Optional["ReportConfigTimePeriod"] = None,
dataset: Optional["ReportConfigDatasetAutoGenerated"] = None,
**kwargs
):
pass
| 2 | 1 | 14 | 0 | 14 | 0 | 1 | 0.64 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 1 | 46 | 5 | 25 | 16 | 15 | 16 | 9 | 8 | 7 | 1 | 1 | 0 | 1 |
8,126 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigFilter
|
class ReportConfigFilter(msrest.serialization.Model):
"""The filter expression to be used in the report.
:param and_property: The logical "AND" expression. Must have at least 2 items.
:type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter]
:param or_property: The logical "OR" expression. Must have at least 2 items.
:type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter]
:param not_property: The logical "NOT" expression.
:type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter
:param dimension: Has comparison expression for a dimension.
:type dimension: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression
:param tag: Has comparison expression for a tag.
:type tag: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression
"""
_validation = {
'and_property': {'min_items': 2},
'or_property': {'min_items': 2},
}
_attribute_map = {
'and_property': {'key': 'and', 'type': '[ReportConfigFilter]'},
'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'},
'not_property': {'key': 'not', 'type': 'ReportConfigFilter'},
'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'},
'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'},
}
def __init__(
self,
*,
and_property: Optional[List["ReportConfigFilter"]] = None,
or_property: Optional[List["ReportConfigFilter"]] = None,
not_property: Optional["ReportConfigFilter"] = None,
dimension: Optional["ReportConfigComparisonExpression"] = None,
tag: Optional["ReportConfigComparisonExpression"] = None,
**kwargs
):
super(ReportConfigFilter, self).__init__(**kwargs)
self.and_property = and_property
self.or_property = or_property
self.not_property = not_property
self.dimension = dimension
self.tag = tag
|
class ReportConfigFilter(msrest.serialization.Model):
'''The filter expression to be used in the report.
:param and_property: The logical "AND" expression. Must have at least 2 items.
:type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter]
:param or_property: The logical "OR" expression. Must have at least 2 items.
:type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter]
:param not_property: The logical "NOT" expression.
:type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter
:param dimension: Has comparison expression for a dimension.
:type dimension: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression
:param tag: Has comparison expression for a tag.
:type tag: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression
'''
def __init__(
self,
*,
and_property: Optional[List["ReportConfigFilter"]] = None,
or_property: Optional[List["ReportConfigFilter"]] = None,
not_property: Optional["ReportConfigFilter"] = None,
dimension: Optional["ReportConfigComparisonExpression"] = None,
tag: Optional["ReportConfigComparisonExpression"] = None,
**kwargs
):
pass
| 2 | 1 | 16 | 0 | 16 | 0 | 1 | 0.43 | 1 | 1 | 0 | 0 | 1 | 5 | 1 | 1 | 44 | 4 | 28 | 18 | 17 | 12 | 10 | 9 | 8 | 1 | 1 | 0 | 1 |
8,127 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigFilterAutoGenerated
|
class ReportConfigFilterAutoGenerated(msrest.serialization.Model):
"""The filter expression to be used in the report.
:param and_property: The logical "AND" expression. Must have at least 2 items.
:type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated]
:param or_property: The logical "OR" expression. Must have at least 2 items.
:type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated]
:param not_property: The logical "NOT" expression.
:type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated
:param dimension: Has comparison expression for a dimension.
:type dimension: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression
:param tag: Has comparison expression for a tag.
:type tag: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression
"""
_validation = {
'and_property': {'min_items': 2},
'or_property': {'min_items': 2},
}
_attribute_map = {
'and_property': {'key': 'and', 'type': '[ReportConfigFilterAutoGenerated]'},
'or_property': {'key': 'or', 'type': '[ReportConfigFilterAutoGenerated]'},
'not_property': {'key': 'not', 'type': 'ReportConfigFilterAutoGenerated'},
'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'},
'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'},
}
def __init__(
self,
*,
and_property: Optional[List["ReportConfigFilterAutoGenerated"]] = None,
or_property: Optional[List["ReportConfigFilterAutoGenerated"]] = None,
not_property: Optional["ReportConfigFilterAutoGenerated"] = None,
dimension: Optional["ReportConfigComparisonExpression"] = None,
tag: Optional["ReportConfigComparisonExpression"] = None,
**kwargs
):
super(ReportConfigFilterAutoGenerated, self).__init__(**kwargs)
self.and_property = and_property
self.or_property = or_property
self.not_property = not_property
self.dimension = dimension
self.tag = tag
|
class ReportConfigFilterAutoGenerated(msrest.serialization.Model):
'''The filter expression to be used in the report.
:param and_property: The logical "AND" expression. Must have at least 2 items.
:type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated]
:param or_property: The logical "OR" expression. Must have at least 2 items.
:type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated]
:param not_property: The logical "NOT" expression.
:type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated
:param dimension: Has comparison expression for a dimension.
:type dimension: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression
:param tag: Has comparison expression for a tag.
:type tag: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression
'''
def __init__(
self,
*,
and_property: Optional[List["ReportConfigFilterAutoGenerated"]] = None,
or_property: Optional[List["ReportConfigFilterAutoGenerated"]] = None,
not_property: Optional["ReportConfigFilterAutoGenerated"] = None,
dimension: Optional["ReportConfigComparisonExpression"] = None,
tag: Optional["ReportConfigComparisonExpression"] = None,
**kwargs
):
pass
| 2 | 1 | 16 | 0 | 16 | 0 | 1 | 0.43 | 1 | 1 | 0 | 0 | 1 | 5 | 1 | 1 | 44 | 4 | 28 | 18 | 17 | 12 | 10 | 9 | 8 | 1 | 1 | 0 | 1 |
8,128 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigGrouping
|
class ReportConfigGrouping(msrest.serialization.Model):
"""The group by expression to be used in the report.
All required parameters must be populated in order to send to Azure.
:param type: Required. Has type of the column to group. Possible values include: "Tag",
"Dimension".
:type type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType
:param name: Required. The name of the column to group. This version supports subscription
lowest possible grain.
:type name: str
"""
_validation = {
'type': {'required': True},
'name': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
}
def __init__(
self,
*,
type: Union[str, "ReportConfigColumnType"],
name: str,
**kwargs
):
super(ReportConfigGrouping, self).__init__(**kwargs)
self.type = type
self.name = name
|
class ReportConfigGrouping(msrest.serialization.Model):
'''The group by expression to be used in the report.
All required parameters must be populated in order to send to Azure.
:param type: Required. Has type of the column to group. Possible values include: "Tag",
"Dimension".
:type type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType
:param name: Required. The name of the column to group. This version supports subscription
lowest possible grain.
:type name: str
'''
def __init__(
self,
*,
type: Union[str, "ReportConfigColumnType"],
name: str,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.47 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 33 | 5 | 19 | 12 | 11 | 9 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,129 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigSorting
|
class ReportConfigSorting(msrest.serialization.Model):
"""The order by expression to be used in the report.
All required parameters must be populated in order to send to Azure.
:param direction: Direction of sort. Possible values include: "Ascending", "Descending".
:type direction: str or ~azure.mgmt.costmanagement.models.ReportConfigSortingDirection
:param name: Required. The name of the column to sort.
:type name: str
"""
_validation = {
'name': {'required': True},
}
_attribute_map = {
'direction': {'key': 'direction', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
}
def __init__(
self,
*,
name: str,
direction: Optional[Union[str, "ReportConfigSortingDirection"]] = None,
**kwargs
):
super(ReportConfigSorting, self).__init__(**kwargs)
self.direction = direction
self.name = name
|
class ReportConfigSorting(msrest.serialization.Model):
'''The order by expression to be used in the report.
All required parameters must be populated in order to send to Azure.
:param direction: Direction of sort. Possible values include: "Ascending", "Descending".
:type direction: str or ~azure.mgmt.costmanagement.models.ReportConfigSortingDirection
:param name: Required. The name of the column to sort.
:type name: str
'''
def __init__(
self,
*,
name: str,
direction: Optional[Union[str, "ReportConfigSortingDirection"]] = None,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.39 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 30 | 5 | 18 | 12 | 10 | 7 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,130 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigTimePeriod
|
class ReportConfigTimePeriod(msrest.serialization.Model):
"""The start and end date for pulling data for the report.
All required parameters must be populated in order to send to Azure.
:param from_property: Required. The start date to pull data from.
:type from_property: ~datetime.datetime
:param to: Required. The end date to pull data to.
:type to: ~datetime.datetime
"""
_validation = {
'from_property': {'required': True},
'to': {'required': True},
}
_attribute_map = {
'from_property': {'key': 'from', 'type': 'iso-8601'},
'to': {'key': 'to', 'type': 'iso-8601'},
}
def __init__(
self,
*,
from_property: datetime.datetime,
to: datetime.datetime,
**kwargs
):
super(ReportConfigTimePeriod, self).__init__(**kwargs)
self.from_property = from_property
self.to = to
|
class ReportConfigTimePeriod(msrest.serialization.Model):
'''The start and end date for pulling data for the report.
All required parameters must be populated in order to send to Azure.
:param from_property: Required. The start date to pull data from.
:type from_property: ~datetime.datetime
:param to: Required. The end date to pull data to.
:type to: ~datetime.datetime
'''
def __init__(
self,
*,
from_property: datetime.datetime,
to: datetime.datetime,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.37 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 31 | 5 | 19 | 12 | 11 | 7 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,131 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ReportConfigDataset
|
class ReportConfigDataset(msrest.serialization.Model):
"""The definition of data present in the report.
:param granularity: The granularity of rows in the report. Possible values include: "Daily",
"Monthly".
:type granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType
:param configuration: Has configuration information for the data in the report. The
configuration will be ignored if aggregation and grouping are provided.
:type configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration
:param aggregation: Dictionary of aggregation expression to use in the report. The key of each
item in the dictionary is the alias for the aggregated column. Report can have up to 2
aggregation clauses.
:type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation]
:param grouping: Array of group by expression to use in the report. Report can have up to 2
group by clauses.
:type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping]
:param sorting: Array of order by expression to use in the report.
:type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting]
:param filter: Has filter expression to use in the report.
:type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter
"""
_validation = {
'grouping': {'max_items': 2, 'min_items': 0},
}
_attribute_map = {
'granularity': {'key': 'granularity', 'type': 'str'},
'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'},
'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'},
'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'},
'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'},
'filter': {'key': 'filter', 'type': 'ReportConfigFilter'},
}
def __init__(
self,
*,
granularity: Optional[Union[str, "ReportGranularityType"]] = None,
configuration: Optional["ReportConfigDatasetConfiguration"] = None,
aggregation: Optional[Dict[str, "ReportConfigAggregation"]] = None,
grouping: Optional[List["ReportConfigGrouping"]] = None,
sorting: Optional[List["ReportConfigSorting"]] = None,
filter: Optional["ReportConfigFilter"] = None,
**kwargs
):
super(ReportConfigDataset, self).__init__(**kwargs)
self.granularity = granularity
self.configuration = configuration
self.aggregation = aggregation
self.grouping = grouping
self.sorting = sorting
self.filter = filter
|
class ReportConfigDataset(msrest.serialization.Model):
'''The definition of data present in the report.
:param granularity: The granularity of rows in the report. Possible values include: "Daily",
"Monthly".
:type granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType
:param configuration: Has configuration information for the data in the report. The
configuration will be ignored if aggregation and grouping are provided.
:type configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration
:param aggregation: Dictionary of aggregation expression to use in the report. The key of each
item in the dictionary is the alias for the aggregated column. Report can have up to 2
aggregation clauses.
:type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation]
:param grouping: Array of group by expression to use in the report. Report can have up to 2
group by clauses.
:type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping]
:param sorting: Array of order by expression to use in the report.
:type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting]
:param filter: Has filter expression to use in the report.
:type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter
'''
def __init__(
self,
*,
granularity: Optional[Union[str, "ReportGranularityType"]] = None,
configuration: Optional["ReportConfigDatasetConfiguration"] = None,
aggregation: Optional[Dict[str, "ReportConfigAggregation"]] = None,
grouping: Optional[List["ReportConfigGrouping"]] = None,
sorting: Optional[List["ReportConfigSorting"]] = None,
filter: Optional["ReportConfigFilter"] = None,
**kwargs
):
pass
| 2 | 1 | 18 | 0 | 18 | 0 | 1 | 0.63 | 1 | 2 | 0 | 0 | 1 | 6 | 1 | 1 | 53 | 4 | 30 | 20 | 18 | 19 | 11 | 10 | 9 | 1 | 1 | 0 | 1 |
8,132 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.QueryComparisonExpression
|
class QueryComparisonExpression(msrest.serialization.Model):
"""The comparison expression to be used in the query.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to use in comparison.
:type name: str
:param operator: Required. The operator to use for comparison. Possible values include: "In".
:type operator: str or ~azure.mgmt.costmanagement.models.QueryOperatorType
:param values: Required. Array of values to use for comparison.
:type values: list[str]
"""
_validation = {
'name': {'required': True},
'operator': {'required': True},
'values': {'required': True, 'min_items': 1},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'values': {'key': 'values', 'type': '[str]'},
}
def __init__(
self,
*,
name: str,
operator: Union[str, "QueryOperatorType"],
values: List[str],
**kwargs
):
super(QueryComparisonExpression, self).__init__(**kwargs)
self.name = name
self.operator = operator
self.values = values
|
class QueryComparisonExpression(msrest.serialization.Model):
'''The comparison expression to be used in the query.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to use in comparison.
:type name: str
:param operator: Required. The operator to use for comparison. Possible values include: "In".
:type operator: str or ~azure.mgmt.costmanagement.models.QueryOperatorType
:param values: Required. Array of values to use for comparison.
:type values: list[str]
'''
def __init__(
self,
*,
name: str,
operator: Union[str, "QueryOperatorType"],
values: List[str],
**kwargs
):
pass
| 2 | 1 | 12 | 0 | 12 | 0 | 1 | 0.39 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 1 | 37 | 5 | 23 | 14 | 14 | 9 | 8 | 7 | 6 | 1 | 1 | 0 | 1 |
8,133 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.QueryAggregation
|
class QueryAggregation(msrest.serialization.Model):
"""The aggregation expression to be used in the query.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to aggregate.
:type name: str
:param function: Required. The name of the aggregation function to use. Possible values
include: "Sum".
:type function: str or ~azure.mgmt.costmanagement.models.FunctionType
"""
_validation = {
'name': {'required': True},
'function': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'function': {'key': 'function', 'type': 'str'},
}
def __init__(
self,
*,
name: str,
function: Union[str, "FunctionType"],
**kwargs
):
super(QueryAggregation, self).__init__(**kwargs)
self.name = name
self.function = function
|
class QueryAggregation(msrest.serialization.Model):
'''The aggregation expression to be used in the query.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to aggregate.
:type name: str
:param function: Required. The name of the aggregation function to use. Possible values
include: "Sum".
:type function: str or ~azure.mgmt.costmanagement.models.FunctionType
'''
def __init__(
self,
*,
name: str,
function: Union[str, "FunctionType"],
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.42 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 32 | 5 | 19 | 12 | 11 | 8 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,134 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.Resource
|
class Resource(msrest.serialization.Model):
"""The Resource model definition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar tags: A set of tags. Resource tags.
:vartype tags: dict[str, str]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'tags': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(
self,
**kwargs
):
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.tags = None
|
class Resource(msrest.serialization.Model):
'''The Resource model definition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar tags: A set of tags. Resource tags.
:vartype tags: dict[str, str]
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 9 | 0 | 9 | 0 | 1 | 0.5 | 1 | 1 | 0 | 3 | 1 | 4 | 1 | 1 | 38 | 5 | 22 | 11 | 17 | 11 | 9 | 8 | 7 | 1 | 1 | 0 | 1 |
8,135 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportDeliveryDestination
|
class ExportDeliveryDestination(msrest.serialization.Model):
"""The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services .
All required parameters must be populated in order to send to Azure.
:param resource_id: Required. The resource id of the storage account where exports will be
delivered.
:type resource_id: str
:param container: Required. The name of the container where exports will be uploaded.
:type container: str
:param root_folder_path: The name of the directory where exports will be uploaded.
:type root_folder_path: str
"""
_validation = {
'resource_id': {'required': True},
'container': {'required': True},
}
_attribute_map = {
'resource_id': {'key': 'resourceId', 'type': 'str'},
'container': {'key': 'container', 'type': 'str'},
'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'},
}
def __init__(
self,
*,
resource_id: str,
container: str,
root_folder_path: Optional[str] = None,
**kwargs
):
super(ExportDeliveryDestination, self).__init__(**kwargs)
self.resource_id = resource_id
self.container = container
self.root_folder_path = root_folder_path
|
class ExportDeliveryDestination(msrest.serialization.Model):
'''The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services .
All required parameters must be populated in order to send to Azure.
:param resource_id: Required. The resource id of the storage account where exports will be
delivered.
:type resource_id: str
:param container: Required. The name of the container where exports will be uploaded.
:type container: str
:param root_folder_path: The name of the directory where exports will be uploaded.
:type root_folder_path: str
'''
def __init__(
self,
*,
resource_id: str,
container: str,
root_folder_path: Optional[str] = None,
**kwargs
):
pass
| 2 | 1 | 12 | 0 | 12 | 0 | 1 | 0.45 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 1 | 37 | 5 | 22 | 14 | 13 | 10 | 8 | 7 | 6 | 1 | 1 | 0 | 1 |
8,136 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportDeliveryInfo
|
class ExportDeliveryInfo(msrest.serialization.Model):
"""The delivery information associated with a export.
All required parameters must be populated in order to send to Azure.
:param destination: Required. Has destination for the export being delivered.
:type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination
"""
_validation = {
'destination': {'required': True},
}
_attribute_map = {
'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'},
}
def __init__(
self,
*,
destination: "ExportDeliveryDestination",
**kwargs
):
super(ExportDeliveryInfo, self).__init__(**kwargs)
self.destination = destination
|
class ExportDeliveryInfo(msrest.serialization.Model):
'''The delivery information associated with a export.
All required parameters must be populated in order to send to Azure.
:param destination: Required. Has destination for the export being delivered.
:type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination
'''
def __init__(
self,
*,
destination: "ExportDeliveryDestination",
**kwargs
):
pass
| 2 | 1 | 8 | 0 | 8 | 0 | 1 | 0.33 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 25 | 5 | 15 | 10 | 8 | 5 | 6 | 5 | 4 | 1 | 1 | 0 | 1 |
8,137 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportExecution
|
class ExportExecution(ProxyResource):
"""An export execution.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be
used to determine whether the user is updating the latest version or not.
:type e_tag: str
:param execution_type: The type of the export execution. Possible values include: "OnDemand",
"Scheduled".
:type execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType
:param status: The last known status of the export execution. Possible values include:
"Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable",
"DataNotAvailable".
:type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus
:param submitted_by: The identifier for the entity that executed the export. For OnDemand
executions it is the user email. For scheduled executions it is 'System'.
:type submitted_by: str
:param submitted_time: The time when export was queued to be executed.
:type submitted_time: ~datetime.datetime
:param processing_start_time: The time when export was picked up to be executed.
:type processing_start_time: ~datetime.datetime
:param processing_end_time: The time when the export execution finished.
:type processing_end_time: ~datetime.datetime
:param file_name: The name of the exported file.
:type file_name: str
:param run_settings: The export settings that were in effect for this execution.
:type run_settings: ~azure.mgmt.costmanagement.models.CommonExportProperties
:param error: The details of any error.
:type error: ~azure.mgmt.costmanagement.models.ErrorDetails
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'execution_type': {'key': 'properties.executionType', 'type': 'str'},
'status': {'key': 'properties.status', 'type': 'str'},
'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'},
'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'},
'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'},
'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'},
'file_name': {'key': 'properties.fileName', 'type': 'str'},
'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'},
'error': {'key': 'properties.error', 'type': 'ErrorDetails'},
}
def __init__(
self,
*,
e_tag: Optional[str] = None,
execution_type: Optional[Union[str, "ExecutionType"]] = None,
status: Optional[Union[str, "ExecutionStatus"]] = None,
submitted_by: Optional[str] = None,
submitted_time: Optional[datetime.datetime] = None,
processing_start_time: Optional[datetime.datetime] = None,
processing_end_time: Optional[datetime.datetime] = None,
file_name: Optional[str] = None,
run_settings: Optional["CommonExportProperties"] = None,
error: Optional["ErrorDetails"] = None,
**kwargs
):
super(ExportExecution, self).__init__(e_tag=e_tag, **kwargs)
self.execution_type = execution_type
self.status = status
self.submitted_by = submitted_by
self.submitted_time = submitted_time
self.processing_start_time = processing_start_time
self.processing_end_time = processing_end_time
self.file_name = file_name
self.run_settings = run_settings
self.error = error
|
class ExportExecution(ProxyResource):
'''An export execution.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be
used to determine whether the user is updating the latest version or not.
:type e_tag: str
:param execution_type: The type of the export execution. Possible values include: "OnDemand",
"Scheduled".
:type execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType
:param status: The last known status of the export execution. Possible values include:
"Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable",
"DataNotAvailable".
:type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus
:param submitted_by: The identifier for the entity that executed the export. For OnDemand
executions it is the user email. For scheduled executions it is 'System'.
:type submitted_by: str
:param submitted_time: The time when export was queued to be executed.
:type submitted_time: ~datetime.datetime
:param processing_start_time: The time when export was picked up to be executed.
:type processing_start_time: ~datetime.datetime
:param processing_end_time: The time when the export execution finished.
:type processing_end_time: ~datetime.datetime
:param file_name: The name of the exported file.
:type file_name: str
:param run_settings: The export settings that were in effect for this execution.
:type run_settings: ~azure.mgmt.costmanagement.models.CommonExportProperties
:param error: The details of any error.
:type error: ~azure.mgmt.costmanagement.models.ErrorDetails
'''
def __init__(
self,
*,
e_tag: Optional[str] = None,
execution_type: Optional[Union[str, "ExecutionType"]] = None,
status: Optional[Union[str, "ExecutionStatus"]] = None,
submitted_by: Optional[str] = None,
submitted_time: Optional[datetime.datetime] = None,
processing_start_time: Optional[datetime.datetime] = None,
processing_end_time: Optional[datetime.datetime] = None,
file_name: Optional[str] = None,
run_settings: Optional["CommonExportProperties"] = None,
error: Optional["ErrorDetails"] = None,
**kwargs
):
pass
| 2 | 1 | 25 | 0 | 25 | 0 | 1 | 0.74 | 1 | 3 | 0 | 0 | 1 | 9 | 1 | 2 | 85 | 5 | 46 | 27 | 30 | 34 | 14 | 13 | 12 | 1 | 2 | 0 | 1 |
8,138 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportExecutionListResult
|
class ExportExecutionListResult(msrest.serialization.Model):
"""Result of listing the execution history of an export.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: A list of export executions.
:vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution]
"""
_validation = {
'value': {'readonly': True},
}
_attribute_map = {
'value': {'key': 'value', 'type': '[ExportExecution]'},
}
def __init__(
self,
**kwargs
):
super(ExportExecutionListResult, self).__init__(**kwargs)
self.value = None
|
class ExportExecutionListResult(msrest.serialization.Model):
'''Result of listing the execution history of an export.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: A list of export executions.
:vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution]
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 6 | 0 | 6 | 0 | 1 | 0.38 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 23 | 5 | 13 | 8 | 8 | 5 | 6 | 5 | 4 | 1 | 1 | 0 | 1 |
8,139 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportListResult
|
class ExportListResult(msrest.serialization.Model):
"""Result of listing exports. It contains a list of available exports in the scope provided.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The list of exports.
:vartype value: list[~azure.mgmt.costmanagement.models.Export]
"""
_validation = {
'value': {'readonly': True},
}
_attribute_map = {
'value': {'key': 'value', 'type': '[Export]'},
}
def __init__(
self,
**kwargs
):
super(ExportListResult, self).__init__(**kwargs)
self.value = None
|
class ExportListResult(msrest.serialization.Model):
'''Result of listing exports. It contains a list of available exports in the scope provided.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The list of exports.
:vartype value: list[~azure.mgmt.costmanagement.models.Export]
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 6 | 0 | 6 | 0 | 1 | 0.38 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 23 | 5 | 13 | 8 | 8 | 5 | 6 | 5 | 4 | 1 | 1 | 0 | 1 |
8,140 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportProperties
|
class ExportProperties(CommonExportProperties):
"""The properties of the export.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:param format: The format of the export being delivered. Currently only 'Csv' is supported.
Possible values include: "Csv".
:type format: str or ~azure.mgmt.costmanagement.models.FormatType
:param delivery_info: Required. Has delivery information for the export.
:type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo
:param definition: Required. Has the definition for the export.
:type definition: ~azure.mgmt.costmanagement.models.ExportDefinition
:param run_history: If requested, has the most recent execution history for the export.
:type run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
:ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the
next execution time.
:vartype next_run_time_estimate: ~datetime.datetime
:param schedule: Has schedule information for the export.
:type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule
"""
_validation = {
'delivery_info': {'required': True},
'definition': {'required': True},
'next_run_time_estimate': {'readonly': True},
}
_attribute_map = {
'format': {'key': 'format', 'type': 'str'},
'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'},
'definition': {'key': 'definition', 'type': 'ExportDefinition'},
'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'},
'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'},
'schedule': {'key': 'schedule', 'type': 'ExportSchedule'},
}
def __init__(
self,
*,
delivery_info: "ExportDeliveryInfo",
definition: "ExportDefinition",
format: Optional[Union[str, "FormatType"]] = None,
run_history: Optional["ExportExecutionListResult"] = None,
schedule: Optional["ExportSchedule"] = None,
**kwargs
):
super(ExportProperties, self).__init__(format=format, delivery_info=delivery_info, definition=definition, run_history=run_history, **kwargs)
self.schedule = schedule
|
class ExportProperties(CommonExportProperties):
'''The properties of the export.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:param format: The format of the export being delivered. Currently only 'Csv' is supported.
Possible values include: "Csv".
:type format: str or ~azure.mgmt.costmanagement.models.FormatType
:param delivery_info: Required. Has delivery information for the export.
:type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo
:param definition: Required. Has the definition for the export.
:type definition: ~azure.mgmt.costmanagement.models.ExportDefinition
:param run_history: If requested, has the most recent execution history for the export.
:type run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
:ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the
next execution time.
:vartype next_run_time_estimate: ~datetime.datetime
:param schedule: Has schedule information for the export.
:type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule
'''
def __init__(
self,
*,
delivery_info: "ExportDeliveryInfo",
definition: "ExportDefinition",
format: Optional[Union[str, "FormatType"]] = None,
run_history: Optional["ExportExecutionListResult"] = None,
schedule: Optional["ExportSchedule"] = None,
**kwargs
):
pass
| 2 | 1 | 12 | 0 | 12 | 0 | 1 | 0.69 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 2 | 50 | 6 | 26 | 14 | 15 | 18 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,141 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportRecurrencePeriod
|
class ExportRecurrencePeriod(msrest.serialization.Model):
"""The start and end date for recurrence schedule.
All required parameters must be populated in order to send to Azure.
:param from_property: Required. The start date of recurrence.
:type from_property: ~datetime.datetime
:param to: The end date of recurrence.
:type to: ~datetime.datetime
"""
_validation = {
'from_property': {'required': True},
}
_attribute_map = {
'from_property': {'key': 'from', 'type': 'iso-8601'},
'to': {'key': 'to', 'type': 'iso-8601'},
}
def __init__(
self,
*,
from_property: datetime.datetime,
to: Optional[datetime.datetime] = None,
**kwargs
):
super(ExportRecurrencePeriod, self).__init__(**kwargs)
self.from_property = from_property
self.to = to
|
class ExportRecurrencePeriod(msrest.serialization.Model):
'''The start and end date for recurrence schedule.
All required parameters must be populated in order to send to Azure.
:param from_property: Required. The start date of recurrence.
:type from_property: ~datetime.datetime
:param to: The end date of recurrence.
:type to: ~datetime.datetime
'''
def __init__(
self,
*,
from_property: datetime.datetime,
to: Optional[datetime.datetime] = None,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.39 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 30 | 5 | 18 | 12 | 10 | 7 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,142 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportSchedule
|
class ExportSchedule(msrest.serialization.Model):
"""The schedule associated with the export.
:param status: The status of the export's schedule. If 'Inactive', the export's schedule is
paused. Possible values include: "Active", "Inactive".
:type status: str or ~azure.mgmt.costmanagement.models.StatusType
:param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly",
"Monthly", "Annually".
:type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType
:param recurrence_period: Has start and end date of the recurrence. The start date must be in
future. If present, the end date must be greater than start date.
:type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod
"""
_attribute_map = {
'status': {'key': 'status', 'type': 'str'},
'recurrence': {'key': 'recurrence', 'type': 'str'},
'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'},
}
def __init__(
self,
*,
status: Optional[Union[str, "StatusType"]] = None,
recurrence: Optional[Union[str, "RecurrenceType"]] = None,
recurrence_period: Optional["ExportRecurrencePeriod"] = None,
**kwargs
):
super(ExportSchedule, self).__init__(**kwargs)
self.status = status
self.recurrence = recurrence
self.recurrence_period = recurrence_period
|
class ExportSchedule(msrest.serialization.Model):
'''The schedule associated with the export.
:param status: The status of the export's schedule. If 'Inactive', the export's schedule is
paused. Possible values include: "Active", "Inactive".
:type status: str or ~azure.mgmt.costmanagement.models.StatusType
:param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly",
"Monthly", "Annually".
:type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType
:param recurrence_period: Has start and end date of the recurrence. The start date must be in
future. If present, the end date must be greater than start date.
:type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod
'''
def __init__(
self,
*,
status: Optional[Union[str, "StatusType"]] = None,
recurrence: Optional[Union[str, "RecurrenceType"]] = None,
recurrence_period: Optional["ExportRecurrencePeriod"] = None,
**kwargs
):
pass
| 2 | 1 | 12 | 0 | 12 | 0 | 1 | 0.61 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 1 | 32 | 3 | 18 | 13 | 9 | 11 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,143 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportTimePeriod
|
class ExportTimePeriod(msrest.serialization.Model):
"""The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months.
All required parameters must be populated in order to send to Azure.
:param from_property: Required. The start date for export data.
:type from_property: ~datetime.datetime
:param to: Required. The end date for export data.
:type to: ~datetime.datetime
"""
_validation = {
'from_property': {'required': True},
'to': {'required': True},
}
_attribute_map = {
'from_property': {'key': 'from', 'type': 'iso-8601'},
'to': {'key': 'to', 'type': 'iso-8601'},
}
def __init__(
self,
*,
from_property: datetime.datetime,
to: datetime.datetime,
**kwargs
):
super(ExportTimePeriod, self).__init__(**kwargs)
self.from_property = from_property
self.to = to
|
class ExportTimePeriod(msrest.serialization.Model):
'''The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months.
All required parameters must be populated in order to send to Azure.
:param from_property: Required. The start date for export data.
:type from_property: ~datetime.datetime
:param to: Required. The end date for export data.
:type to: ~datetime.datetime
'''
def __init__(
self,
*,
from_property: datetime.datetime,
to: datetime.datetime,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.37 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 31 | 5 | 19 | 12 | 11 | 7 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,144 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ForecastDataset
|
class ForecastDataset(msrest.serialization.Model):
"""The definition of data present in the forecast.
:param granularity: The granularity of rows in the forecast. Possible values include: "Daily".
:type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType
:param configuration: Has configuration information for the data in the export. The
configuration will be ignored if aggregation and grouping are provided.
:type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration
:param aggregation: Dictionary of aggregation expression to use in the forecast. The key of
each item in the dictionary is the alias for the aggregated column. forecast can have up to 2
aggregation clauses.
:type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation]
:param filter: Has filter expression to use in the forecast.
:type filter: ~azure.mgmt.costmanagement.models.QueryFilter
"""
_attribute_map = {
'granularity': {'key': 'granularity', 'type': 'str'},
'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'},
'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'},
'filter': {'key': 'filter', 'type': 'QueryFilter'},
}
def __init__(
self,
*,
granularity: Optional[Union[str, "GranularityType"]] = None,
configuration: Optional["QueryDatasetConfiguration"] = None,
aggregation: Optional[Dict[str, "QueryAggregation"]] = None,
filter: Optional["QueryFilter"] = None,
**kwargs
):
super(ForecastDataset, self).__init__(**kwargs)
self.granularity = granularity
self.configuration = configuration
self.aggregation = aggregation
self.filter = filter
|
class ForecastDataset(msrest.serialization.Model):
'''The definition of data present in the forecast.
:param granularity: The granularity of rows in the forecast. Possible values include: "Daily".
:type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType
:param configuration: Has configuration information for the data in the export. The
configuration will be ignored if aggregation and grouping are provided.
:type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration
:param aggregation: Dictionary of aggregation expression to use in the forecast. The key of
each item in the dictionary is the alias for the aggregated column. forecast can have up to 2
aggregation clauses.
:type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation]
:param filter: Has filter expression to use in the forecast.
:type filter: ~azure.mgmt.costmanagement.models.QueryFilter
'''
def __init__(
self,
*,
granularity: Optional[Union[str, "GranularityType"]] = None,
configuration: Optional["QueryDatasetConfiguration"] = None,
aggregation: Optional[Dict[str, "QueryAggregation"]] = None,
filter: Optional["QueryFilter"] = None,
**kwargs
):
pass
| 2 | 1 | 14 | 0 | 14 | 0 | 1 | 0.62 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 1 | 37 | 3 | 21 | 15 | 11 | 13 | 8 | 7 | 6 | 1 | 1 | 0 | 1 |
8,145 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ForecastDefinition
|
class ForecastDefinition(msrest.serialization.Model):
"""The definition of a forecast.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of the forecast. Possible values include: "Usage",
"ActualCost", "AmortizedCost".
:type type: str or ~azure.mgmt.costmanagement.models.ForecastType
:param timeframe: Required. The time frame for pulling data for the forecast. If custom, then a
specific time period must be provided. Possible values include: "MonthToDate",
"BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom".
:type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType
:param time_period: Has time period for pulling data for the forecast.
:type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod
:param dataset: Has definition for data in this forecast.
:type dataset: ~azure.mgmt.costmanagement.models.ForecastDataset
:param include_actual_cost: a boolean determining if actualCost will be included.
:type include_actual_cost: bool
:param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included.
:type include_fresh_partial_cost: bool
"""
_validation = {
'type': {'required': True},
'timeframe': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'timeframe': {'key': 'timeframe', 'type': 'str'},
'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'},
'dataset': {'key': 'dataset', 'type': 'ForecastDataset'},
'include_actual_cost': {'key': 'includeActualCost', 'type': 'bool'},
'include_fresh_partial_cost': {'key': 'includeFreshPartialCost', 'type': 'bool'},
}
def __init__(
self,
*,
type: Union[str, "ForecastType"],
timeframe: Union[str, "ForecastTimeframeType"],
time_period: Optional["QueryTimePeriod"] = None,
dataset: Optional["ForecastDataset"] = None,
include_actual_cost: Optional[bool] = None,
include_fresh_partial_cost: Optional[bool] = None,
**kwargs
):
super(ForecastDefinition, self).__init__(**kwargs)
self.type = type
self.timeframe = timeframe
self.time_period = time_period
self.dataset = dataset
self.include_actual_cost = include_actual_cost
self.include_fresh_partial_cost = include_fresh_partial_cost
|
class ForecastDefinition(msrest.serialization.Model):
'''The definition of a forecast.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of the forecast. Possible values include: "Usage",
"ActualCost", "AmortizedCost".
:type type: str or ~azure.mgmt.costmanagement.models.ForecastType
:param timeframe: Required. The time frame for pulling data for the forecast. If custom, then a
specific time period must be provided. Possible values include: "MonthToDate",
"BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom".
:type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType
:param time_period: Has time period for pulling data for the forecast.
:type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod
:param dataset: Has definition for data in this forecast.
:type dataset: ~azure.mgmt.costmanagement.models.ForecastDataset
:param include_actual_cost: a boolean determining if actualCost will be included.
:type include_actual_cost: bool
:param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included.
:type include_fresh_partial_cost: bool
'''
def __init__(
self,
*,
type: Union[str, "ForecastType"],
timeframe: Union[str, "ForecastTimeframeType"],
time_period: Optional["QueryTimePeriod"] = None,
dataset: Optional["ForecastDataset"] = None,
include_actual_cost: Optional[bool] = None,
include_fresh_partial_cost: Optional[bool] = None,
**kwargs
):
pass
| 2 | 1 | 18 | 0 | 18 | 0 | 1 | 0.58 | 1 | 3 | 0 | 0 | 1 | 6 | 1 | 1 | 54 | 5 | 31 | 20 | 19 | 18 | 11 | 10 | 9 | 1 | 1 | 0 | 1 |
8,146 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.KpiProperties
|
class KpiProperties(msrest.serialization.Model):
"""Each KPI must contain a 'type' and 'enabled' key.
:param type: KPI type (Forecast, Budget). Possible values include: "Forecast", "Budget".
:type type: str or ~azure.mgmt.costmanagement.models.KpiType
:param id: ID of resource related to metric (budget).
:type id: str
:param enabled: show the KPI in the UI?.
:type enabled: bool
"""
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'id': {'key': 'id', 'type': 'str'},
'enabled': {'key': 'enabled', 'type': 'bool'},
}
def __init__(
self,
*,
type: Optional[Union[str, "KpiType"]] = None,
id: Optional[str] = None,
enabled: Optional[bool] = None,
**kwargs
):
super(KpiProperties, self).__init__(**kwargs)
self.type = type
self.id = id
self.enabled = enabled
|
class KpiProperties(msrest.serialization.Model):
'''Each KPI must contain a 'type' and 'enabled' key.
:param type: KPI type (Forecast, Budget). Possible values include: "Forecast", "Budget".
:type type: str or ~azure.mgmt.costmanagement.models.KpiType
:param id: ID of resource related to metric (budget).
:type id: str
:param enabled: show the KPI in the UI?.
:type enabled: bool
'''
def __init__(
self,
*,
type: Optional[Union[str, "KpiType"]] = None,
id: Optional[str] = None,
enabled: Optional[bool] = None,
**kwargs
):
pass
| 2 | 1 | 12 | 0 | 12 | 0 | 1 | 0.44 | 1 | 3 | 0 | 0 | 1 | 3 | 1 | 1 | 29 | 3 | 18 | 13 | 9 | 8 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,147 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.Operation
|
class Operation(msrest.serialization.Model):
"""A Cost management REST API operation.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name: Operation name: {provider}/{resource}/{operation}.
:vartype name: str
:param display: The object that represents the operation.
:type display: ~azure.mgmt.costmanagement.models.OperationDisplay
"""
_validation = {
'name': {'readonly': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'OperationDisplay'},
}
def __init__(
self,
*,
display: Optional["OperationDisplay"] = None,
**kwargs
):
super(Operation, self).__init__(**kwargs)
self.name = None
self.display = display
|
class Operation(msrest.serialization.Model):
'''A Cost management REST API operation.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name: Operation name: {provider}/{resource}/{operation}.
:vartype name: str
:param display: The object that represents the operation.
:type display: ~azure.mgmt.costmanagement.models.OperationDisplay
'''
def __init__(
self,
*,
display: Optional["OperationDisplay"] = None,
**kwargs
):
pass
| 2 | 1 | 9 | 0 | 9 | 0 | 1 | 0.41 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 1 | 29 | 5 | 17 | 11 | 10 | 7 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,148 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.OperationDisplay
|
class OperationDisplay(msrest.serialization.Model):
"""The object that represents the operation.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar provider: Service provider: Microsoft.CostManagement.
:vartype provider: str
:ivar resource: Resource on which the operation is performed: Dimensions, Query.
:vartype resource: str
:ivar operation: Operation type: Read, write, delete, etc.
:vartype operation: str
"""
_validation = {
'provider': {'readonly': True},
'resource': {'readonly': True},
'operation': {'readonly': True},
}
_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(OperationDisplay, self).__init__(**kwargs)
self.provider = None
self.resource = None
self.operation = None
|
class OperationDisplay(msrest.serialization.Model):
'''The object that represents the operation.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar provider: Service provider: Microsoft.CostManagement.
:vartype provider: str
:ivar resource: Resource on which the operation is performed: Dimensions, Query.
:vartype resource: str
:ivar operation: Operation type: Read, write, delete, etc.
:vartype operation: str
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 8 | 0 | 8 | 0 | 1 | 0.47 | 1 | 1 | 0 | 0 | 1 | 3 | 1 | 1 | 33 | 5 | 19 | 10 | 14 | 9 | 8 | 7 | 6 | 1 | 1 | 0 | 1 |
8,149 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.OperationListResult
|
class OperationListResult(msrest.serialization.Model):
"""Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of cost management operations supported by the Microsoft.CostManagement
resource provider.
:vartype value: list[~azure.mgmt.costmanagement.models.Operation]
:ivar next_link: URL to get the next set of operation list results if there are any.
:vartype next_link: str
"""
_validation = {
'value': {'readonly': True},
'next_link': {'readonly': True},
}
_attribute_map = {
'value': {'key': 'value', 'type': '[Operation]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(OperationListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
|
class OperationListResult(msrest.serialization.Model):
'''Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of cost management operations supported by the Microsoft.CostManagement
resource provider.
:vartype value: list[~azure.mgmt.costmanagement.models.Operation]
:ivar next_link: URL to get the next set of operation list results if there are any.
:vartype next_link: str
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 7 | 0 | 7 | 0 | 1 | 0.5 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 1 | 29 | 5 | 16 | 9 | 11 | 8 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,150 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.PivotProperties
|
class PivotProperties(msrest.serialization.Model):
"""Each pivot must contain a 'type' and 'name'.
:param type: Data type to show in view. Possible values include: "Dimension", "TagKey".
:type type: str or ~azure.mgmt.costmanagement.models.PivotType
:param name: Data field to show in view.
:type name: str
"""
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
}
def __init__(
self,
*,
type: Optional[Union[str, "PivotType"]] = None,
name: Optional[str] = None,
**kwargs
):
super(PivotProperties, self).__init__(**kwargs)
self.type = type
self.name = name
|
class PivotProperties(msrest.serialization.Model):
'''Each pivot must contain a 'type' and 'name'.
:param type: Data type to show in view. Possible values include: "Dimension", "TagKey".
:type type: str or ~azure.mgmt.costmanagement.models.PivotType
:param name: Data field to show in view.
:type name: str
'''
def __init__(
self,
*,
type: Optional[Union[str, "PivotType"]] = None,
name: Optional[str] = None,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.4 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 24 | 3 | 15 | 11 | 7 | 6 | 6 | 5 | 4 | 1 | 1 | 0 | 1 |
8,151 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ProxyResource
|
class ProxyResource(msrest.serialization.Model):
"""The Resource model definition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be
used to determine whether the user is updating the latest version or not.
:type e_tag: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'e_tag': {'key': 'eTag', 'type': 'str'},
}
def __init__(
self,
*,
e_tag: Optional[str] = None,
**kwargs
):
super(ProxyResource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.e_tag = e_tag
|
class ProxyResource(msrest.serialization.Model):
'''The Resource model definition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be
used to determine whether the user is updating the latest version or not.
:type e_tag: str
'''
def __init__(
self,
*,
e_tag: Optional[str] = None,
**kwargs
):
pass
| 2 | 1 | 11 | 0 | 11 | 0 | 1 | 0.52 | 1 | 2 | 0 | 3 | 1 | 4 | 1 | 1 | 40 | 5 | 23 | 13 | 16 | 12 | 9 | 8 | 7 | 1 | 1 | 0 | 1 |
8,152 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.QueryColumn
|
class QueryColumn(msrest.serialization.Model):
"""QueryColumn.
:param name: The name of column.
:type name: str
:param type: The type of column.
:type type: str
"""
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}
def __init__(
self,
*,
name: Optional[str] = None,
type: Optional[str] = None,
**kwargs
):
super(QueryColumn, self).__init__(**kwargs)
self.name = name
self.type = type
|
class QueryColumn(msrest.serialization.Model):
'''QueryColumn.
:param name: The name of column.
:type name: str
:param type: The type of column.
:type type: str
'''
def __init__(
self,
*,
name: Optional[str] = None,
type: Optional[str] = None,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.4 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 24 | 3 | 15 | 11 | 7 | 6 | 6 | 5 | 4 | 1 | 1 | 0 | 1 |
8,153 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.View
|
class View(ProxyResource):
"""States and configurations of Cost Analysis.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be
used to determine whether the user is updating the latest version or not.
:type e_tag: str
:param display_name: User input name of the view. Required.
:type display_name: str
:param scope: Cost Management scope to save the view on. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
ExternalBillingAccount scope, and
'/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
ExternalSubscription scope.
:type scope: str
:ivar created_on: Date the user created this view.
:vartype created_on: ~datetime.datetime
:ivar modified_on: Date when the user last modified this view.
:vartype modified_on: ~datetime.datetime
:param chart: Chart type of the main view in Cost Analysis. Required. Possible values include:
"Area", "Line", "StackedColumn", "GroupedColumn", "Table".
:type chart: str or ~azure.mgmt.costmanagement.models.ChartType
:param accumulated: Show costs accumulated over time. Possible values include: "true", "false".
:type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType
:param metric: Metric to use when displaying costs. Possible values include: "ActualCost",
"AmortizedCost", "AHUB".
:type metric: str or ~azure.mgmt.costmanagement.models.MetricType
:param kpis: List of KPIs to show in Cost Analysis UI.
:type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties]
:param pivots: Configuration of 3 sub-views in the Cost Analysis UI.
:type pivots: list[~azure.mgmt.costmanagement.models.PivotProperties]
:param type_properties_query_type: The type of the report. Usage represents actual usage,
forecast represents forecasted data and UsageAndForecast represents both usage and forecasted
data. Actual usage and forecasted data can be differentiated based on dates. Possible values
include: "Usage".
:type type_properties_query_type: str or ~azure.mgmt.costmanagement.models.ReportType
:param timeframe: The time frame for pulling data for the report. If custom, then a specific
time period must be provided. Possible values include: "WeekToDate", "MonthToDate",
"YearToDate", "Custom".
:type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType
:param time_period: Has time period for pulling data for the report.
:type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod
:param dataset: Has definition for data in this report config.
:type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'created_on': {'readonly': True},
'modified_on': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'scope': {'key': 'properties.scope', 'type': 'str'},
'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'},
'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'},
'chart': {'key': 'properties.chart', 'type': 'str'},
'accumulated': {'key': 'properties.accumulated', 'type': 'str'},
'metric': {'key': 'properties.metric', 'type': 'str'},
'kpis': {'key': 'properties.kpis', 'type': '[KpiProperties]'},
'pivots': {'key': 'properties.pivots', 'type': '[PivotProperties]'},
'type_properties_query_type': {'key': 'properties.query.type', 'type': 'str'},
'timeframe': {'key': 'properties.query.timeframe', 'type': 'str'},
'time_period': {'key': 'properties.query.timePeriod', 'type': 'ReportConfigTimePeriod'},
'dataset': {'key': 'properties.query.dataset', 'type': 'ReportConfigDataset'},
}
def __init__(
self,
*,
e_tag: Optional[str] = None,
display_name: Optional[str] = None,
scope: Optional[str] = None,
chart: Optional[Union[str, "ChartType"]] = None,
accumulated: Optional[Union[str, "AccumulatedType"]] = None,
metric: Optional[Union[str, "MetricType"]] = None,
kpis: Optional[List["KpiProperties"]] = None,
pivots: Optional[List["PivotProperties"]] = None,
type_properties_query_type: Optional[Union[str, "ReportType"]] = None,
timeframe: Optional[Union[str, "ReportTimeframeType"]] = None,
time_period: Optional["ReportConfigTimePeriod"] = None,
dataset: Optional["ReportConfigDataset"] = None,
**kwargs
):
super(View, self).__init__(e_tag=e_tag, **kwargs)
self.display_name = display_name
self.scope = scope
self.created_on = None
self.modified_on = None
self.chart = chart
self.accumulated = accumulated
self.metric = metric
self.kpis = kpis
self.pivots = pivots
self.type_properties_query_type = type_properties_query_type
self.timeframe = timeframe
self.time_period = time_period
self.dataset = dataset
|
class View(ProxyResource):
'''States and configurations of Cost Analysis.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be
used to determine whether the user is updating the latest version or not.
:type e_tag: str
:param display_name: User input name of the view. Required.
:type display_name: str
:param scope: Cost Management scope to save the view on. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
ExternalBillingAccount scope, and
'/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
ExternalSubscription scope.
:type scope: str
:ivar created_on: Date the user created this view.
:vartype created_on: ~datetime.datetime
:ivar modified_on: Date when the user last modified this view.
:vartype modified_on: ~datetime.datetime
:param chart: Chart type of the main view in Cost Analysis. Required. Possible values include:
"Area", "Line", "StackedColumn", "GroupedColumn", "Table".
:type chart: str or ~azure.mgmt.costmanagement.models.ChartType
:param accumulated: Show costs accumulated over time. Possible values include: "true", "false".
:type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType
:param metric: Metric to use when displaying costs. Possible values include: "ActualCost",
"AmortizedCost", "AHUB".
:type metric: str or ~azure.mgmt.costmanagement.models.MetricType
:param kpis: List of KPIs to show in Cost Analysis UI.
:type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties]
:param pivots: Configuration of 3 sub-views in the Cost Analysis UI.
:type pivots: list[~azure.mgmt.costmanagement.models.PivotProperties]
:param type_properties_query_type: The type of the report. Usage represents actual usage,
forecast represents forecasted data and UsageAndForecast represents both usage and forecasted
data. Actual usage and forecasted data can be differentiated based on dates. Possible values
include: "Usage".
:type type_properties_query_type: str or ~azure.mgmt.costmanagement.models.ReportType
:param timeframe: The time frame for pulling data for the report. If custom, then a specific
time period must be provided. Possible values include: "WeekToDate", "MonthToDate",
"YearToDate", "Custom".
:type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType
:param time_period: Has time period for pulling data for the report.
:type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod
:param dataset: Has definition for data in this report config.
:type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset
'''
def __init__(
self,
*,
e_tag: Optional[str] = None,
display_name: Optional[str] = None,
scope: Optional[str] = None,
chart: Optional[Union[str, "ChartType"]] = None,
accumulated: Optional[Union[str, "AccumulatedType"]] = None,
metric: Optional[Union[str, "MetricType"]] = None,
kpis: Optional[List["KpiProperties"]] = None,
pivots: Optional[List["PivotProperties"]] = None,
type_properties_query_type: Optional[Union[str, "ReportType"]] = None,
timeframe: Optional[Union[str, "ReportTimeframeType"]] = None,
time_period: Optional["ReportConfigTimePeriod"] = None,
dataset: Optional["ReportConfigDataset"] = None,
**kwargs
):
pass
| 2 | 1 | 31 | 0 | 31 | 0 | 1 | 1.05 | 1 | 2 | 0 | 0 | 1 | 13 | 1 | 2 | 124 | 5 | 58 | 33 | 40 | 61 | 18 | 17 | 16 | 1 | 2 | 0 | 1 |
8,154 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_dimensions_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.operations._dimensions_operations.DimensionsOperations
|
class DimensionsOperations(object):
"""DimensionsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def list(
self,
scope, # type: str
filter=None, # type: Optional[str]
expand=None, # type: Optional[str]
skiptoken=None, # type: Optional[str]
top=None, # type: Optional[int]
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.DimensionsListResult"]
"""Lists the dimensions by the defined scope.
:param scope: The scope associated with dimension operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param filter: May be used to filter dimensions by properties/category, properties/usageStart,
properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
:type filter: str
:param expand: May be used to expand the properties/data within a dimension category. By
default, data is not included when listing dimensions.
:type expand: str
:param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If
a previous response contains a nextLink element, the value of the nextLink element will include
a skiptoken parameter that specifies a starting point to use for subsequent calls.
:type skiptoken: str
:param top: May be used to limit the number of results to the most recent N dimension data.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DimensionsListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.DimensionsListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
if filter is not None:
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
if expand is not None:
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
if skiptoken is not None:
query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str')
if top is not None:
query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1)
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('DimensionsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} # type: ignore
def by_external_cloud_provider_type(
self,
external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"]
external_cloud_provider_id, # type: str
filter=None, # type: Optional[str]
expand=None, # type: Optional[str]
skiptoken=None, # type: Optional[str]
top=None, # type: Optional[int]
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.DimensionsListResult"]
"""Lists the dimensions by the external cloud provider type.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param filter: May be used to filter dimensions by properties/category, properties/usageStart,
properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
:type filter: str
:param expand: May be used to expand the properties/data within a dimension category. By
default, data is not included when listing dimensions.
:type expand: str
:param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If
a previous response contains a nextLink element, the value of the nextLink element will include
a skiptoken parameter that specifies a starting point to use for subsequent calls.
:type skiptoken: str
:param top: May be used to limit the number of results to the most recent N dimension data.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DimensionsListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.DimensionsListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.by_external_cloud_provider_type.metadata['url'] # type: ignore
path_format_arguments = {
'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'),
'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
if filter is not None:
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
if expand is not None:
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
if skiptoken is not None:
query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str')
if top is not None:
query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1)
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('DimensionsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions'}
|
class DimensionsOperations(object):
'''DimensionsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer):
pass
def list(
self,
scope, # type: str
filter=None, # type: Optional[str]
expand=None, # type: Optional[str]
skiptoken=None, # type: Optional[str]
top=None, # type: Optional[int]
**kwargs # type: Any
):
'''Lists the dimensions by the defined scope.
:param scope: The scope associated with dimension operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param filter: May be used to filter dimensions by properties/category, properties/usageStart,
properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
:type filter: str
:param expand: May be used to expand the properties/data within a dimension category. By
default, data is not included when listing dimensions.
:type expand: str
:param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If
a previous response contains a nextLink element, the value of the nextLink element will include
a skiptoken parameter that specifies a starting point to use for subsequent calls.
:type skiptoken: str
:param top: May be used to limit the number of results to the most recent N dimension data.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DimensionsListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
def by_external_cloud_provider_type(
self,
external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"]
external_cloud_provider_id, # type: str
filter=None, # type: Optional[str]
expand=None, # type: Optional[str]
skiptoken=None, # type: Optional[str]
top=None, # type: Optional[int]
**kwargs # type: Any
):
'''Lists the dimensions by the external cloud provider type.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param filter: May be used to filter dimensions by properties/category, properties/usageStart,
properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
:type filter: str
:param expand: May be used to expand the properties/data within a dimension category. By
default, data is not included when listing dimensions.
:type expand: str
:param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If
a previous response contains a nextLink element, the value of the nextLink element will include
a skiptoken parameter that specifies a starting point to use for subsequent calls.
:type skiptoken: str
:param top: May be used to limit the number of results to the most recent N dimension data.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DimensionsListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
| 10 | 3 | 34 | 3 | 23 | 12 | 3 | 0.8 | 1 | 1 | 0 | 0 | 3 | 4 | 3 | 3 | 233 | 26 | 129 | 62 | 102 | 103 | 97 | 45 | 87 | 6 | 1 | 2 | 23 |
8,155 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_alerts_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.operations._alerts_operations.AlertsOperations
|
class AlertsOperations(object):
"""AlertsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def list(
self,
scope, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.AlertsResult"
"""Lists the alerts for scope defined.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertsResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.AlertsResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertsResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('AlertsResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts'} # type: ignore
def get(
self,
scope, # type: str
alert_id, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.Alert"
"""Gets the alert for the scope by alert ID.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param alert_id: Alert ID.
:type alert_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Alert, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Alert
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Alert', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore
def dismiss(
self,
scope, # type: str
alert_id, # type: str
parameters, # type: "_models.DismissAlertPayload"
**kwargs # type: Any
):
# type: (...) -> "_models.Alert"
"""Dismisses the specified alert.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param alert_id: Alert ID.
:type alert_id: str
:param parameters: Parameters supplied to the Dismiss Alert operation.
:type parameters: ~azure.mgmt.costmanagement.models.DismissAlertPayload
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Alert, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Alert
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.dismiss.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'DismissAlertPayload')
body_content_kwargs['content'] = body_content
request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Alert', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
dismiss.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore
def list_external(
self,
external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"]
external_cloud_provider_id, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.AlertsResult"
"""Lists the Alerts for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertsResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.AlertsResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertsResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.list_external.metadata['url'] # type: ignore
path_format_arguments = {
'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'),
'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('AlertsResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
list_external.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'}
|
class AlertsOperations(object):
'''AlertsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer):
pass
def list(
self,
scope, # type: str
**kwargs # type: Any
):
'''Lists the alerts for scope defined.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertsResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.AlertsResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def get(
self,
scope, # type: str
alert_id, # type: str
**kwargs # type: Any
):
'''Gets the alert for the scope by alert ID.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param alert_id: Alert ID.
:type alert_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Alert, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Alert
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def dismiss(
self,
scope, # type: str
alert_id, # type: str
parameters, # type: "_models.DismissAlertPayload"
**kwargs # type: Any
):
'''Dismisses the specified alert.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param alert_id: Alert ID.
:type alert_id: str
:param parameters: Parameters supplied to the Dismiss Alert operation.
:type parameters: ~azure.mgmt.costmanagement.models.DismissAlertPayload
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Alert, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Alert
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def list_external(
self,
external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"]
external_cloud_provider_id, # type: str
**kwargs # type: Any
):
'''Lists the Alerts for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertsResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.AlertsResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
| 6 | 5 | 57 | 7 | 29 | 27 | 3 | 0.97 | 1 | 0 | 0 | 0 | 5 | 4 | 5 | 5 | 309 | 44 | 151 | 86 | 125 | 147 | 112 | 66 | 106 | 3 | 1 | 1 | 13 |
8,156 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.AssociationsList
|
class AssociationsList(msrest.serialization.Model):
"""List of associations.
:param value: The array of associations.
:type value: list[~azure.mgmt.customproviders.models.Association]
:param next_link: The URL to use for getting the next set of results.
:type next_link: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[Association]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(AssociationsList, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.next_link = kwargs.get('next_link', None)
|
class AssociationsList(msrest.serialization.Model):
'''List of associations.
:param value: The array of associations.
:type value: list[~azure.mgmt.customproviders.models.Association]
:param next_link: The URL to use for getting the next set of results.
:type next_link: str
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 7 | 0 | 7 | 0 | 1 | 0.5 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 1 | 21 | 3 | 12 | 8 | 7 | 6 | 6 | 5 | 4 | 1 | 1 | 0 | 1 |
8,157 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.CustomRPActionRouteDefinition
|
class CustomRPActionRouteDefinition(CustomRPRouteDefinition):
"""The route definition for an action implemented by the custom resource provider.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the route definition. This becomes the name for the ARM
extension (e.g.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}').
:type name: str
:param endpoint: Required. The route definition endpoint URI that the custom resource provider
will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or
can specify to route via a path (e.g. 'https://testendpoint/{requestPath}').
:type endpoint: str
:param routing_type: The routing types that are supported for action requests. Possible values
include: "Proxy".
:type routing_type: str or ~azure.mgmt.customproviders.models.ActionRouting
"""
_validation = {
'name': {'required': True},
'endpoint': {'required': True, 'pattern': r'^https://.+'},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'endpoint': {'key': 'endpoint', 'type': 'str'},
'routing_type': {'key': 'routingType', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(CustomRPActionRouteDefinition, self).__init__(**kwargs)
self.routing_type = kwargs.get('routing_type', None)
|
class CustomRPActionRouteDefinition(CustomRPRouteDefinition):
'''The route definition for an action implemented by the custom resource provider.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the route definition. This becomes the name for the ARM
extension (e.g.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}').
:type name: str
:param endpoint: Required. The route definition endpoint URI that the custom resource provider
will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or
can specify to route via a path (e.g. 'https://testendpoint/{requestPath}').
:type endpoint: str
:param routing_type: The routing types that are supported for action requests. Possible values
include: "Proxy".
:type routing_type: str or ~azure.mgmt.customproviders.models.ActionRouting
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 6 | 0 | 6 | 0 | 1 | 0.88 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 2 | 35 | 5 | 16 | 8 | 11 | 14 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,158 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.CustomRPManifest
|
class CustomRPManifest(Resource):
"""A manifest file that defines the custom resource provider resources.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. Resource location.
:type location: str
:param tags: A set of tags. Resource tags.
:type tags: dict[str, str]
:param actions: A list of actions that the custom resource provider implements.
:type actions: list[~azure.mgmt.customproviders.models.CustomRPActionRouteDefinition]
:param resource_types: A list of resource types that the custom resource provider implements.
:type resource_types:
list[~azure.mgmt.customproviders.models.CustomRPResourceTypeRouteDefinition]
:param validations: A list of validations to run on the custom resource provider's requests.
:type validations: list[~azure.mgmt.customproviders.models.CustomRPValidations]
:ivar provisioning_state: The provisioning state of the resource provider. Possible values
include: "Accepted", "Deleting", "Running", "Succeeded", "Failed".
:vartype provisioning_state: str or ~azure.mgmt.customproviders.models.ProvisioningState
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'provisioning_state': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'actions': {'key': 'properties.actions', 'type': '[CustomRPActionRouteDefinition]'},
'resource_types': {'key': 'properties.resourceTypes', 'type': '[CustomRPResourceTypeRouteDefinition]'},
'validations': {'key': 'properties.validations', 'type': '[CustomRPValidations]'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(CustomRPManifest, self).__init__(**kwargs)
self.actions = kwargs.get('actions', None)
self.resource_types = kwargs.get('resource_types', None)
self.validations = kwargs.get('validations', None)
self.provisioning_state = None
|
class CustomRPManifest(Resource):
'''A manifest file that defines the custom resource provider resources.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. Resource location.
:type location: str
:param tags: A set of tags. Resource tags.
:type tags: dict[str, str]
:param actions: A list of actions that the custom resource provider implements.
:type actions: list[~azure.mgmt.customproviders.models.CustomRPActionRouteDefinition]
:param resource_types: A list of resource types that the custom resource provider implements.
:type resource_types:
list[~azure.mgmt.customproviders.models.CustomRPResourceTypeRouteDefinition]
:param validations: A list of validations to run on the custom resource provider's requests.
:type validations: list[~azure.mgmt.customproviders.models.CustomRPValidations]
:ivar provisioning_state: The provisioning state of the resource provider. Possible values
include: "Accepted", "Deleting", "Running", "Succeeded", "Failed".
:vartype provisioning_state: str or ~azure.mgmt.customproviders.models.ProvisioningState
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 9 | 0 | 9 | 0 | 1 | 0.86 | 1 | 1 | 0 | 0 | 1 | 4 | 1 | 2 | 58 | 6 | 28 | 11 | 23 | 24 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
8,159 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.CustomRPResourceTypeRouteDefinition
|
class CustomRPResourceTypeRouteDefinition(CustomRPRouteDefinition):
"""The route definition for a resource implemented by the custom resource provider.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the route definition. This becomes the name for the ARM
extension (e.g.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}').
:type name: str
:param endpoint: Required. The route definition endpoint URI that the custom resource provider
will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or
can specify to route via a path (e.g. 'https://testendpoint/{requestPath}').
:type endpoint: str
:param routing_type: The routing types that are supported for resource requests. Possible
values include: "Proxy", "Proxy,Cache".
:type routing_type: str or ~azure.mgmt.customproviders.models.ResourceTypeRouting
"""
_validation = {
'name': {'required': True},
'endpoint': {'required': True, 'pattern': r'^https://.+'},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'endpoint': {'key': 'endpoint', 'type': 'str'},
'routing_type': {'key': 'routingType', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(CustomRPResourceTypeRouteDefinition, self).__init__(**kwargs)
self.routing_type = kwargs.get('routing_type', None)
|
class CustomRPResourceTypeRouteDefinition(CustomRPRouteDefinition):
'''The route definition for a resource implemented by the custom resource provider.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the route definition. This becomes the name for the ARM
extension (e.g.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}').
:type name: str
:param endpoint: Required. The route definition endpoint URI that the custom resource provider
will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or
can specify to route via a path (e.g. 'https://testendpoint/{requestPath}').
:type endpoint: str
:param routing_type: The routing types that are supported for resource requests. Possible
values include: "Proxy", "Proxy,Cache".
:type routing_type: str or ~azure.mgmt.customproviders.models.ResourceTypeRouting
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 6 | 0 | 6 | 0 | 1 | 0.88 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 2 | 35 | 5 | 16 | 8 | 11 | 14 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,160 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.CustomRPRouteDefinition
|
class CustomRPRouteDefinition(msrest.serialization.Model):
"""A route definition that defines an action or resource that can be interacted with through the custom resource provider.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the route definition. This becomes the name for the ARM
extension (e.g.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}').
:type name: str
:param endpoint: Required. The route definition endpoint URI that the custom resource provider
will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or
can specify to route via a path (e.g. 'https://testendpoint/{requestPath}').
:type endpoint: str
"""
_validation = {
'name': {'required': True},
'endpoint': {'required': True, 'pattern': r'^https://.+'},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'endpoint': {'key': 'endpoint', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(CustomRPRouteDefinition, self).__init__(**kwargs)
self.name = kwargs['name']
self.endpoint = kwargs['endpoint']
|
class CustomRPRouteDefinition(msrest.serialization.Model):
'''A route definition that defines an action or resource that can be interacted with through the custom resource provider.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the route definition. This becomes the name for the ARM
extension (e.g.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}').
:type name: str
:param endpoint: Required. The route definition endpoint URI that the custom resource provider
will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or
can specify to route via a path (e.g. 'https://testendpoint/{requestPath}').
:type endpoint: str
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 7 | 0 | 7 | 0 | 1 | 0.69 | 1 | 1 | 0 | 2 | 1 | 2 | 1 | 1 | 32 | 5 | 16 | 9 | 11 | 11 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,161 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.CustomRPValidations
|
class CustomRPValidations(msrest.serialization.Model):
"""A validation to apply on custom resource provider requests.
All required parameters must be populated in order to send to Azure.
:param validation_type: The type of validation to run against a matching request. Possible
values include: "Swagger".
:type validation_type: str or ~azure.mgmt.customproviders.models.ValidationType
:param specification: Required. A link to the validation specification. The specification must
be hosted on raw.githubusercontent.com.
:type specification: str
"""
_validation = {
'specification': {'required': True, 'pattern': r'^https://raw.githubusercontent.com/.+'},
}
_attribute_map = {
'validation_type': {'key': 'validationType', 'type': 'str'},
'specification': {'key': 'specification', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(CustomRPValidations, self).__init__(**kwargs)
self.validation_type = kwargs.get('validation_type', None)
self.specification = kwargs['specification']
|
class CustomRPValidations(msrest.serialization.Model):
'''A validation to apply on custom resource provider requests.
All required parameters must be populated in order to send to Azure.
:param validation_type: The type of validation to run against a matching request. Possible
values include: "Swagger".
:type validation_type: str or ~azure.mgmt.customproviders.models.ValidationType
:param specification: Required. A link to the validation specification. The specification must
be hosted on raw.githubusercontent.com.
:type specification: str
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 7 | 0 | 7 | 0 | 1 | 0.6 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 1 | 29 | 5 | 15 | 9 | 10 | 9 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,162 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.ErrorResponse
|
class ErrorResponse(msrest.serialization.Model):
"""Error response.
:param error: The error details.
:type error: ~azure.mgmt.customproviders.models.ErrorDefinition
"""
_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorDefinition'},
}
def __init__(
self,
**kwargs
):
super(ErrorResponse, self).__init__(**kwargs)
self.error = kwargs.get('error', None)
|
class ErrorResponse(msrest.serialization.Model):
'''Error response.
:param error: The error details.
:type error: ~azure.mgmt.customproviders.models.ErrorDefinition
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 6 | 0 | 6 | 0 | 1 | 0.4 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 17 | 3 | 10 | 7 | 5 | 4 | 5 | 4 | 3 | 1 | 1 | 0 | 1 |
8,163 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.ListByCustomRPManifest
|
class ListByCustomRPManifest(msrest.serialization.Model):
"""List of custom resource providers.
:param value: The array of custom resource provider manifests.
:type value: list[~azure.mgmt.customproviders.models.CustomRPManifest]
:param next_link: The URL to use for getting the next set of results.
:type next_link: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[CustomRPManifest]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(ListByCustomRPManifest, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.next_link = kwargs.get('next_link', None)
|
class ListByCustomRPManifest(msrest.serialization.Model):
'''List of custom resource providers.
:param value: The array of custom resource provider manifests.
:type value: list[~azure.mgmt.customproviders.models.CustomRPManifest]
:param next_link: The URL to use for getting the next set of results.
:type next_link: str
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 7 | 0 | 7 | 0 | 1 | 0.5 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 1 | 21 | 3 | 12 | 8 | 7 | 6 | 6 | 5 | 4 | 1 | 1 | 0 | 1 |
8,164 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.Resource
|
class Resource(msrest.serialization.Model):
"""The resource definition.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. Resource location.
:type location: str
:param tags: A set of tags. Resource tags.
:type tags: dict[str, str]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(
self,
**kwargs
):
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.location = kwargs['location']
self.tags = kwargs.get('tags', None)
|
class Resource(msrest.serialization.Model):
'''The resource definition.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. Resource location.
:type location: str
:param tags: A set of tags. Resource tags.
:type tags: dict[str, str]
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.58 | 1 | 1 | 0 | 1 | 1 | 5 | 1 | 1 | 44 | 6 | 24 | 12 | 19 | 14 | 10 | 9 | 8 | 1 | 1 | 0 | 1 |
8,165 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.ResourceProviderOperation
|
class ResourceProviderOperation(msrest.serialization.Model):
"""Supported operations of this resource provider.
:param name: Operation name, in format of {provider}/{resource}/{operation}.
:type name: str
:param display: Display metadata associated with the operation.
:type display: ~azure.mgmt.customproviders.models.ResourceProviderOperationDisplay
"""
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'},
}
def __init__(
self,
**kwargs
):
super(ResourceProviderOperation, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.display = kwargs.get('display', None)
|
class ResourceProviderOperation(msrest.serialization.Model):
'''Supported operations of this resource provider.
:param name: Operation name, in format of {provider}/{resource}/{operation}.
:type name: str
:param display: Display metadata associated with the operation.
:type display: ~azure.mgmt.customproviders.models.ResourceProviderOperationDisplay
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 7 | 0 | 7 | 0 | 1 | 0.5 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 1 | 21 | 3 | 12 | 8 | 7 | 6 | 6 | 5 | 4 | 1 | 1 | 0 | 1 |
8,166 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.ResourceProviderOperationDisplay
|
class ResourceProviderOperationDisplay(msrest.serialization.Model):
"""Display metadata associated with the operation.
:param provider: Resource provider: Microsoft Custom Providers.
:type provider: str
:param resource: Resource on which the operation is performed.
:type resource: str
:param operation: Type of operation: get, read, delete, etc.
:type operation: str
:param description: Description of this operation.
:type description: str
"""
_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(ResourceProviderOperationDisplay, self).__init__(**kwargs)
self.provider = kwargs.get('provider', None)
self.resource = kwargs.get('resource', None)
self.operation = kwargs.get('operation', None)
self.description = kwargs.get('description', None)
|
class ResourceProviderOperationDisplay(msrest.serialization.Model):
'''Display metadata associated with the operation.
:param provider: Resource provider: Microsoft Custom Providers.
:type provider: str
:param resource: Resource on which the operation is performed.
:type resource: str
:param operation: Type of operation: get, read, delete, etc.
:type operation: str
:param description: Description of this operation.
:type description: str
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 9 | 0 | 9 | 0 | 1 | 0.63 | 1 | 1 | 0 | 0 | 1 | 4 | 1 | 1 | 29 | 3 | 16 | 10 | 11 | 10 | 8 | 7 | 6 | 1 | 1 | 0 | 1 |
8,167 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.ResourceProviderOperationList
|
class ResourceProviderOperationList(msrest.serialization.Model):
"""Results of the request to list operations.
:param value: List of operations supported by this resource provider.
:type value: list[~azure.mgmt.customproviders.models.ResourceProviderOperation]
:param next_link: The URL to use for getting the next set of results.
:type next_link: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[ResourceProviderOperation]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(ResourceProviderOperationList, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.next_link = kwargs.get('next_link', None)
|
class ResourceProviderOperationList(msrest.serialization.Model):
'''Results of the request to list operations.
:param value: List of operations supported by this resource provider.
:type value: list[~azure.mgmt.customproviders.models.ResourceProviderOperation]
:param next_link: The URL to use for getting the next set of results.
:type next_link: str
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 7 | 0 | 7 | 0 | 1 | 0.5 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 1 | 21 | 3 | 12 | 8 | 7 | 6 | 6 | 5 | 4 | 1 | 1 | 0 | 1 |
8,168 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.ResourceProvidersUpdate
|
class ResourceProvidersUpdate(msrest.serialization.Model):
"""custom resource provider update information.
:param tags: A set of tags. Resource tags.
:type tags: dict[str, str]
"""
_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(
self,
**kwargs
):
super(ResourceProvidersUpdate, self).__init__(**kwargs)
self.tags = kwargs.get('tags', None)
|
class ResourceProvidersUpdate(msrest.serialization.Model):
'''custom resource provider update information.
:param tags: A set of tags. Resource tags.
:type tags: dict[str, str]
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 6 | 0 | 6 | 0 | 1 | 0.4 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 17 | 3 | 10 | 7 | 5 | 4 | 5 | 4 | 3 | 1 | 1 | 0 | 1 |
8,169 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models_py3.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models_py3.Association
|
class Association(msrest.serialization.Model):
"""The resource definition of this association.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The association id.
:vartype id: str
:ivar name: The association name.
:vartype name: str
:ivar type: The association type.
:vartype type: str
:param target_resource_id: The REST resource instance of the target resource for this
association.
:type target_resource_id: str
:ivar provisioning_state: The provisioning state of the association. Possible values include:
"Accepted", "Deleting", "Running", "Succeeded", "Failed".
:vartype provisioning_state: str or ~azure.mgmt.customproviders.models.ProvisioningState
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'provisioning_state': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'target_resource_id': {'key': 'properties.targetResourceId', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
}
def __init__(
self,
*,
target_resource_id: Optional[str] = None,
**kwargs
):
super(Association, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.target_resource_id = target_resource_id
self.provisioning_state = None
|
class Association(msrest.serialization.Model):
'''The resource definition of this association.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The association id.
:vartype id: str
:ivar name: The association name.
:vartype name: str
:ivar type: The association type.
:vartype type: str
:param target_resource_id: The REST resource instance of the target resource for this
association.
:type target_resource_id: str
:ivar provisioning_state: The provisioning state of the association. Possible values include:
"Accepted", "Deleting", "Running", "Succeeded", "Failed".
:vartype provisioning_state: str or ~azure.mgmt.customproviders.models.ProvisioningState
'''
def __init__(
self,
*,
target_resource_id: Optional[str] = None,
**kwargs
):
pass
| 2 | 1 | 12 | 0 | 12 | 0 | 1 | 0.58 | 1 | 2 | 0 | 0 | 1 | 5 | 1 | 1 | 46 | 5 | 26 | 14 | 19 | 15 | 10 | 9 | 8 | 1 | 1 | 0 | 1 |
8,170 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models_py3.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models_py3.AssociationsList
|
class AssociationsList(msrest.serialization.Model):
"""List of associations.
:param value: The array of associations.
:type value: list[~azure.mgmt.customproviders.models.Association]
:param next_link: The URL to use for getting the next set of results.
:type next_link: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[Association]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(
self,
*,
value: Optional[List["Association"]] = None,
next_link: Optional[str] = None,
**kwargs
):
super(AssociationsList, self).__init__(**kwargs)
self.value = value
self.next_link = next_link
|
class AssociationsList(msrest.serialization.Model):
'''List of associations.
:param value: The array of associations.
:type value: list[~azure.mgmt.customproviders.models.Association]
:param next_link: The URL to use for getting the next set of results.
:type next_link: str
'''
def __init__(
self,
*,
value: Optional[List["Association"]] = None,
next_link: Optional[str] = None,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.4 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 1 | 24 | 3 | 15 | 11 | 7 | 6 | 6 | 5 | 4 | 1 | 1 | 0 | 1 |
8,171 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models_py3.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models_py3.CustomRPActionRouteDefinition
|
class CustomRPActionRouteDefinition(CustomRPRouteDefinition):
"""The route definition for an action implemented by the custom resource provider.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the route definition. This becomes the name for the ARM
extension (e.g.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}').
:type name: str
:param endpoint: Required. The route definition endpoint URI that the custom resource provider
will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or
can specify to route via a path (e.g. 'https://testendpoint/{requestPath}').
:type endpoint: str
:param routing_type: The routing types that are supported for action requests. Possible values
include: "Proxy".
:type routing_type: str or ~azure.mgmt.customproviders.models.ActionRouting
"""
_validation = {
'name': {'required': True},
'endpoint': {'required': True, 'pattern': r'^https://.+'},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'endpoint': {'key': 'endpoint', 'type': 'str'},
'routing_type': {'key': 'routingType', 'type': 'str'},
}
def __init__(
self,
*,
name: str,
endpoint: str,
routing_type: Optional[Union[str, "ActionRouting"]] = None,
**kwargs
):
super(CustomRPActionRouteDefinition, self).__init__(name=name, endpoint=endpoint, **kwargs)
self.routing_type = routing_type
|
class CustomRPActionRouteDefinition(CustomRPRouteDefinition):
'''The route definition for an action implemented by the custom resource provider.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the route definition. This becomes the name for the ARM
extension (e.g.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}').
:type name: str
:param endpoint: Required. The route definition endpoint URI that the custom resource provider
will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or
can specify to route via a path (e.g. 'https://testendpoint/{requestPath}').
:type endpoint: str
:param routing_type: The routing types that are supported for action requests. Possible values
include: "Proxy".
:type routing_type: str or ~azure.mgmt.customproviders.models.ActionRouting
'''
def __init__(
self,
*,
name: str,
endpoint: str,
routing_type: Optional[Union[str, "ActionRouting"]] = None,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.7 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 2 | 39 | 5 | 20 | 12 | 11 | 14 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,172 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models_py3.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models_py3.CustomRPManifest
|
class CustomRPManifest(Resource):
"""A manifest file that defines the custom resource provider resources.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. Resource location.
:type location: str
:param tags: A set of tags. Resource tags.
:type tags: dict[str, str]
:param actions: A list of actions that the custom resource provider implements.
:type actions: list[~azure.mgmt.customproviders.models.CustomRPActionRouteDefinition]
:param resource_types: A list of resource types that the custom resource provider implements.
:type resource_types:
list[~azure.mgmt.customproviders.models.CustomRPResourceTypeRouteDefinition]
:param validations: A list of validations to run on the custom resource provider's requests.
:type validations: list[~azure.mgmt.customproviders.models.CustomRPValidations]
:ivar provisioning_state: The provisioning state of the resource provider. Possible values
include: "Accepted", "Deleting", "Running", "Succeeded", "Failed".
:vartype provisioning_state: str or ~azure.mgmt.customproviders.models.ProvisioningState
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'provisioning_state': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'actions': {'key': 'properties.actions', 'type': '[CustomRPActionRouteDefinition]'},
'resource_types': {'key': 'properties.resourceTypes', 'type': '[CustomRPResourceTypeRouteDefinition]'},
'validations': {'key': 'properties.validations', 'type': '[CustomRPValidations]'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
}
def __init__(
self,
*,
location: str,
tags: Optional[Dict[str, str]] = None,
actions: Optional[List["CustomRPActionRouteDefinition"]] = None,
resource_types: Optional[List["CustomRPResourceTypeRouteDefinition"]] = None,
validations: Optional[List["CustomRPValidations"]] = None,
**kwargs
):
super(CustomRPManifest, self).__init__(location=location, tags=tags, **kwargs)
self.actions = actions
self.resource_types = resource_types
self.validations = validations
self.provisioning_state = None
|
class CustomRPManifest(Resource):
'''A manifest file that defines the custom resource provider resources.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. Resource location.
:type location: str
:param tags: A set of tags. Resource tags.
:type tags: dict[str, str]
:param actions: A list of actions that the custom resource provider implements.
:type actions: list[~azure.mgmt.customproviders.models.CustomRPActionRouteDefinition]
:param resource_types: A list of resource types that the custom resource provider implements.
:type resource_types:
list[~azure.mgmt.customproviders.models.CustomRPResourceTypeRouteDefinition]
:param validations: A list of validations to run on the custom resource provider's requests.
:type validations: list[~azure.mgmt.customproviders.models.CustomRPValidations]
:ivar provisioning_state: The provisioning state of the resource provider. Possible values
include: "Accepted", "Deleting", "Running", "Succeeded", "Failed".
:vartype provisioning_state: str or ~azure.mgmt.customproviders.models.ProvisioningState
'''
def __init__(
self,
*,
location: str,
tags: Optional[Dict[str, str]] = None,
actions: Optional[List["CustomRPActionRouteDefinition"]] = None,
resource_types: Optional[List["CustomRPResourceTypeRouteDefinition"]] = None,
validations: Optional[List["CustomRPValidations"]] = None,
**kwargs
):
pass
| 2 | 1 | 15 | 0 | 15 | 0 | 1 | 0.71 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 2 | 64 | 6 | 34 | 17 | 23 | 24 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
8,173 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models.Association
|
class Association(msrest.serialization.Model):
"""The resource definition of this association.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The association id.
:vartype id: str
:ivar name: The association name.
:vartype name: str
:ivar type: The association type.
:vartype type: str
:param target_resource_id: The REST resource instance of the target resource for this
association.
:type target_resource_id: str
:ivar provisioning_state: The provisioning state of the association. Possible values include:
"Accepted", "Deleting", "Running", "Succeeded", "Failed".
:vartype provisioning_state: str or ~azure.mgmt.customproviders.models.ProvisioningState
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'provisioning_state': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'target_resource_id': {'key': 'properties.targetResourceId', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(Association, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.target_resource_id = kwargs.get('target_resource_id', None)
self.provisioning_state = None
|
class Association(msrest.serialization.Model):
'''The resource definition of this association.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The association id.
:vartype id: str
:ivar name: The association name.
:vartype name: str
:ivar type: The association type.
:vartype type: str
:param target_resource_id: The REST resource instance of the target resource for this
association.
:type target_resource_id: str
:ivar provisioning_state: The provisioning state of the association. Possible values include:
"Accepted", "Deleting", "Running", "Succeeded", "Failed".
:vartype provisioning_state: str or ~azure.mgmt.customproviders.models.ProvisioningState
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.63 | 1 | 1 | 0 | 0 | 1 | 5 | 1 | 1 | 44 | 5 | 24 | 12 | 19 | 15 | 10 | 9 | 8 | 1 | 1 | 0 | 1 |
8,174 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_customproviders_enums.py
|
azext_custom_providers.vendored_sdks.customproviders.models._customproviders_enums.ValidationType
|
class ValidationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The type of validation to run against a matching request.
"""
SWAGGER = "Swagger"
|
class ValidationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''The type of validation to run against a matching request.
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 1 | 2 | 2 | 1 | 2 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
8,175 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_customproviders_enums.py
|
azext_custom_providers.vendored_sdks.customproviders.models._customproviders_enums.ResourceTypeRouting
|
class ResourceTypeRouting(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The routing types that are supported for resource requests.
"""
PROXY = "Proxy"
PROXY_CACHE = "Proxy,Cache"
|
class ResourceTypeRouting(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''The routing types that are supported for resource requests.
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.67 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 1 | 3 | 3 | 2 | 2 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
8,176 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_customproviders_enums.py
|
azext_custom_providers.vendored_sdks.customproviders.models._customproviders_enums.ProvisioningState
|
class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The provisioning state of the resource provider.
"""
ACCEPTED = "Accepted"
DELETING = "Deleting"
RUNNING = "Running"
SUCCEEDED = "Succeeded"
FAILED = "Failed"
|
class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''The provisioning state of the resource provider.
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.33 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 1 | 6 | 6 | 5 | 2 | 6 | 6 | 5 | 0 | 1 | 0 | 0 |
8,177 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportDefinition
|
class ExportDefinition(msrest.serialization.Model):
"""The definition of an export.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of the export. Note that 'Usage' is equivalent to 'ActualCost'
and is applicable to exports that do not yet provide data for charges or amortization for
service reservations. Possible values include: "Usage", "ActualCost", "AmortizedCost".
:type type: str or ~azure.mgmt.costmanagement.models.ExportType
:param timeframe: Required. The time frame for pulling data for the export. If custom, then a
specific time period must be provided. Possible values include: "MonthToDate",
"BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom".
:type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType
:param time_period: Has time period for pulling data for the export.
:type time_period: ~azure.mgmt.costmanagement.models.ExportTimePeriod
:param data_set: The definition for data in the export.
:type data_set: ~azure.mgmt.costmanagement.models.ExportDataset
"""
_validation = {
'type': {'required': True},
'timeframe': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'timeframe': {'key': 'timeframe', 'type': 'str'},
'time_period': {'key': 'timePeriod', 'type': 'ExportTimePeriod'},
'data_set': {'key': 'dataSet', 'type': 'ExportDataset'},
}
def __init__(
self,
*,
type: Union[str, "ExportType"],
timeframe: Union[str, "TimeframeType"],
time_period: Optional["ExportTimePeriod"] = None,
data_set: Optional["ExportDataset"] = None,
**kwargs
):
super(ExportDefinition, self).__init__(**kwargs)
self.type = type
self.timeframe = timeframe
self.time_period = time_period
self.data_set = data_set
|
class ExportDefinition(msrest.serialization.Model):
'''The definition of an export.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of the export. Note that 'Usage' is equivalent to 'ActualCost'
and is applicable to exports that do not yet provide data for charges or amortization for
service reservations. Possible values include: "Usage", "ActualCost", "AmortizedCost".
:type type: str or ~azure.mgmt.costmanagement.models.ExportType
:param timeframe: Required. The time frame for pulling data for the export. If custom, then a
specific time period must be provided. Possible values include: "MonthToDate",
"BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom".
:type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType
:param time_period: Has time period for pulling data for the export.
:type time_period: ~azure.mgmt.costmanagement.models.ExportTimePeriod
:param data_set: The definition for data in the export.
:type data_set: ~azure.mgmt.costmanagement.models.ExportDataset
'''
def __init__(
self,
*,
type: Union[str, "ExportType"],
timeframe: Union[str, "TimeframeType"],
time_period: Optional["ExportTimePeriod"] = None,
data_set: Optional["ExportDataset"] = None,
**kwargs
):
pass
| 2 | 1 | 14 | 0 | 14 | 0 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 1 | 45 | 5 | 25 | 16 | 15 | 15 | 9 | 8 | 7 | 1 | 1 | 0 | 1 |
8,178 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_exports_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.operations._exports_operations.ExportsOperations
|
class ExportsOperations(object):
"""ExportsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def list(
self,
scope, # type: str
expand=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> "_models.ExportListResult"
"""The operation to list all exports at the given scope.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param expand: May be used to expand the properties within an export. Currently only
'runHistory' is supported and will return information for the last execution of each export.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExportListResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ExportListResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
if expand is not None:
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('ExportListResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} # type: ignore
def get(
self,
scope, # type: str
export_name, # type: str
expand=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> "_models.Export"
"""The operation to get the export for the defined scope by export name.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:param expand: May be used to expand the properties within an export. Currently only
'runHistory' is supported and will return information for the last 10 executions of the export.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Export, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Export
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Export"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'exportName': self._serialize.url("export_name", export_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
if expand is not None:
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Export', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore
def create_or_update(
self,
scope, # type: str
export_name, # type: str
parameters, # type: "_models.Export"
**kwargs # type: Any
):
# type: (...) -> "_models.Export"
"""The operation to create or update a export. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:param parameters: Parameters supplied to the CreateOrUpdate Export operation.
:type parameters: ~azure.mgmt.costmanagement.models.Export
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Export, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Export
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Export"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.create_or_update.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'exportName': self._serialize.url("export_name", export_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'Export')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('Export', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('Export', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore
def delete(
self,
scope, # type: str
export_name, # type: str
**kwargs # type: Any
):
# type: (...) -> None
"""The operation to delete a export.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.delete.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'exportName': self._serialize.url("export_name", export_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore
def execute(
self,
scope, # type: str
export_name, # type: str
**kwargs # type: Any
):
# type: (...) -> None
"""The operation to execute an export.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.execute.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'exportName': self._serialize.url("export_name", export_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.post(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} # type: ignore
def get_execution_history(
self,
scope, # type: str
export_name, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.ExportExecutionListResult"
"""The operation to get the execution history of an export for the defined scope and export name.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExportExecutionListResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportExecutionListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.get_execution_history.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'exportName': self._serialize.url("export_name", export_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('ExportExecutionListResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'}
|
class ExportsOperations(object):
'''ExportsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer):
pass
def list(
self,
scope, # type: str
expand=None, # type: Optional[str]
**kwargs # type: Any
):
'''The operation to list all exports at the given scope.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param expand: May be used to expand the properties within an export. Currently only
'runHistory' is supported and will return information for the last execution of each export.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExportListResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ExportListResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def get(
self,
scope, # type: str
export_name, # type: str
expand=None, # type: Optional[str]
**kwargs # type: Any
):
'''The operation to get the export for the defined scope by export name.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:param expand: May be used to expand the properties within an export. Currently only
'runHistory' is supported and will return information for the last 10 executions of the export.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Export, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Export
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def create_or_update(
self,
scope, # type: str
export_name, # type: str
parameters, # type: "_models.Export"
**kwargs # type: Any
):
'''The operation to create or update a export. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:param parameters: Parameters supplied to the CreateOrUpdate Export operation.
:type parameters: ~azure.mgmt.costmanagement.models.Export
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Export, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Export
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def delete(
self,
scope, # type: str
export_name, # type: str
**kwargs # type: Any
):
'''The operation to delete a export.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def execute(
self,
scope, # type: str
export_name, # type: str
**kwargs # type: Any
):
'''The operation to execute an export.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def get_execution_history(
self,
scope, # type: str
export_name, # type: str
**kwargs # type: Any
):
'''The operation to get the execution history of an export for the defined scope and export name.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExportExecutionListResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
| 8 | 7 | 64 | 7 | 31 | 32 | 3 | 1.08 | 1 | 0 | 0 | 0 | 7 | 4 | 7 | 7 | 481 | 63 | 226 | 124 | 186 | 243 | 165 | 92 | 157 | 5 | 1 | 1 | 23 |
8,179 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_forecast_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.operations._forecast_operations.ForecastOperations
|
class ForecastOperations(object):
"""ForecastOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def usage(
self,
scope, # type: str
parameters, # type: "_models.ForecastDefinition"
filter=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> "_models.QueryResult"
"""Lists the forecast charges for scope defined.
:param scope: The scope associated with forecast operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'.
:type filter: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.usage.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
if filter is not None:
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'ForecastDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('QueryResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/forecast'} # type: ignore
def external_cloud_provider_usage(
self,
external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"]
external_cloud_provider_id, # type: str
parameters, # type: "_models.ForecastDefinition"
filter=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> "_models.QueryResult"
"""Lists the forecast charges for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'.
:type filter: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.external_cloud_provider_usage.metadata['url'] # type: ignore
path_format_arguments = {
'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'),
'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
if filter is not None:
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'ForecastDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('QueryResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
external_cloud_provider_usage.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast'}
|
class ForecastOperations(object):
'''ForecastOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer):
pass
def usage(
self,
scope, # type: str
parameters, # type: "_models.ForecastDefinition"
filter=None, # type: Optional[str]
**kwargs # type: Any
):
'''Lists the forecast charges for scope defined.
:param scope: The scope associated with forecast operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'.
:type filter: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def external_cloud_provider_usage(
self,
external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"]
external_cloud_provider_id, # type: str
parameters, # type: "_models.ForecastDefinition"
filter=None, # type: Optional[str]
**kwargs # type: Any
):
'''Lists the forecast charges for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'.
:type filter: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
| 4 | 3 | 54 | 6 | 30 | 25 | 3 | 0.94 | 1 | 0 | 0 | 0 | 3 | 4 | 3 | 3 | 183 | 24 | 93 | 54 | 76 | 87 | 71 | 41 | 67 | 4 | 1 | 1 | 9 |
8,180 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.operations._operations.Operations
|
class Operations(object):
"""Operations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def list(
self,
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.OperationListResult"]
"""Lists all of the available cost management REST API operations.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.OperationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('OperationListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'}
|
class Operations(object):
'''Operations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer):
pass
def list(
self,
**kwargs # type: Any
):
'''Lists all of the available cost management REST API operations.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.OperationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
| 6 | 2 | 21 | 3 | 15 | 5 | 2 | 0.54 | 1 | 0 | 0 | 0 | 2 | 4 | 2 | 2 | 85 | 15 | 50 | 28 | 41 | 27 | 42 | 25 | 36 | 2 | 1 | 1 | 8 |
8,181 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_query_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.operations._query_operations.QueryOperations
|
class QueryOperations(object):
"""QueryOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def usage(
self,
scope, # type: str
parameters, # type: "_models.QueryDefinition"
**kwargs # type: Any
):
# type: (...) -> "_models.QueryResult"
"""Query the usage data for scope defined.
:param scope: The scope associated with query and export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.usage.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'QueryDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('QueryResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} # type: ignore
def usage_by_external_cloud_provider_type(
self,
external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"]
external_cloud_provider_id, # type: str
parameters, # type: "_models.QueryDefinition"
**kwargs # type: Any
):
# type: (...) -> "_models.QueryResult"
"""Query the usage data for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.usage_by_external_cloud_provider_type.metadata['url'] # type: ignore
path_format_arguments = {
'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'),
'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'QueryDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('QueryResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
usage_by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query'}
|
class QueryOperations(object):
'''QueryOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer):
pass
def usage(
self,
scope, # type: str
parameters, # type: "_models.QueryDefinition"
**kwargs # type: Any
):
'''Query the usage data for scope defined.
:param scope: The scope associated with query and export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def usage_by_external_cloud_provider_type(
self,
external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"]
external_cloud_provider_id, # type: str
parameters, # type: "_models.QueryDefinition"
**kwargs # type: Any
):
'''Query the usage data for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
| 4 | 3 | 50 | 6 | 28 | 22 | 2 | 0.89 | 1 | 0 | 0 | 0 | 3 | 4 | 3 | 3 | 169 | 24 | 87 | 52 | 72 | 77 | 67 | 41 | 63 | 3 | 1 | 1 | 7 |
8,182 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_views_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.operations._views_operations.ViewsOperations
|
class ViewsOperations(object):
"""ViewsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def list(
self,
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.ViewListResult"]
"""Lists all views by tenant and object.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ViewListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('ViewListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/providers/Microsoft.CostManagement/views'} # type: ignore
def list_by_scope(
self,
scope, # type: str
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.ViewListResult"]
"""Lists all views at the given scope.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ViewListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list_by_scope.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('ViewListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views'} # type: ignore
def get(
self,
view_name, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.View"
"""Gets the view by view name.
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.View"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('View', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore
def create_or_update(
self,
view_name, # type: str
parameters, # type: "_models.View"
**kwargs # type: Any
):
# type: (...) -> "_models.View"
"""The operation to create or update a view. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param view_name: View name.
:type view_name: str
:param parameters: Parameters supplied to the CreateOrUpdate View operation.
:type parameters: ~azure.mgmt.costmanagement.models.View
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.View"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.create_or_update.metadata['url'] # type: ignore
path_format_arguments = {
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'View')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('View', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('View', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore
def delete(
self,
view_name, # type: str
**kwargs # type: Any
):
# type: (...) -> None
"""The operation to delete a view.
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.delete.metadata['url'] # type: ignore
path_format_arguments = {
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
delete.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore
def get_by_scope(
self,
scope, # type: str
view_name, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.View"
"""Gets the view for the defined scope by view name.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.View"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.get_by_scope.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str'),
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('View', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore
def create_or_update_by_scope(
self,
scope, # type: str
view_name, # type: str
parameters, # type: "_models.View"
**kwargs # type: Any
):
# type: (...) -> "_models.View"
"""The operation to create or update a view. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:param parameters: Parameters supplied to the CreateOrUpdate View operation.
:type parameters: ~azure.mgmt.costmanagement.models.View
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.View"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.create_or_update_by_scope.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str'),
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'View')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('View', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('View', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
create_or_update_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore
def delete_by_scope(
self,
scope, # type: str
view_name, # type: str
**kwargs # type: Any
):
# type: (...) -> None
"""The operation to delete a view.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.delete_by_scope.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str'),
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
delete_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'}
|
class ViewsOperations(object):
'''ViewsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer):
pass
def list(
self,
**kwargs # type: Any
):
'''Lists all views by tenant and object.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ViewListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResult]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
def list_by_scope(
self,
scope, # type: str
**kwargs # type: Any
):
'''Lists all views at the given scope.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ViewListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResult]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
def get_next(next_link=None):
'''Gets the view by view name.
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def create_or_update(
self,
view_name, # type: str
parameters, # type: "_models.View"
**kwargs # type: Any
):
'''The operation to create or update a view. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param view_name: View name.
:type view_name: str
:param parameters: Parameters supplied to the CreateOrUpdate View operation.
:type parameters: ~azure.mgmt.costmanagement.models.View
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def delete(
self,
view_name, # type: str
**kwargs # type: Any
):
'''The operation to delete a view.
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def get_by_scope(
self,
scope, # type: str
view_name, # type: str
**kwargs # type: Any
):
'''Gets the view for the defined scope by view name.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def create_or_update_by_scope(
self,
scope, # type: str
view_name, # type: str
parameters, # type: "_models.View"
**kwargs # type: Any
):
'''The operation to create or update a view. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:param parameters: Parameters supplied to the CreateOrUpdate View operation.
:type parameters: ~azure.mgmt.costmanagement.models.View
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def delete_by_scope(
self,
scope, # type: str
view_name, # type: str
**kwargs # type: Any
):
'''The operation to delete a view.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
| 16 | 9 | 42 | 5 | 24 | 16 | 2 | 0.78 | 1 | 0 | 0 | 0 | 9 | 4 | 9 | 9 | 584 | 86 | 316 | 168 | 264 | 246 | 241 | 132 | 225 | 5 | 1 | 1 | 37 |
8,183 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/__init__.py
|
azext_custom_providers.CustomprovidersCommandsLoader
|
class CustomprovidersCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_custom_providers._client_factory import cf_custom_providers
custom_providers_custom = CliCommandType(
operations_tmpl='azext_custom_providers.custom#{}',
client_factory=cf_custom_providers)
super(CustomprovidersCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=custom_providers_custom)
def load_command_table(self, args):
from azext_custom_providers.commands import load_command_table
load_command_table(self, args)
return self.command_table
def load_arguments(self, command):
from azext_custom_providers._params import load_arguments
load_arguments(self, command)
|
class CustomprovidersCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
pass
def load_command_table(self, args):
pass
def load_arguments(self, command):
pass
| 4 | 0 | 5 | 0 | 5 | 0 | 1 | 0.06 | 1 | 1 | 0 | 0 | 3 | 0 | 3 | 3 | 19 | 3 | 16 | 9 | 8 | 1 | 13 | 9 | 5 | 1 | 1 | 0 | 3 |
8,184 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/actions.py
|
azext_custom_providers.actions.ActionAddAction
|
class ActionAddAction(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
from azext_custom_providers.vendored_sdks.customproviders.models import CustomRPActionRouteDefinition as model
action = get_object(values, option_string, model)
super(ActionAddAction, self).__call__(parser, namespace, action, option_string)
|
class ActionAddAction(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
pass
| 2 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 10 | 6 | 1 | 5 | 4 | 2 | 0 | 5 | 4 | 2 | 1 | 4 | 0 | 1 |
8,185 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ViewListResult
|
class ViewListResult(msrest.serialization.Model):
"""Result of listing views. It contains a list of available views.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The list of views.
:vartype value: list[~azure.mgmt.costmanagement.models.View]
:ivar next_link: The link (url) to the next page of results.
:vartype next_link: str
"""
_validation = {
'value': {'readonly': True},
'next_link': {'readonly': True},
}
_attribute_map = {
'value': {'key': 'value', 'type': '[View]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
super(ViewListResult, self).__init__(**kwargs)
self.value = None
self.next_link = None
|
class ViewListResult(msrest.serialization.Model):
'''Result of listing views. It contains a list of available views.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: The list of views.
:vartype value: list[~azure.mgmt.costmanagement.models.View]
:ivar next_link: The link (url) to the next page of results.
:vartype next_link: str
'''
def __init__(
self,
**kwargs
):
pass
| 2 | 1 | 7 | 0 | 7 | 0 | 1 | 0.44 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 1 | 28 | 5 | 16 | 9 | 11 | 7 | 7 | 6 | 5 | 1 | 1 | 0 | 1 |
8,186 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/actions.py
|
azext_custom_providers.actions.ResourceTypeAddAction
|
class ResourceTypeAddAction(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
from azext_custom_providers.vendored_sdks.customproviders.models import CustomRPResourceTypeRouteDefinition as model
resource_type = get_object(values, option_string, model)
super(ResourceTypeAddAction, self).__call__(parser, namespace, resource_type, option_string)
|
class ResourceTypeAddAction(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
pass
| 2 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 10 | 6 | 1 | 5 | 4 | 2 | 0 | 5 | 4 | 2 | 1 | 4 | 0 | 1 |
8,187 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/_configuration.py
|
azext_custom_providers.vendored_sdks.customproviders._configuration.CustomprovidersConfiguration
|
class CustomprovidersConfiguration(Configuration):
"""Configuration for Customproviders.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:type subscription_id: str
"""
def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
):
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(CustomprovidersConfiguration, self).__init__(**kwargs)
self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2018-09-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-customproviders/{}'.format(VERSION))
self._configure(**kwargs)
def _configure(
self,
**kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
|
class CustomprovidersConfiguration(Configuration):
'''Configuration for Customproviders.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:type subscription_id: str
'''
def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
):
pass
def _configure(
self,
**kwargs # type: Any
):
pass
| 3 | 1 | 18 | 1 | 16 | 3 | 3 | 0.42 | 1 | 2 | 0 | 0 | 2 | 13 | 2 | 2 | 48 | 5 | 33 | 24 | 22 | 14 | 25 | 16 | 22 | 3 | 1 | 1 | 5 |
8,188 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/_customproviders.py
|
azext_custom_providers.vendored_sdks.customproviders._customproviders.Customproviders
|
class Customproviders(object):
"""Allows extension of ARM control plane with custom resource providers.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.customproviders.operations.Operations
:ivar custom_resource_provider: CustomResourceProviderOperations operations
:vartype custom_resource_provider: azure.mgmt.customproviders.operations.CustomResourceProviderOperations
:ivar associations: AssociationsOperations operations
:vartype associations: azure.mgmt.customproviders.operations.AssociationsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
base_url=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = CustomprovidersConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.custom_resource_provider = CustomResourceProviderOperations(
self._client, self._config, self._serialize, self._deserialize)
self.associations = AssociationsOperations(
self._client, self._config, self._serialize, self._deserialize)
def close(self):
# type: () -> None
self._client.close()
def __enter__(self):
# type: () -> Customproviders
self._client.__enter__()
return self
def __exit__(self, *exc_details):
# type: (Any) -> None
self._client.__exit__(*exc_details)
|
class Customproviders(object):
'''Allows extension of ARM control plane with custom resource providers.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.customproviders.operations.Operations
:ivar custom_resource_provider: CustomResourceProviderOperations operations
:vartype custom_resource_provider: azure.mgmt.customproviders.operations.CustomResourceProviderOperations
:ivar associations: AssociationsOperations operations
:vartype associations: azure.mgmt.customproviders.operations.AssociationsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
'''
def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
base_url=None, # type: Optional[str]
**kwargs # type: Any
):
pass
def close(self):
pass
def __enter__(self):
pass
def __exit__(self, *exc_details):
pass
| 5 | 1 | 9 | 1 | 7 | 2 | 1 | 0.76 | 1 | 5 | 4 | 0 | 4 | 7 | 4 | 4 | 54 | 7 | 29 | 19 | 18 | 22 | 20 | 13 | 15 | 2 | 1 | 1 | 5 |
8,189 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/aio/_configuration.py
|
azext_custom_providers.vendored_sdks.customproviders.aio._configuration.CustomprovidersConfiguration
|
class CustomprovidersConfiguration(Configuration):
"""Configuration for Customproviders.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:type subscription_id: str
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(CustomprovidersConfiguration, self).__init__(**kwargs)
self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2018-09-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-customproviders/{}'.format(VERSION))
self._configure(**kwargs)
def _configure(
self,
**kwargs: Any
) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
|
class CustomprovidersConfiguration(Configuration):
'''Configuration for Customproviders.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:type subscription_id: str
'''
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
pass
def _configure(
self,
**kwargs: Any
) -> None:
pass
| 3 | 1 | 17 | 1 | 16 | 0 | 3 | 0.24 | 1 | 4 | 0 | 0 | 2 | 13 | 2 | 2 | 46 | 5 | 33 | 24 | 22 | 8 | 25 | 16 | 22 | 3 | 1 | 1 | 5 |
8,190 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/aio/_customproviders.py
|
azext_custom_providers.vendored_sdks.customproviders.aio._customproviders.Customproviders
|
class Customproviders(object):
"""Allows extension of ARM control plane with custom resource providers.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.customproviders.aio.operations.Operations
:ivar custom_resource_provider: CustomResourceProviderOperations operations
:vartype custom_resource_provider: azure.mgmt.customproviders.aio.operations.CustomResourceProviderOperations
:ivar associations: AssociationsOperations operations
:vartype associations: azure.mgmt.customproviders.aio.operations.AssociationsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
base_url: Optional[str] = None,
**kwargs: Any
) -> None:
if not base_url:
base_url = 'https://management.azure.com'
self._config = CustomprovidersConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.custom_resource_provider = CustomResourceProviderOperations(
self._client, self._config, self._serialize, self._deserialize)
self.associations = AssociationsOperations(
self._client, self._config, self._serialize, self._deserialize)
async def close(self) -> None:
await self._client.close()
async def __aenter__(self) -> "Customproviders":
await self._client.__aenter__()
return self
async def __aexit__(self, *exc_details) -> None:
await self._client.__aexit__(*exc_details)
|
class Customproviders(object):
'''Allows extension of ARM control plane with custom resource providers.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.customproviders.aio.operations.Operations
:ivar custom_resource_provider: CustomResourceProviderOperations operations
:vartype custom_resource_provider: azure.mgmt.customproviders.aio.operations.CustomResourceProviderOperations
:ivar associations: AssociationsOperations operations
:vartype associations: azure.mgmt.customproviders.aio.operations.AssociationsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
'''
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
base_url: Optional[str] = None,
**kwargs: Any
) -> None:
pass
async def close(self) -> None:
pass
async def __aenter__(self) -> "Customproviders":
pass
async def __aexit__(self, *exc_details) -> None:
pass
| 5 | 1 | 8 | 1 | 7 | 0 | 1 | 0.48 | 1 | 7 | 4 | 0 | 4 | 7 | 4 | 4 | 50 | 7 | 29 | 19 | 18 | 14 | 20 | 13 | 15 | 2 | 1 | 1 | 5 |
8,191 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/aio/operations/_associations_operations.py
|
azext_custom_providers.vendored_sdks.customproviders.aio.operations._associations_operations.AssociationsOperations
|
class AssociationsOperations:
"""AssociationsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.customproviders.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
async def _create_or_update_initial(
self,
scope: str,
association_name: str,
association: "_models.Association",
**kwargs
) -> "_models.Association":
cls = kwargs.pop('cls', None) # type: ClsType["_models.Association"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self._create_or_update_initial.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'associationName': self._serialize.url("association_name", association_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(association, 'Association')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('Association', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('Association', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
async def begin_create_or_update(
self,
scope: str,
association_name: str,
association: "_models.Association",
**kwargs
) -> AsyncLROPoller["_models.Association"]:
"""Create or update an association.
:param scope: The scope of the association. The scope can be any valid REST resource instance.
For example, use '/subscriptions/{subscription-id}/resourceGroups/{resource-group-
name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' for a virtual machine resource.
:type scope: str
:param association_name: The name of the association.
:type association_name: str
:param association: The parameters required to create or update an association.
:type association: ~azure.mgmt.customproviders.models.Association
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either Association or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.customproviders.models.Association]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.Association"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = await self._create_or_update_initial(
scope=scope,
association_name=association_name,
association=association,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize('Association', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'associationName': self._serialize.url("association_name", association_name, 'str'),
}
if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
async def _delete_initial(
self,
scope: str,
association_name: str,
**kwargs
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
accept = "application/json"
# Construct URL
url = self._delete_initial.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'associationName': self._serialize.url("association_name", association_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
async def begin_delete(
self,
scope: str,
association_name: str,
**kwargs
) -> AsyncLROPoller[None]:
"""Delete an association.
:param scope: The scope of the association.
:type scope: str
:param association_name: The name of the association.
:type association_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = await self._delete_initial(
scope=scope,
association_name=association_name,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'associationName': self._serialize.url("association_name", association_name, 'str'),
}
if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
async def get(
self,
scope: str,
association_name: str,
**kwargs
) -> "_models.Association":
"""Get an association.
:param scope: The scope of the association.
:type scope: str
:param association_name: The name of the association.
:type association_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Association, or the result of cls(response)
:rtype: ~azure.mgmt.customproviders.models.Association
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Association"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'associationName': self._serialize.url("association_name", association_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Association', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
def list_all(
self,
scope: str,
**kwargs
) -> AsyncIterable["_models.AssociationsList"]:
"""Gets all association for the given scope.
:param scope: The scope of the association.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either AssociationsList or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.customproviders.models.AssociationsList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.AssociationsList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list_all.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('AssociationsList', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(
get_next, extract_data
)
list_all.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations'}
|
class AssociationsOperations:
'''AssociationsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.customproviders.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer) -> None:
pass
async def _create_or_update_initial(
self,
scope: str,
association_name: str,
association: "_models.Association",
**kwargs
) -> "_models.Association":
pass
async def begin_create_or_update(
self,
scope: str,
association_name: str,
association: "_models.Association",
**kwargs
) -> AsyncLROPoller["_models.Association"]:
'''Create or update an association.
:param scope: The scope of the association. The scope can be any valid REST resource instance.
For example, use '/subscriptions/{subscription-id}/resourceGroups/{resource-group-
name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' for a virtual machine resource.
:type scope: str
:param association_name: The name of the association.
:type association_name: str
:param association: The parameters required to create or update an association.
:type association: ~azure.mgmt.customproviders.models.Association
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either Association or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.customproviders.models.Association]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial(
self,
scope: str,
association_name: str,
**kwargs
) -> None:
pass
async def begin_delete(
self,
scope: str,
association_name: str,
**kwargs
) -> AsyncLROPoller[None]:
'''Delete an association.
:param scope: The scope of the association.
:type scope: str
:param association_name: The name of the association.
:type association_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
def get_long_running_output(pipeline_response):
'''Get an association.
:param scope: The scope of the association.
:type scope: str
:param association_name: The name of the association.
:type association_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Association, or the result of cls(response)
:rtype: ~azure.mgmt.customproviders.models.Association
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def list_all(
self,
scope: str,
**kwargs
) -> AsyncIterable["_models.AssociationsList"]:
'''Gets all association for the given scope.
:param scope: The scope of the association.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either AssociationsList or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.customproviders.models.AssociationsList]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 13 | 5 | 34 | 4 | 24 | 8 | 3 | 0.41 | 0 | 1 | 0 | 0 | 7 | 4 | 7 | 7 | 385 | 56 | 255 | 120 | 211 | 104 | 169 | 89 | 156 | 5 | 0 | 1 | 33 |
8,192 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/aio/operations/_custom_resource_provider_operations.py
|
azext_custom_providers.vendored_sdks.customproviders.aio.operations._custom_resource_provider_operations.CustomResourceProviderOperations
|
class CustomResourceProviderOperations:
"""CustomResourceProviderOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.customproviders.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
async def _create_or_update_initial(
self,
resource_group_name: str,
resource_provider_name: str,
resource_provider: "_models.CustomRPManifest",
**kwargs
) -> "_models.CustomRPManifest":
cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomRPManifest"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self._create_or_update_initial.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(resource_provider, 'CustomRPManifest')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('CustomRPManifest', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('CustomRPManifest', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
async def begin_create_or_update(
self,
resource_group_name: str,
resource_provider_name: str,
resource_provider: "_models.CustomRPManifest",
**kwargs
) -> AsyncLROPoller["_models.CustomRPManifest"]:
"""Creates or updates the custom resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_provider_name: The name of the resource provider.
:type resource_provider_name: str
:param resource_provider: The parameters required to create or update a custom resource
provider definition.
:type resource_provider: ~azure.mgmt.customproviders.models.CustomRPManifest
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either CustomRPManifest or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.customproviders.models.CustomRPManifest]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomRPManifest"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
resource_provider_name=resource_provider_name,
resource_provider=resource_provider,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize('CustomRPManifest', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3),
}
if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
async def _delete_initial(
self,
resource_group_name: str,
resource_provider_name: str,
**kwargs
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
accept = "application/json"
# Construct URL
url = self._delete_initial.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
async def begin_delete(
self,
resource_group_name: str,
resource_provider_name: str,
**kwargs
) -> AsyncLROPoller[None]:
"""Deletes the custom resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_provider_name: The name of the resource provider.
:type resource_provider_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = await self._delete_initial(
resource_group_name=resource_group_name,
resource_provider_name=resource_provider_name,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3),
}
if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
async def get(
self,
resource_group_name: str,
resource_provider_name: str,
**kwargs
) -> "_models.CustomRPManifest":
"""Gets the custom resource provider manifest.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_provider_name: The name of the resource provider.
:type resource_provider_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: CustomRPManifest, or the result of cls(response)
:rtype: ~azure.mgmt.customproviders.models.CustomRPManifest
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomRPManifest"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('CustomRPManifest', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
async def update(
self,
resource_group_name: str,
resource_provider_name: str,
patchable_resource: "_models.ResourceProvidersUpdate",
**kwargs
) -> "_models.CustomRPManifest":
"""Updates an existing custom resource provider. The only value that can be updated via PATCH
currently is the tags.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_provider_name: The name of the resource provider.
:type resource_provider_name: str
:param patchable_resource: The updatable fields of a custom resource provider.
:type patchable_resource: ~azure.mgmt.customproviders.models.ResourceProvidersUpdate
:keyword callable cls: A custom type or function that will be passed the direct response
:return: CustomRPManifest, or the result of cls(response)
:rtype: ~azure.mgmt.customproviders.models.CustomRPManifest
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomRPManifest"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.update.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(patchable_resource, 'ResourceProvidersUpdate')
body_content_kwargs['content'] = body_content
request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('CustomRPManifest', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
def list_by_resource_group(
self,
resource_group_name: str,
**kwargs
) -> AsyncIterable["_models.ListByCustomRPManifest"]:
"""Gets all the custom resource providers within a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ListByCustomRPManifest or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.customproviders.models.ListByCustomRPManifest]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ListByCustomRPManifest"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list_by_resource_group.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ListByCustomRPManifest', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(
get_next, extract_data
)
list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders'} # type: ignore
def list_by_subscription(
self,
**kwargs
) -> AsyncIterable["_models.ListByCustomRPManifest"]:
"""Gets all the custom resource providers within a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ListByCustomRPManifest or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.customproviders.models.ListByCustomRPManifest]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ListByCustomRPManifest"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list_by_subscription.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ListByCustomRPManifest', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(
get_next, extract_data
)
list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CustomProviders/resourceProviders'}
|
class CustomResourceProviderOperations:
'''CustomResourceProviderOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.customproviders.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer) -> None:
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
resource_provider_name: str,
resource_provider: "_models.CustomRPManifest",
**kwargs
) -> "_models.CustomRPManifest":
pass
async def begin_create_or_update(
self,
resource_group_name: str,
resource_provider_name: str,
resource_provider: "_models.CustomRPManifest",
**kwargs
) -> AsyncLROPoller["_models.CustomRPManifest"]:
'''Creates or updates the custom resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_provider_name: The name of the resource provider.
:type resource_provider_name: str
:param resource_provider: The parameters required to create or update a custom resource
provider definition.
:type resource_provider: ~azure.mgmt.customproviders.models.CustomRPManifest
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either CustomRPManifest or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.customproviders.models.CustomRPManifest]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial(
self,
resource_group_name: str,
resource_provider_name: str,
**kwargs
) -> None:
pass
async def begin_delete(
self,
resource_group_name: str,
resource_provider_name: str,
**kwargs
) -> AsyncLROPoller[None]:
'''Deletes the custom resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_provider_name: The name of the resource provider.
:type resource_provider_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
def get_long_running_output(pipeline_response):
'''Gets the custom resource provider manifest.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_provider_name: The name of the resource provider.
:type resource_provider_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: CustomRPManifest, or the result of cls(response)
:rtype: ~azure.mgmt.customproviders.models.CustomRPManifest
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def update(
self,
resource_group_name: str,
resource_provider_name: str,
patchable_resource: "_models.ResourceProvidersUpdate",
**kwargs
) -> "_models.CustomRPManifest":
'''Updates an existing custom resource provider. The only value that can be updated via PATCH
currently is the tags.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param resource_provider_name: The name of the resource provider.
:type resource_provider_name: str
:param patchable_resource: The updatable fields of a custom resource provider.
:type patchable_resource: ~azure.mgmt.customproviders.models.ResourceProvidersUpdate
:keyword callable cls: A custom type or function that will be passed the direct response
:return: CustomRPManifest, or the result of cls(response)
:rtype: ~azure.mgmt.customproviders.models.CustomRPManifest
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def list_by_resource_group(
self,
resource_group_name: str,
**kwargs
) -> AsyncIterable["_models.ListByCustomRPManifest"]:
'''Gets all the custom resource providers within a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ListByCustomRPManifest or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.customproviders.models.ListByCustomRPManifest]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
def list_by_subscription(
self,
**kwargs
) -> AsyncIterable["_models.ListByCustomRPManifest"]:
'''Gets all the custom resource providers within a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ListByCustomRPManifest or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.customproviders.models.ListByCustomRPManifest]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 18 | 7 | 34 | 4 | 24 | 8 | 3 | 0.4 | 0 | 1 | 0 | 0 | 9 | 4 | 9 | 9 | 525 | 77 | 350 | 165 | 292 | 140 | 236 | 125 | 218 | 5 | 0 | 1 | 43 |
8,193 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/aio/operations/_operations.py
|
azext_custom_providers.vendored_sdks.customproviders.aio.operations._operations.Operations
|
class Operations:
"""Operations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.customproviders.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def list(
self,
**kwargs
) -> AsyncIterable["_models.ResourceProviderOperationList"]:
"""The list of operations provided by Microsoft CustomProviders.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.customproviders.models.ResourceProviderOperationList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-09-01-preview"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/providers/Microsoft.CustomProviders/operations'}
|
class Operations:
'''Operations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.customproviders.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer) -> None:
pass
def list(
self,
**kwargs
) -> AsyncIterable["_models.ResourceProviderOperationList"]:
'''The list of operations provided by Microsoft CustomProviders.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.customproviders.models.ResourceProviderOperationList]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 6 | 2 | 20 | 3 | 15 | 4 | 2 | 0.5 | 0 | 0 | 0 | 0 | 2 | 4 | 2 | 2 | 84 | 15 | 50 | 28 | 41 | 25 | 42 | 25 | 36 | 2 | 0 | 1 | 8 |
8,194 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_customproviders_enums.py
|
azext_custom_providers.vendored_sdks.customproviders.models._customproviders_enums.ActionRouting
|
class ActionRouting(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The routing types that are supported for action requests.
"""
PROXY = "Proxy"
|
class ActionRouting(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''The routing types that are supported for action requests.
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 1 | 2 | 2 | 1 | 2 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
8,195 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/actions.py
|
azext_custom_providers.actions.ValidationAddAction
|
class ValidationAddAction(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
from azext_custom_providers.vendored_sdks.customproviders.models import CustomRPValidations as model
validation = get_object(values, option_string, model)
super(ValidationAddAction, self).__call__(parser, namespace, validation, option_string)
|
class ValidationAddAction(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
pass
| 2 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 10 | 6 | 1 | 5 | 4 | 2 | 0 | 5 | 4 | 2 | 1 | 4 | 0 | 1 |
8,196 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.ExportDatasetConfiguration
|
class ExportDatasetConfiguration(msrest.serialization.Model):
"""The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns.
:param columns: Array of column names to be included in the export. If not provided then the
export will include all available columns. The available columns can vary by customer channel
(see examples).
:type columns: list[str]
"""
_attribute_map = {
'columns': {'key': 'columns', 'type': '[str]'},
}
def __init__(
self,
*,
columns: Optional[List[str]] = None,
**kwargs
):
super(ExportDatasetConfiguration, self).__init__(**kwargs)
self.columns = columns
|
class ExportDatasetConfiguration(msrest.serialization.Model):
'''The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns.
:param columns: Array of column names to be included in the export. If not provided then the
export will include all available columns. The available columns can vary by customer channel
(see examples).
:type columns: list[str]
'''
def __init__(
self,
*,
columns: Optional[List[str]] = None,
**kwargs
):
pass
| 2 | 1 | 8 | 0 | 8 | 0 | 1 | 0.5 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 1 | 21 | 3 | 12 | 9 | 5 | 6 | 5 | 4 | 3 | 1 | 1 | 0 | 1 |
8,197 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._models_py3.Export
|
class Export(ProxyResource):
"""An export resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be
used to determine whether the user is updating the latest version or not.
:type e_tag: str
:param format: The format of the export being delivered. Currently only 'Csv' is supported.
Possible values include: "Csv".
:type format: str or ~azure.mgmt.costmanagement.models.FormatType
:param delivery_info: Has delivery information for the export.
:type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo
:param definition: Has the definition for the export.
:type definition: ~azure.mgmt.costmanagement.models.ExportDefinition
:param run_history: If requested, has the most recent execution history for the export.
:type run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
:ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the
next execution time.
:vartype next_run_time_estimate: ~datetime.datetime
:param schedule: Has schedule information for the export.
:type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'next_run_time_estimate': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'format': {'key': 'properties.format', 'type': 'str'},
'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'},
'definition': {'key': 'properties.definition', 'type': 'ExportDefinition'},
'run_history': {'key': 'properties.runHistory', 'type': 'ExportExecutionListResult'},
'next_run_time_estimate': {'key': 'properties.nextRunTimeEstimate', 'type': 'iso-8601'},
'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'},
}
def __init__(
self,
*,
e_tag: Optional[str] = None,
format: Optional[Union[str, "FormatType"]] = None,
delivery_info: Optional["ExportDeliveryInfo"] = None,
definition: Optional["ExportDefinition"] = None,
run_history: Optional["ExportExecutionListResult"] = None,
schedule: Optional["ExportSchedule"] = None,
**kwargs
):
super(Export, self).__init__(e_tag=e_tag, **kwargs)
self.format = format
self.delivery_info = delivery_info
self.definition = definition
self.run_history = run_history
self.next_run_time_estimate = None
self.schedule = schedule
|
class Export(ProxyResource):
'''An export resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be
used to determine whether the user is updating the latest version or not.
:type e_tag: str
:param format: The format of the export being delivered. Currently only 'Csv' is supported.
Possible values include: "Csv".
:type format: str or ~azure.mgmt.costmanagement.models.FormatType
:param delivery_info: Has delivery information for the export.
:type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo
:param definition: Has the definition for the export.
:type definition: ~azure.mgmt.costmanagement.models.ExportDefinition
:param run_history: If requested, has the most recent execution history for the export.
:type run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
:ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the
next execution time.
:vartype next_run_time_estimate: ~datetime.datetime
:param schedule: Has schedule information for the export.
:type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule
'''
def __init__(
self,
*,
e_tag: Optional[str] = None,
format: Optional[Union[str, "FormatType"]] = None,
delivery_info: Optional["ExportDeliveryInfo"] = None,
definition: Optional["ExportDefinition"] = None,
run_history: Optional["ExportExecutionListResult"] = None,
schedule: Optional["ExportSchedule"] = None,
**kwargs
):
pass
| 2 | 1 | 18 | 0 | 18 | 0 | 1 | 0.7 | 1 | 2 | 0 | 0 | 1 | 6 | 1 | 2 | 68 | 5 | 37 | 20 | 25 | 26 | 11 | 10 | 9 | 1 | 2 | 0 | 1 |
8,198 |
Azure/azure-cli-extensions
|
src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models_py3.py
|
azext_custom_providers.vendored_sdks.customproviders.models._models_py3.CustomRPResourceTypeRouteDefinition
|
class CustomRPResourceTypeRouteDefinition(CustomRPRouteDefinition):
"""The route definition for a resource implemented by the custom resource provider.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the route definition. This becomes the name for the ARM
extension (e.g.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}').
:type name: str
:param endpoint: Required. The route definition endpoint URI that the custom resource provider
will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or
can specify to route via a path (e.g. 'https://testendpoint/{requestPath}').
:type endpoint: str
:param routing_type: The routing types that are supported for resource requests. Possible
values include: "Proxy", "Proxy,Cache".
:type routing_type: str or ~azure.mgmt.customproviders.models.ResourceTypeRouting
"""
_validation = {
'name': {'required': True},
'endpoint': {'required': True, 'pattern': r'^https://.+'},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'endpoint': {'key': 'endpoint', 'type': 'str'},
'routing_type': {'key': 'routingType', 'type': 'str'},
}
def __init__(
self,
*,
name: str,
endpoint: str,
routing_type: Optional[Union[str, "ResourceTypeRouting"]] = None,
**kwargs
):
super(CustomRPResourceTypeRouteDefinition, self).__init__(name=name, endpoint=endpoint, **kwargs)
self.routing_type = routing_type
|
class CustomRPResourceTypeRouteDefinition(CustomRPRouteDefinition):
'''The route definition for a resource implemented by the custom resource provider.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the route definition. This becomes the name for the ARM
extension (e.g.
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}').
:type name: str
:param endpoint: Required. The route definition endpoint URI that the custom resource provider
will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or
can specify to route via a path (e.g. 'https://testendpoint/{requestPath}').
:type endpoint: str
:param routing_type: The routing types that are supported for resource requests. Possible
values include: "Proxy", "Proxy,Cache".
:type routing_type: str or ~azure.mgmt.customproviders.models.ResourceTypeRouting
'''
def __init__(
self,
*,
name: str,
endpoint: str,
routing_type: Optional[Union[str, "ResourceTypeRouting"]] = None,
**kwargs
):
pass
| 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.7 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 2 | 39 | 5 | 20 | 12 | 11 | 14 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,199 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/network-manager/azext_network_manager/aaz/latest/network/manager/verifier_workspace/_update.py
|
azext_network_manager.aaz.latest.network.manager.verifier_workspace._update.Update.VerifierWorkspacesGet
|
class VerifierWorkspacesGet(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/verifierWorkspaces/{workspaceName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"networkManagerName", self.ctx.args.network_manager_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
**self.serialize_url_param(
"workspaceName", self.ctx.args.workspace_name,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-05-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_UpdateHelper._build_schema_verifier_workspace_read(
cls._schema_on_200)
return cls._schema_on_200
|
class VerifierWorkspacesGet(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 86 | 13 | 73 | 25 | 56 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.