Skip to content
This repository was archived by the owner on Oct 31, 2019. It is now read-only.

Commit 38eace0

Browse files
committed
Document how to use blob store functions without authentication #76
1 parent 205963b commit 38eace0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+140
-95
lines changed

R/AzureBlob.R

+19-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
#' @inheritParams setAzureContext
55
#' @inheritParams azureAuthenticate
66
#' @inheritParams azureSAGetKey
7+
#' @param azureActiveContext Either an `azureActiveContext` object or `NULL`. The blob store functions support two modes of connecting to the Azure API: authenticate using Active Directory or providing your own storage key. If this value is `NULL`, you must provide the `storageKey`.
78
#'
89
#' @param maxresults Optional. Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxresults or specifies a value greater than 5,000, the server will return up to 5,000 items. Setting `maxresults` to a value less than or equal to zero results in error response code 400 (Bad Request).
910
#' @param prefix Optional. Filters the results to return only blobs whose names begin with the specified prefix.
1011
#' @param delimiter Optional. When the request includes this parameter, the operation returns a BlobPrefix element in the response body that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string.
1112
#' @param marker Optional. A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client.
1213
#'
1314
#' @return Returns a data frame. This data frame has an attribute called `marker` that can be used with the `marker` argument to return the next set of values.
15+
#'
16+
#' @template blob_no_authentication
17+
#' @references https://docs.microsoft.com/en-us/rest/api/storageservices/list-blobs
1418
#' @family Blob store functions
1519
#' @export
1620
azureListStorageBlobs <- function(azureActiveContext, storageAccount, storageKey,
@@ -92,13 +96,15 @@ azureListStorageBlobs <- function(azureActiveContext, storageAccount, storageKey
9296

9397
#' List blob blobs in a storage account directory.
9498
#'
99+
#' @inheritParams azureListStorageBlobs
95100
#' @inheritParams setAzureContext
96101
#' @inheritParams azureAuthenticate
97102
#' @inheritParams azureSAGetKey
98-
103+
#'
99104
#' @param directory Blob store directory to list for content
100105
#' @param recursive If TRUE, list blob store directories recursively
101106
#'
107+
#' @template blob_no_authentication
102108
#' @family Blob store functions
103109
#' @export
104110
azureBlobLS <- function(azureActiveContext, directory, recursive = FALSE,
@@ -181,13 +187,15 @@ azureBlobLS <- function(azureActiveContext, directory, recursive = FALSE,
181187

182188
#' Get contents from a specifed storage blob.
183189
#'
190+
#' @inheritParams azureListStorageBlobs
184191
#' @inheritParams setAzureContext
185192
#' @inheritParams azureAuthenticate
186193
#' @inheritParams azureSAGetKey
187194
#' @inheritParams azureBlobLS
188-
195+
#'
189196
#' @param type String, either "text" or "raw". Passed to [httr::content()]
190197
#'
198+
#' @template blob_no_authentication
191199
#' @family Blob store functions
192200
#' @export
193201

@@ -257,6 +265,7 @@ azureGetBlob <- function(azureActiveContext, blob, directory, type = "text",
257265

258266
#' Write contents to a specifed storage blob.
259267
#'
268+
#' @inheritParams azureListStorageBlobs
260269
#' @inheritParams setAzureContext
261270
#' @inheritParams azureAuthenticate
262271
#' @inheritParams azureSAGetKey
@@ -265,6 +274,7 @@ azureGetBlob <- function(azureActiveContext, blob, directory, type = "text",
265274
#' @param contents - Object or value to store
266275
#' @param file - Local filename to store in Azure blob
267276
#'
277+
#' @template blob_no_authentication
268278
#' @family Blob store functions
269279
#' @export
270280
azurePutBlob <- function(azureActiveContext, blob, contents = "", file = "",
@@ -337,11 +347,13 @@ azurePutBlob <- function(azureActiveContext, blob, contents = "", file = "",
337347

338348
#' Find file in a storage account directory.
339349
#'
350+
#' @inheritParams azureListStorageBlobs
340351
#' @inheritParams setAzureContext
341352
#' @inheritParams azureAuthenticate
342353
#' @inheritParams azureSAGetKey
343354
#' @inheritParams azurePutBlob
344355
#'
356+
#' @template blob_no_authentication
345357
#' @family Blob store functions
346358
#' @export
347359
azureBlobFind <- function(azureActiveContext, file, storageAccount, storageKey,
@@ -383,12 +395,14 @@ azureBlobFind <- function(azureActiveContext, file, storageAccount, storageKey,
383395

384396
#' Azure blob change current directory.
385397
#'
398+
#' @inheritParams azureListStorageBlobs
386399
#' @inheritParams setAzureContext
387400
#' @inheritParams azureAuthenticate
388401
#' @inheritParams azureSAGetKey
389402
#' @inheritParams azureBlobLS
390403
#' @inheritParams azurePutBlob
391404
#'
405+
#' @template blob_no_authentication
392406
#' @family Blob store functions
393407
#' @export
394408
azureBlobCD <- function(azureActiveContext, directory, container, file,
@@ -430,7 +444,7 @@ azureBlobCD <- function(azureActiveContext, directory, container, file,
430444
assert_that(is_storage_key(storageKey))
431445

432446
if (directory == "../" || directory == "..") {
433-
# Basic attempt azToken relative paths
447+
# Basic attempt at relative paths
434448
directory <- gsub("/[a-zA-Z0-9]*$", "", azureActiveContext$directory)
435449
}
436450

@@ -458,11 +472,13 @@ azureBlobCD <- function(azureActiveContext, directory, container, file,
458472

459473
#' Delete a specifed storage blob.
460474
#'
475+
#' @inheritParams azureListStorageBlobs
461476
#' @inheritParams setAzureContext
462477
#' @inheritParams azureAuthenticate
463478
#' @inheritParams azureSAGetKey
464479
#' @inheritParams azureBlobLS
465480
#'
481+
#' @template blob_no_authentication
466482
#' @family Blob store functions
467483
#' @export
468484

R/AzureContextObject.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ createAzureContext <- function(tenantID, clientID, authKey, configFile){
3838
#'
3939
#' Updates the value of an `azureActiveContext` object, created by [createAzureContext()]
4040
#'
41-
#' @param azureActiveContext A container used for caching variables used by `AzureSMR`
42-
#' @param tenantID The Tenant ID provided during creation of the Active Directory application / service principal
43-
#' @param clientID The Client ID provided during creation of the Active Directory application / service principal
44-
#' @param authKey The Authentication Key provided during creation of the Active Directory application / service principal
41+
#' @param azureActiveContext A container used for caching variables used by `AzureSMR`, created by [createAzureContext()]
42+
#' @param tenantID The tenant ID provided during creation of the Active Directory application / service principal
43+
#' @param clientID The client ID provided during creation of the Active Directory application / service principal
44+
#' @param authKey The authentication key provided during creation of the Active Directory application / service principal
4545
#' @param subscriptionID Subscription ID. This is obtained automatically by [azureAuthenticate()] when only a single subscriptionID is available via Active Directory
4646
#' @param resourceGroup Name of the resource group
4747
#' @param vmName Name of the virtual machine

R/AzureCost.R

+4-7
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
#'
1111
#' @inheritParams setAzureContext
1212
#'
13-
#' @param instance Instance name that one would like to check expe
14-
#' nse. It is by default empty, which returns data consumption for
15-
#' all instances under subscription.
13+
#' @param instance Instance name that one would like to check expense. It is by default empty, which returns data consumption for all instances under subscription.
1614
#'
1715
#' @param timeStart Start time.
1816
#' @param timeEnd End time.
@@ -228,6 +226,8 @@ azureDataConsumption <- function(azureActiveContext,
228226

229227
#' Get pricing details of resources under a subscription.
230228
#'
229+
#' The pricing rates function wraps API calls to Azure RateCard and currently the API supports only the Pay-As-You-Go offer scheme.
230+
#'
231231
#' @inheritParams setAzureContext
232232
#'
233233
#' @param currency Currency in which price rating is measured.
@@ -236,8 +236,6 @@ azureDataConsumption <- function(azureActiveContext,
236236
#'
237237
#' @param region region information about the subscription.
238238
#'
239-
#' @note The pricing rates function wraps API calls to Azure RateCard and currently the API supports only the Pay-As-You-Go offer scheme.
240-
#'
241239
#' @family Cost functions
242240
#' @export
243241
azurePricingRates <- function(azureActiveContext,
@@ -313,8 +311,7 @@ azurePricingRates <- function(azureActiveContext,
313311
#' @inheritParams azureDataConsumption
314312
#' @inheritParams azurePricingRates
315313
#'
316-
#' @return Total cost measured in the given currency of the specified Azure
317-
#' instance in the period.
314+
#' @return Total cost measured in the given currency of the specified Azure instance in the period.
318315
#'
319316
#' @family Cost functions
320317
#' @export

man-roxygen/blob_no_authentication.R

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#' @section Using blob store functions without authentication:
2+
#' The blob store functions support two modes of connecting to the Azure API:authenticate using Active Directory or providing your own storage key. If this value is `NULL`, you must provide the `storageKey` .

man/azureAuthenticate.Rd

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureBatchGetKey.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureBlobCD.Rd

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureBlobFind.Rd

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureBlobLS.Rd

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureCancelDeploy.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureCheckToken.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureCreateBatchAccount.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureCreateHDI.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureCreateResourceGroup.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureCreateStorageAccount.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureCreateStorageContainer.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureDataConsumption.Rd

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureDeleteBatchAccount.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureDeleteBlob.Rd

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureDeleteDeploy.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/azureDeleteHDI.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)