Skip to content

Commit

Permalink
Import library for azure node module (storage and role environment re…
Browse files Browse the repository at this point in the history
…lated APIs)
  • Loading branch information
nikhilk committed Apr 18, 2013
1 parent 4c8412e commit fe165de
Show file tree
Hide file tree
Showing 28 changed files with 1,185 additions and 0 deletions.
61 changes: 61 additions & 0 deletions src/Libraries/Node/Node.Azure/Azure.cs
@@ -0,0 +1,61 @@
// Azure.cs
// Script#/Libraries/Node/Azure
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Runtime.CompilerServices;
using NodeApi.WindowsAzure.Runtime;
using NodeApi.WindowsAzure.Storage;

namespace NodeApi.WindowsAzure {

/// <summary>
/// The root Azure services API.
/// </summary>
[ScriptImport]
[ScriptIgnoreNamespace]
[ScriptName("azure")]
public static class Azure {

[ScriptField]
[ScriptName(PreserveCase = true)]
public static RoleEnvironment RoleEnvironment {
get {
return null;
}
}

[ScriptField]
[ScriptName(PreserveCase = true)]
public static CloudTableQuery TableQuery {
get {
return null;
}
}

public static CloudBlobService CreateBlobService() {
return null;
}

public static CloudBlobService CreateBlobService(string storageAccount, string accessKey) {
return null;
}

public static CloudQueueService CreateQueueService() {
return null;
}

public static CloudQueueService CreateQueueService(string storageAccount, string accessKey) {
return null;
}

public static CloudTableService CreateTableService() {
return null;
}

public static CloudTableService CreateTableService(string storageAccount, string accessKey) {
return null;
}
}
}
88 changes: 88 additions & 0 deletions src/Libraries/Node/Node.Azure/Node.Azure.csproj
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4A9F7CE9-5B55-4B28-AD01-05528709B6E4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NodeApi.WindowsAzure</RootNamespace>
<AssemblyName>Script.Node.Azure</AssemblyName>
<NoStdLib>True</NoStdLib>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\..\ScriptSharp.snk</AssemblyOriginatorKeyFile>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\..\bin\Debug\</OutputPath>
<DebugSymbols>false</DebugSymbols>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\..\..\bin\Debug\Script.Node.Azure.xml</DocumentationFile>
<NoWarn>1591, 0661, 0660, 1684</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
<OutputPath>..\..\..\..\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\..\..\bin\Release\Script.Node.Azure.xml</DocumentationFile>
<NoWarn>1591, 0661, 0660, 1684</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Include="Azure.cs" />
<Compile Include="Runtime\RoleEventType.cs" />
<Compile Include="Runtime\RoleEvent.cs" />
<Compile Include="Runtime\RoleStatus.cs" />
<Compile Include="Runtime\Role.cs" />
<Compile Include="Runtime\RoleInstance.cs" />
<Compile Include="Runtime\RoleEnvironment.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="..\..\..\ScriptSharp.cs">
<Link>Properties\ScriptSharp.cs</Link>
</Compile>
<Compile Include="Storage\CloudQueueListContinuation.cs" />
<Compile Include="Storage\CloudTableListContinuation.cs" />
<Compile Include="Storage\CloudQueueMessage.cs" />
<Compile Include="Storage\CloudQueue.cs" />
<Compile Include="Storage\CloudTableQueryContinuation.cs" />
<Compile Include="Storage\CloudTable.cs" />
<Compile Include="Storage\CloudQueueService.cs" />
<Compile Include="Storage\CloudTableQuery.cs" />
<Compile Include="Storage\CloudTableEntity.cs" />
<Compile Include="Storage\CloudTableService.cs" />
<Compile Include="Storage\CloudBlobService.cs" />
<Compile Include="Storage\CloudBlobContainer.cs" />
<Compile Include="Storage\CloudBlobContainerListContinuation.cs" />
<Compile Include="Storage\CloudBlobListContinuation.cs" />
<Compile Include="Storage\CloudBlob.cs" />
<Compile Include="Storage\CloudBlockBlob.cs" />
<Compile Include="Storage\CloudBlobLease.cs" />
<ScriptInfo Include="Properties\ScriptInfo.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Core\CoreLib\CoreLib.csproj">
<Project>{36D4B098-A21C-4725-ACD3-400922885F38}</Project>
<Name>CoreLib</Name>
</ProjectReference>
<ProjectReference Include="..\Node.Core\Node.Core.csproj">
<Project>{4a9f7ce9-5a45-4b28-ad01-05528709b6e4}</Project>
<Name>Node.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<Copy SourceFiles="@(ScriptInfo)" DestinationFiles="$(OutputPath)$(AssemblyName).txt" />
</Target>
</Project>
12 changes: 12 additions & 0 deletions src/Libraries/Node/Node.Azure/Properties/AssemblyInfo.cs
@@ -0,0 +1,12 @@
// AssemblyInfo.cs
// Script#/Libraries/Node/Azure
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyTitle("Script.Node.Azure")]
[assembly: AssemblyDescription("Script# NodeJS Azure Module API")]
[assembly: ScriptAssembly("azure")]
10 changes: 10 additions & 0 deletions src/Libraries/Node/Node.Azure/Properties/ScriptInfo.txt
@@ -0,0 +1,10 @@
Node Azure Module
===============================================================================

This assembly provides access to Azure Cloud APIs for NodeJS applications.
This is only meant for use at development time, so you can reference and compile
your c# code against Azure APIs.

More information is on http://www.windowsazure.com/en-us/develop/nodejs/.

-------------------------------------------------------------------------------
18 changes: 18 additions & 0 deletions src/Libraries/Node/Node.Azure/Runtime/Role.cs
@@ -0,0 +1,18 @@
// Role.cs
// Script#/Libraries/Node/Azure
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Runtime.CompilerServices;

namespace NodeApi.WindowsAzure.Runtime {

[ScriptImport]
[ScriptIgnoreNamespace]
public sealed class Role {

private Role() {
}
}
}
63 changes: 63 additions & 0 deletions src/Libraries/Node/Node.Azure/Runtime/RoleEnvironment.cs
@@ -0,0 +1,63 @@
// RoleEnvironment.cs
// Script#/Libraries/Node/Azure
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;

namespace NodeApi.WindowsAzure.Runtime {

[ScriptImport]
[ScriptIgnoreNamespace]
public sealed class RoleEnvironment {

private RoleEnvironment() {
}

[ScriptEvent("on", "removeListener")]
public event Action<RoleEvent[]> Changed {
add {
}
remove {
}
}

[ScriptEvent("on", "removeListener")]
public event Action<RoleEvent[]> Changing {
add {
}
remove {
}
}

public void ClearStatus(AsyncCallback callback) {
}

public void GetConfigurationSettings(AsyncResultCallback<Dictionary<string, string>> callback) {
}

public void GetCurrentRoleInstance(AsyncResultCallback<RoleInstance> callback) {
}

[ScriptName("getDeploymentId")]
public void GetDeploymentID(AsyncResultCallback<string> callback) {
}

public void GetRoles(AsyncResultCallback<Role[]> callback) {
}

public void IsAvailable(AsyncResultCallback<bool> callback) {
}

public void IsEmulated(AsyncResultCallback<bool> callback) {
}

public void RequestRecycle(AsyncCallback callback) {
}

public void SetStatus(RoleStatus status, Date expirationDate, AsyncCallback callback) {
}
}
}
32 changes: 32 additions & 0 deletions src/Libraries/Node/Node.Azure/Runtime/RoleEvent.cs
@@ -0,0 +1,32 @@
// RoleEvent.cs
// Script#/Libraries/Node/Azure
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Runtime.CompilerServices;

namespace NodeApi.WindowsAzure.Runtime {

[ScriptImport]
[ScriptIgnoreNamespace]
public sealed class RoleEvent {

private RoleEvent() {
}

[ScriptField]
public string Name {
get {
return null;
}
}

[ScriptField]
public RoleEventType Type {
get {
return RoleEventType.ConfigurationSettingChange;
}
}
}
}
20 changes: 20 additions & 0 deletions src/Libraries/Node/Node.Azure/Runtime/RoleEventType.cs
@@ -0,0 +1,20 @@
// RoleEventType.cs
// Script#/Libraries/Node/Azure
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Runtime.CompilerServices;

namespace NodeApi.WindowsAzure.Runtime {

[ScriptImport]
[ScriptIgnoreNamespace]
[ScriptConstants(UseNames = true)]
public enum RoleEventType {

TopologyChange = 0,

ConfigurationSettingChange = 1
}
}
18 changes: 18 additions & 0 deletions src/Libraries/Node/Node.Azure/Runtime/RoleInstance.cs
@@ -0,0 +1,18 @@
// RoleInstance.cs
// Script#/Libraries/Node/Azure
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Runtime.CompilerServices;

namespace NodeApi.WindowsAzure.Runtime {

[ScriptImport]
[ScriptIgnoreNamespace]
public sealed class RoleInstance {

private RoleInstance() {
}
}
}
20 changes: 20 additions & 0 deletions src/Libraries/Node/Node.Azure/Runtime/RoleStatus.cs
@@ -0,0 +1,20 @@
// RoleStatus.cs
// Script#/Libraries/Node/Azure
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Runtime.CompilerServices;

namespace NodeApi.WindowsAzure.Runtime {

[ScriptImport]
[ScriptIgnoreNamespace]
[ScriptConstants(UseNames = true)]
public enum RoleStatus {

Busy = 0,

Ready = 1
}
}
26 changes: 26 additions & 0 deletions src/Libraries/Node/Node.Azure/Storage/CloudBlob.cs
@@ -0,0 +1,26 @@
// CloudBlob.cs
// Script#/Libraries/Node/Azure
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Runtime.CompilerServices;

namespace NodeApi.WindowsAzure.Storage {

[ScriptImport]
[ScriptIgnoreNamespace]
public abstract class CloudBlob {

internal CloudBlob() {
}

[ScriptField]
[ScriptName("blob")]
public string Name {
get {
return null;
}
}
}
}

0 comments on commit fe165de

Please sign in to comment.