Merge branch 'dev' of github.com:Microsoft/AzureSMR into dev
This commit is contained in:
Коммит
4c471370b6
|
@ -17,6 +17,7 @@ export(azureCreateHDI)
|
|||
export(azureCreateResourceGroup)
|
||||
export(azureCreateStorageAccount)
|
||||
export(azureCreateStorageContainer)
|
||||
export(azureDataConsumption)
|
||||
export(azureDeleteBatchAccount)
|
||||
export(azureDeleteBlob)
|
||||
export(azureDeleteDeploy)
|
||||
|
@ -27,6 +28,7 @@ export(azureDeleteVM)
|
|||
export(azureDeletestorageAccount)
|
||||
export(azureDeployStatus)
|
||||
export(azureDeployTemplate)
|
||||
export(azureExpenseCalculator)
|
||||
export(azureGetAllVMstatus)
|
||||
export(azureGetBlob)
|
||||
export(azureHDIConf)
|
||||
|
@ -44,6 +46,7 @@ export(azureListStorageBlobs)
|
|||
export(azureListStorageContainers)
|
||||
export(azureListSubscriptions)
|
||||
export(azureListVM)
|
||||
export(azurePricingRates)
|
||||
export(azurePutBlob)
|
||||
export(azureResizeHDI)
|
||||
export(azureRunScriptAction)
|
||||
|
@ -86,6 +89,9 @@ importFrom(httr,headers)
|
|||
importFrom(httr,http_status)
|
||||
importFrom(httr,status_code)
|
||||
importFrom(jsonlite,fromJSON)
|
||||
importFrom(lubridate,hour)
|
||||
importFrom(lubridate,minute)
|
||||
importFrom(lubridate,second)
|
||||
importFrom(miniUI,gadgetTitleBar)
|
||||
importFrom(miniUI,miniContentPanel)
|
||||
importFrom(miniUI,miniPage)
|
||||
|
|
|
@ -1,25 +1,12 @@
|
|||
#' Get data consumption of an Azure subscription for a time period. Aggregation
|
||||
#' method can be either daily based or hourly based.
|
||||
#' Get data consumption of an Azure subscription for a time period.
|
||||
|
||||
#' Aggregation method can be either daily based or hourly based.
|
||||
#'
|
||||
#' @note Formats of start time point and end time point follow ISO 8601 standard
|
||||
#' Say if one would like to calculate data consumption between Feb 21, 2017 to
|
||||
#' Feb 25, 2017, with an aggregation granularity of "daily based", the inputs
|
||||
#' should be "2017-02-21 00:00:00" and "2017-02-25 00:00:00", for start time
|
||||
#' point and end time point, respectively. If the aggregation granularity is
|
||||
#' hourly based, the inputs can be "2017-02-21 01:00:00" and
|
||||
#' "2017-02-21 02:00:00", for start and end time point, respectively.
|
||||
#' NOTE by default the Azure data
|
||||
#' consumption API does not allow an aggregation granularity that is finer
|
||||
#' than an hour. In the case of "hourly based" granularity, if the time
|
||||
#' difference between start and end time point is less than an hour, data
|
||||
#' consumption will still be calculated hourly based with end time postponed.
|
||||
#' For example, if the start time point and end time point are "2017-02-21
|
||||
#' 00:00:00" and "2017-02-21 00:45:00", the actual returned results are
|
||||
#' data consumption in the interval of "2017-02-21 00:00:00" and
|
||||
#' "2017-02-21 01:00:00". However this calculation is merely for retrieving
|
||||
#' the information of an existing instance instance (e.g., meterId) with
|
||||
#' which the pricing rate is multiplied by to obtain the overall expense.
|
||||
#' Time zone of all time inputs are synchronized to UTC.
|
||||
#' Formats of start time point and end time point follow ISO 8601 standard. For example, if you want to calculate data consumption between Feb 21, 2017 to Feb 25, 2017, with an aggregation granularity of "daily based", the inputs should be "2017-02-21 00:00:00" and "2017-02-25 00:00:00", for start time point and end time point, respectively.
|
||||
#' If the aggregation granularity is hourly based, the inputs can be "2017-02-21 01:00:00" and "2017-02-21 02:00:00", for start and end time point, respectively.
|
||||
#' NOTE by default the Azure data consumption API does not allow an aggregation granularity that is finer than an hour. In the case of "hourly based" granularity, if the time difference between start and end time point is less than an hour, data consumption will still be calculated hourly based with end time postponed.
|
||||
#' For example, if the start time point and end time point are "2017-02-21 00:00:00" and "2017-02-21 00:45:00", the actual returned results are data consumption in the interval of "2017-02-21 00:00:00" and "2017-02-21 01:00:00". However this calculation is merely for retrieving the information of an existing instance instance (e.g. `meterId`) with which the pricing rate is multiplied by to obtain the overall expense.
|
||||
#' Time zone of all time inputs are synchronized to UTC.
|
||||
#'
|
||||
#' @inheritParams setAzureContext
|
||||
#'
|
||||
|
@ -28,11 +15,10 @@
|
|||
#' all instances under subscription.
|
||||
#'
|
||||
#' @param timeStart Start time.
|
||||
#'
|
||||
#' @param timeEnd End time.
|
||||
#'
|
||||
#' @param granularity Aggregation granularity. Can be either "Daily" or
|
||||
#' "Hourly".
|
||||
#' @param granularity Aggregation granularity. Can be either "Daily" or "Hourly".
|
||||
#'
|
||||
#' @family Cost functions
|
||||
#' @export
|
||||
azureDataConsumption <- function(azureActiveContext,
|
||||
instance="",
|
||||
|
@ -239,22 +225,20 @@ azureDataConsumption <- function(azureActiveContext,
|
|||
return(df_use)
|
||||
}
|
||||
|
||||
|
||||
#' Get pricing details of resources under a subscription.
|
||||
#'
|
||||
#' @inheritParams setAzureContext
|
||||
#'
|
||||
#' @param currency Currency in which price rating is measured.
|
||||
#'
|
||||
#' @param locale Locality information of subscription.
|
||||
#'
|
||||
#' @param offerId Offer ID of the subscription. Detailed information can be
|
||||
#' found at https://azure.microsoft.com/en-us/support/legal/offer-details/
|
||||
#' @param offerId Offer ID of the subscription. For more information see https://azure.microsoft.com/en-us/support/legal/offer-details/
|
||||
#'
|
||||
#' @param region region information about the subscription.
|
||||
#'
|
||||
#' @note The pricing rates function wraps API calls to Azure RateCard and
|
||||
#' current only the API supports only for Pay-As-You-Go offer scheme.
|
||||
#' @note The pricing rates function wraps API calls to Azure RateCard and currently the API supports only the Pay-As-You-Go offer scheme.
|
||||
#'
|
||||
#' @family Cost functions
|
||||
#' @export
|
||||
azurePricingRates <- function(azureActiveContext,
|
||||
currency,
|
||||
|
@ -320,24 +304,19 @@ azurePricingRates <- function(azureActiveContext,
|
|||
df_meter
|
||||
}
|
||||
|
||||
|
||||
#' Calculate cost of using a specific instance of Azure for certain period.
|
||||
#'
|
||||
#'Note if difference between \code{timeStart} and \code{timeEnd} is less than the finest granularity, e.g., "Hourly" (we notice this is a usual case when one needs to be aware of the charges of a job that takes less than an hour), the expense will be estimated based solely on computation hour. That is, the total expense is the multiplication of computation hour and pricing rate of the requested instance.
|
||||
#'
|
||||
#' @inheritParams setAzureContext
|
||||
#'
|
||||
#' @inheritParams azureDataConsumption
|
||||
#'
|
||||
#' @inheritParams azurePricingRates
|
||||
#'
|
||||
#' @return Total cost measured in the given currency of the specified Azure
|
||||
#' instance in the period.
|
||||
#'
|
||||
#' @note Note if difference between \code{timeStart} and \code{timeEnd} is
|
||||
#' less than the finest granularity, e.g., "Hourly" (we notice this is a
|
||||
#' usual case when one needs to be aware of the charges of a job that takes
|
||||
#' less than an hour), the expense will be estimated based solely on computation
|
||||
#' hour. That is, the total expense is the multiplication of computation hour
|
||||
#' and pricing rate of the requested instance.
|
||||
#'
|
||||
#' @family Cost functions
|
||||
#' @export
|
||||
azureExpenseCalculator <- function(azureActiveContext,
|
||||
instance="",
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
#' - [azureCreateStorageAccount()]
|
||||
#' - [azureListStorageContainers()]
|
||||
#' - [azureListStorageBlobs()]
|
||||
#' - [azureGetBlob()]
|
||||
#' - [azurePutBlob()]
|
||||
#' - [azureDeleteBlob()]
|
||||
#' - [azureBlobFind()]
|
||||
#' * Virtual Machines
|
||||
#' - List VMs: [azureListVM()]
|
||||
#' - To create a virtual machine, use [azureDeployTemplate()] with a suitable template
|
||||
|
@ -33,7 +37,10 @@
|
|||
#' - [azureCreateBatchAccount()]
|
||||
#' - [azureDeleteBatchAccount()]
|
||||
#' - [azureBatchGetKey()]
|
||||
#'
|
||||
#' * Cost functions:
|
||||
#' - [azureDataConsumption()]
|
||||
#' - [azurePricingRates()]
|
||||
#' - [azureExpenseCalculator()]
|
||||
#'
|
||||
#' @name AzureSMR
|
||||
#' @aliases AzureSMR-package
|
||||
|
|
|
@ -28,6 +28,10 @@ This enables you to use and change many Azure resources. The following is an inc
|
|||
\item \code{\link[=azureCreateStorageAccount]{azureCreateStorageAccount()}}
|
||||
\item \code{\link[=azureListStorageContainers]{azureListStorageContainers()}}
|
||||
\item \code{\link[=azureListStorageBlobs]{azureListStorageBlobs()}}
|
||||
\item \code{\link[=azureGetBlob]{azureGetBlob()}}
|
||||
\item \code{\link[=azurePutBlob]{azurePutBlob()}}
|
||||
\item \code{\link[=azureDeleteBlob]{azureDeleteBlob()}}
|
||||
\item \code{\link[=azureBlobFind]{azureBlobFind()}}
|
||||
}
|
||||
\item Virtual Machines
|
||||
\itemize{
|
||||
|
@ -53,6 +57,12 @@ This enables you to use and change many Azure resources. The following is an inc
|
|||
\item \code{\link[=azureDeleteBatchAccount]{azureDeleteBatchAccount()}}
|
||||
\item \code{\link[=azureBatchGetKey]{azureBatchGetKey()}}
|
||||
}
|
||||
\item Cost functions:
|
||||
\itemize{
|
||||
\item \code{\link[=azureDataConsumption]{azureDataConsumption()}}
|
||||
\item \code{\link[=azurePricingRates]{azurePricingRates()}}
|
||||
\item \code{\link[=azureExpenseCalculator]{azureExpenseCalculator()}}
|
||||
}
|
||||
}
|
||||
}
|
||||
\keyword{package}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
% Please edit documentation in R/AzureCost.R
|
||||
\name{azureDataConsumption}
|
||||
\alias{azureDataConsumption}
|
||||
\title{Get data consumption of an Azure subscription for a time period. Aggregation
|
||||
method can be either daily based or hourly based.}
|
||||
\title{Get data consumption of an Azure subscription for a time period.
|
||||
Aggregation method can be either daily based or hourly based.}
|
||||
\usage{
|
||||
azureDataConsumption(azureActiveContext, instance = "", timeStart, timeEnd,
|
||||
granularity = "Hourly", verbose = FALSE)
|
||||
|
@ -19,31 +19,16 @@ all instances under subscription.}
|
|||
|
||||
\item{timeEnd}{End time.}
|
||||
|
||||
\item{granularity}{Aggregation granularity. Can be either "Daily" or
|
||||
"Hourly".}
|
||||
\item{granularity}{Aggregation granularity. Can be either "Daily" or "Hourly".}
|
||||
}
|
||||
\description{
|
||||
Get data consumption of an Azure subscription for a time period. Aggregation
|
||||
method can be either daily based or hourly based.
|
||||
}
|
||||
\note{
|
||||
Formats of start time point and end time point follow ISO 8601 standard
|
||||
Say if one would like to calculate data consumption between Feb 21, 2017 to
|
||||
Feb 25, 2017, with an aggregation granularity of "daily based", the inputs
|
||||
should be "2017-02-21 00:00:00" and "2017-02-25 00:00:00", for start time
|
||||
point and end time point, respectively. If the aggregation granularity is
|
||||
hourly based, the inputs can be "2017-02-21 01:00:00" and
|
||||
"2017-02-21 02:00:00", for start and end time point, respectively.
|
||||
NOTE by default the Azure data
|
||||
consumption API does not allow an aggregation granularity that is finer
|
||||
than an hour. In the case of "hourly based" granularity, if the time
|
||||
difference between start and end time point is less than an hour, data
|
||||
consumption will still be calculated hourly based with end time postponed.
|
||||
For example, if the start time point and end time point are "2017-02-21
|
||||
00:00:00" and "2017-02-21 00:45:00", the actual returned results are
|
||||
data consumption in the interval of "2017-02-21 00:00:00" and
|
||||
"2017-02-21 01:00:00". However this calculation is merely for retrieving
|
||||
the information of an existing instance instance (e.g., meterId) with
|
||||
which the pricing rate is multiplied by to obtain the overall expense.
|
||||
Formats of start time point and end time point follow ISO 8601 standard. For example, if you want to calculate data consumption between Feb 21, 2017 to Feb 25, 2017, with an aggregation granularity of "daily based", the inputs should be "2017-02-21 00:00:00" and "2017-02-25 00:00:00", for start time point and end time point, respectively.
|
||||
If the aggregation granularity is hourly based, the inputs can be "2017-02-21 01:00:00" and "2017-02-21 02:00:00", for start and end time point, respectively.
|
||||
NOTE by default the Azure data consumption API does not allow an aggregation granularity that is finer than an hour. In the case of "hourly based" granularity, if the time difference between start and end time point is less than an hour, data consumption will still be calculated hourly based with end time postponed.
|
||||
For example, if the start time point and end time point are "2017-02-21 00:00:00" and "2017-02-21 00:45:00", the actual returned results are data consumption in the interval of "2017-02-21 00:00:00" and "2017-02-21 01:00:00". However this calculation is merely for retrieving the information of an existing instance instance (e.g. \code{meterId}) with which the pricing rate is multiplied by to obtain the overall expense.
|
||||
Time zone of all time inputs are synchronized to UTC.
|
||||
}
|
||||
\seealso{
|
||||
Other Cost functions: \code{\link{azureExpenseCalculator}},
|
||||
\code{\link{azurePricingRates}}
|
||||
}
|
||||
|
|
|
@ -18,15 +18,13 @@ all instances under subscription.}
|
|||
|
||||
\item{timeEnd}{End time.}
|
||||
|
||||
\item{granularity}{Aggregation granularity. Can be either "Daily" or
|
||||
"Hourly".}
|
||||
\item{granularity}{Aggregation granularity. Can be either "Daily" or "Hourly".}
|
||||
|
||||
\item{currency}{Currency in which price rating is measured.}
|
||||
|
||||
\item{locale}{Locality information of subscription.}
|
||||
|
||||
\item{offerId}{Offer ID of the subscription. Detailed information can be
|
||||
found at https://azure.microsoft.com/en-us/support/legal/offer-details/}
|
||||
\item{offerId}{Offer ID of the subscription. For more information see https://azure.microsoft.com/en-us/support/legal/offer-details/}
|
||||
|
||||
\item{region}{region information about the subscription.}
|
||||
}
|
||||
|
@ -35,13 +33,9 @@ Total cost measured in the given currency of the specified Azure
|
|||
instance in the period.
|
||||
}
|
||||
\description{
|
||||
Calculate cost of using a specific instance of Azure for certain period.
|
||||
Note if difference between \code{timeStart} and \code{timeEnd} is less than the finest granularity, e.g., "Hourly" (we notice this is a usual case when one needs to be aware of the charges of a job that takes less than an hour), the expense will be estimated based solely on computation hour. That is, the total expense is the multiplication of computation hour and pricing rate of the requested instance.
|
||||
}
|
||||
\note{
|
||||
Note if difference between \code{timeStart} and \code{timeEnd} is
|
||||
less than the finest granularity, e.g., "Hourly" (we notice this is a
|
||||
usual case when one needs to be aware of the charges of a job that takes
|
||||
less than an hour), the expense will be estimated based solely on computation
|
||||
hour. That is, the total expense is the multiplication of computation hour
|
||||
and pricing rate of the requested instance.
|
||||
\seealso{
|
||||
Other Cost functions: \code{\link{azureDataConsumption}},
|
||||
\code{\link{azurePricingRates}}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ azurePricingRates(azureActiveContext, currency, locale, offerId, region,
|
|||
|
||||
\item{locale}{Locality information of subscription.}
|
||||
|
||||
\item{offerId}{Offer ID of the subscription. Detailed information can be
|
||||
found at https://azure.microsoft.com/en-us/support/legal/offer-details/}
|
||||
\item{offerId}{Offer ID of the subscription. For more information see https://azure.microsoft.com/en-us/support/legal/offer-details/}
|
||||
|
||||
\item{region}{region information about the subscription.}
|
||||
}
|
||||
|
@ -23,6 +22,9 @@ found at https://azure.microsoft.com/en-us/support/legal/offer-details/}
|
|||
Get pricing details of resources under a subscription.
|
||||
}
|
||||
\note{
|
||||
The pricing rates function wraps API calls to Azure RateCard and
|
||||
current only the API supports only for Pay-As-You-Go offer scheme.
|
||||
The pricing rates function wraps API calls to Azure RateCard and currently the API supports only the Pay-As-You-Go offer scheme.
|
||||
}
|
||||
\seealso{
|
||||
Other Cost functions: \code{\link{azureDataConsumption}},
|
||||
\code{\link{azureExpenseCalculator}}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче