xtrics / azure-url-generator
There is no license information available for the latest version (v1.0.0) of this package.
Simple library for generate Azure URL request to Azure API, for usage simplicity.
v1.0.0
2022-03-08 12:17 UTC
Requires
- php: ^7.4|^8.0
Requires (Dev)
- phpunit/phpunit: ^7|^9
README
Simple library to generate Azure API URL and endpoints. The results will be used for developer's needs when doing request to Azure REST API. The development itself are based on needs in Azure API Documentations. This library are tested on generate virtual machines, network security groups, public IP addresses, and virtual machine disks.
Installation
Require xtrics/azure-url-generator
using composer.
composer require xtrics/azure-url-generator
How to Use
Before Using The Library
- Please publish the config file by using following command.
php artisan vendor:publish --provider "Xtrics\AzureUrlGenerator\GeneratorServiceProvider"
- Configure
config/azure.php
file as needed.
Examples to Use the Library
- Generate Azure API URL for
get_single_vm
, registered inconfig/azure.php
.
<?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use Xtrics\AzureUrlGenerator\Generator; class VirtualMachineController extends Controller { public function generateUrl() { $vmName = 'test'; $apiVersion = '2021-01-01'; $str = Generator::generateUrl('get_single_vm', [ 'subscription-id' => config('azure.subscription_id'), 'resource-group' => config('azure.resource_group'), 'vm-name' => $vmName, 'api-version' => $apiVersion ]); echo $str; } }