Skip to content

Commit 8733c64

Browse files
Cherry pick of PR 11 (Internal) with changes (#16)
Removed copyright part and mentions of Skyline in csproj Co-authored-by: Jorge Dias <diasjorge9@gmail.com>
1 parent 459236b commit 8733c64

19 files changed

+1223
-19
lines changed

.gitignore

-19
This file was deleted.

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Template that creates a new connector Visual Studio solution.
1414

1515
Template that creates a new Automation script Visual Studio solution.
1616

17+
### User-defined APIs solution
18+
19+
Template that creates a new User-Defined API Visual Studio solution.
20+
1721
## How to install
1822

1923
As of version 2.42, DataMiner Integration Studio (DIS) automatically installs the latest template package when you open Visual Studio. If you don't have this version of DIS, then follow these steps:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<DMSScript options="272" xmlns="http://www.skyline.be/automation">
3+
<Name>$SCRIPTNAME$</Name>
4+
<Description></Description>
5+
<Type>Automation</Type>
6+
<Author>$AUTHOR$</Author>
7+
<CheckSets>FALSE</CheckSets>
8+
<Folder></Folder>
9+
10+
<Protocols>
11+
</Protocols>
12+
13+
<Memory>
14+
</Memory>
15+
16+
<Parameters>
17+
</Parameters>
18+
19+
<Script>
20+
<Exe id="1" type="csharp">
21+
<Value><![CDATA[[Project:$SCRIPTNAME$_1]]]></Value>
22+
<!--<Param type="debug">true</Param>-->
23+
<Message></Message>
24+
</Exe>
25+
</Script>
26+
</DMSScript>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
namespace $NAMESPACE$_1
2+
{
3+
using Skyline.DataMiner.Automation;
4+
using Skyline.DataMiner.Net.Apps.UserDefinableApis;
5+
using Skyline.DataMiner.Net.Apps.UserDefinableApis.Actions;
6+
7+
/// <summary>
8+
/// Represents a DataMiner Automation script.
9+
/// </summary>
10+
public class Script
11+
{
12+
/// <summary>
13+
/// The API trigger.
14+
/// </summary>
15+
/// <param name="engine">Link with SLAutomation process.</param>
16+
/// <param name="requestData">Holds the API request data.</param>
17+
/// <returns>An object with the script API output data.</returns>
18+
[AutomationEntryPoint(AutomationEntryPointType.Types.OnApiTrigger)]
19+
public ApiTriggerOutput OnApiTrigger(IEngine engine, ApiTriggerInput requestData)
20+
{
21+
var method = requestData.RequestMethod;
22+
var route = requestData.Route;
23+
var body = requestData.RawBody;
24+
25+
return new ApiTriggerOutput
26+
{
27+
ResponseBody = $"Received {method} request for route: '{route}' with body: '{body}'",
28+
ResponseCode = (int)StatusCode.Ok,
29+
};
30+
}
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net462</TargetFramework>
4+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
5+
</PropertyGroup>
6+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
7+
<DebugType>full</DebugType>
8+
<CodeAnalysisRuleSet>..\Internal\Code Analysis\qaction-debug.ruleset</CodeAnalysisRuleSet>
9+
</PropertyGroup>
10+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
11+
<DebugType>pdbonly</DebugType>
12+
<CodeAnalysisRuleSet>..\Internal\Code Analysis\qaction-release.ruleset</CodeAnalysisRuleSet>
13+
</PropertyGroup>
14+
<PropertyGroup>
15+
<DefineConstants>$(DefineConstants);DCFv1;DBInfo;ALARM_SQUASHING</DefineConstants>
16+
</PropertyGroup>
17+
<ItemGroup>
18+
<PackageReference Include="Skyline.DataMiner.Dev.Automation" Version="10.3.6" />
19+
</ItemGroup>
20+
<ProjectExtensions>
21+
<VisualStudio>
22+
<UserProperties DisLinkedXmlFile="..\$SCRIPTNAME$.xml" DisProjectType="automationScriptProject" DisLinkId="1" />
23+
</VisualStudio>
24+
</ProjectExtensions>
25+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "http://json.schemastore.org/dotnetcli.host",
3+
"symbolInfo": {
4+
"ScriptName": {
5+
"longName": "script-name",
6+
"shortName": "name"
7+
},
8+
"Author": {
9+
"longName": "author",
10+
"shortName": "auth"
11+
}
12+
}
13+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "http://json.schemastore.org/vs-2017.3.host",
3+
"order": 0,
4+
"icon": "icon.png",
5+
"symbolInfo": [
6+
{
7+
"id": "ScriptName",
8+
"name":
9+
{
10+
"text": "Automation script name"
11+
},
12+
"isVisible": true
13+
},
14+
{
15+
"id": "Author",
16+
"name":
17+
{
18+
"text": "Author"
19+
},
20+
"isVisible": true
21+
}
22+
]
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"$schema": "http://json.schemastore.org/template",
3+
"author": "Skyline Communications",
4+
"classifications": [ "DataMiner" ],
5+
"tags": {
6+
"language": "C#",
7+
"type": "solution",
8+
"editorTreatAs":"solution"
9+
},
10+
"identity": "Skyline.DataMiner.UserDefinedApi.Solution.Template",
11+
"name": "DataMiner User-Defined API Solution",
12+
"shortName": "dataminer-user-defined-api-solution",
13+
"sourceName": "SkylineDataMinerUserDefinedApiSolutionTemplate",
14+
"symbols": {
15+
"ScriptName": {
16+
"type": "parameter",
17+
"datatype": "string",
18+
"defaultValue": "",
19+
"replaces": "$SCRIPTNAME$",
20+
"FileRename": "$SCRIPTNAME$",
21+
"description": "The name of the Automation script.",
22+
"isRequired": true
23+
},
24+
"Author": {
25+
"type": "parameter",
26+
"datatype": "string",
27+
"defaultValue": "",
28+
"replaces": "$AUTHOR$",
29+
"description": "The author."
30+
},
31+
"InitialVersionDate": {
32+
"type": "generated",
33+
"generator": "now",
34+
"replaces": "$INITIALVERSIONDATE$",
35+
"parameters": {
36+
"format": "dd/MM/yyyy"
37+
}
38+
},
39+
"Namespace": {
40+
"type": "generated",
41+
"generator": "regex",
42+
"dataType": "string",
43+
"replaces": "$NAMESPACE$",
44+
"parameters": {
45+
"source": "ScriptName",
46+
"steps": [
47+
{
48+
"regex": "[\\s+-]",
49+
"replacement": "_"
50+
}
51+
]
52+
}
53+
}
54+
},
55+
"guids": [
56+
"30ECB5E3-395D-4674-9EF8-8B07C6B1AD50",
57+
"AEED6A80-C0F3-479D-8871-9F36F10F11EA",
58+
"0B4FC455-7B5E-4BB3-A0F4-9841F4D60D6C",
59+
"B25F1A08-DDF8-4579-A552-EC81190D8DD7",
60+
"7027C535-EB99-4FDF-87C5-43B46A867C2E",
61+
"F8938D60-51A0-4880-9CFC-19C66379AE5D",
62+
"D8DA8E2C-A4AE-45BE-A120-A18B7078E027",
63+
"1AC41DF3-81F2-4A62-8945-DBBB8DC54021",
64+
"2BF9AFEF-11BA-4037-827E-A7C4408DD5E0",
65+
"54EEBDD9-1D2F-41E5-9654-EB47544FF03D",
66+
"37D054BA-8A8F-489C-B707-D45D9F6AF17E"
67+
],
68+
"sources": [
69+
{
70+
"modifiers": [
71+
{
72+
"exclude": [ "./[Content_Types].xml", "src/.vs/**", ".template_config/**", "[Content_Types].xml", "_rels/**", "*.nuspec", "*.nupkg" ]
73+
}
74+
]
75+
}
76+
]
77+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33502.453
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Internal", "Internal", "{30ECB5E3-395D-4674-9EF8-8B07C6B1AD50}"
7+
ProjectSection(SolutionItems) = preProject
8+
Internal\.editorconfig = Internal\.editorconfig
9+
EndProjectSection
10+
EndProject
11+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{AEED6A80-C0F3-479D-8871-9F36F10F11EA}"
12+
EndProject
13+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dlls", "Dlls", "{0B4FC455-7B5E-4BB3-A0F4-9841F4D60D6C}"
14+
ProjectSection(SolutionItems) = preProject
15+
Dlls\ABOUT.md = Dlls\ABOUT.md
16+
EndProjectSection
17+
EndProject
18+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CompanionFiles", "CompanionFiles", "{B25F1A08-DDF8-4579-A552-EC81190D8DD7}"
19+
EndProject
20+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Skyline DataMiner", "Skyline DataMiner", "{7027C535-EB99-4FDF-87C5-43B46A867C2E}"
21+
ProjectSection(SolutionItems) = preProject
22+
CompanionFiles\Skyline DataMiner\AboutThisFolder.md = CompanionFiles\Skyline DataMiner\AboutThisFolder.md
23+
EndProjectSection
24+
EndProject
25+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{F8938D60-51A0-4880-9CFC-19C66379AE5D}"
26+
ProjectSection(SolutionItems) = preProject
27+
Documentation\ABOUT.md = Documentation\ABOUT.md
28+
README.md = README.md
29+
EndProjectSection
30+
EndProject
31+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F8938D60-51A0-4880-9CFC-19C66379BB5D}"
32+
ProjectSection(SolutionItems) = preProject
33+
EndProjectSection
34+
EndProject
35+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Code Analysis", "Code Analysis", "{D8DA8E2C-A4AE-45BE-A120-A18B7078E027}"
36+
ProjectSection(SolutionItems) = preProject
37+
Internal\Code Analysis\qaction-debug.ruleset = Internal\Code Analysis\qaction-debug.ruleset
38+
Internal\Code Analysis\qaction-release.ruleset = Internal\Code Analysis\qaction-release.ruleset
39+
Internal\Code Analysis\stylecop.json = Internal\Code Analysis\stylecop.json
40+
EndProjectSection
41+
EndProject
42+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "$SCRIPTNAME$", "$SCRIPTNAME$", "{1AC41DF3-81F2-4A62-8945-DBBB8DC54021}"
43+
ProjectSection(SolutionItems) = preProject
44+
$SCRIPTNAME$.xml = $SCRIPTNAME$.xml
45+
EndProjectSection
46+
EndProject
47+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Actions", "Actions", "{2BF9AFEF-11BA-4037-827E-A7C4408DD5E0}"
48+
EndProject
49+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "$SCRIPTNAME$_1", "$SCRIPTNAME$_1\$SCRIPTNAME$_1.csproj", "{54EEBDD9-1D2F-41E5-9654-EB47544FF03D}"
50+
EndProject
51+
Global
52+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
53+
Debug|Any CPU = Debug|Any CPU
54+
Release|Any CPU = Release|Any CPU
55+
EndGlobalSection
56+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
57+
{54EEBDD9-1D2F-41E5-9654-EB47544FF03D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58+
{54EEBDD9-1D2F-41E5-9654-EB47544FF03D}.Debug|Any CPU.Build.0 = Debug|Any CPU
59+
{54EEBDD9-1D2F-41E5-9654-EB47544FF03D}.Release|Any CPU.ActiveCfg = Release|Any CPU
60+
{54EEBDD9-1D2F-41E5-9654-EB47544FF03D}.Release|Any CPU.Build.0 = Release|Any CPU
61+
EndGlobalSection
62+
GlobalSection(SolutionProperties) = preSolution
63+
HideSolutionNode = FALSE
64+
EndGlobalSection
65+
GlobalSection(NestedProjects) = preSolution
66+
{7027C535-EB99-4FDF-87C5-43B46A867C2E} = {B25F1A08-DDF8-4579-A552-EC81190D8DD7}
67+
{D8DA8E2C-A4AE-45BE-A120-A18B7078E027} = {30ECB5E3-395D-4674-9EF8-8B07C6B1AD50}
68+
{1AC41DF3-81F2-4A62-8945-DBBB8DC54021} = {AEED6A80-C0F3-479D-8871-9F36F10F11EA}
69+
{2BF9AFEF-11BA-4037-827E-A7C4408DD5E0} = {1AC41DF3-81F2-4A62-8945-DBBB8DC54021}
70+
{54EEBDD9-1D2F-41E5-9654-EB47544FF03D} = {2BF9AFEF-11BA-4037-827E-A7C4408DD5E0}
71+
EndGlobalSection
72+
GlobalSection(ExtensibilityGlobals) = postSolution
73+
SolutionGuid = {37D054BA-8A8F-489C-B707-D45D9F6AF17E}
74+
EndGlobalSection
75+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This folder can contain any file you would like to add under the Skyline DataMiner folder while installing the Automation scripts.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project>
2+
<PropertyGroup>
3+
<PlatformTarget>x86</PlatformTarget>
4+
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<AdditionalFiles Include="..\Internal\Code Analysis\stylecop.json">
8+
<Link>Properties\stylecop.json</Link>
9+
</AdditionalFiles>
10+
<Content Include="..\Internal\.editorconfig">
11+
<Link>Properties\.editorconfig</Link>
12+
</Content>
13+
</ItemGroup>
14+
<ItemGroup>
15+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
16+
<PrivateAssets>all</PrivateAssets>
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
</PackageReference>
19+
</ItemGroup>
20+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This folder contains DLL files that should be placed under the ProtocolScripts folder of DataMiner for this solution to work correctly.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Looking for README.md? Check your Solution Root folder. This folder can be used to add documentation related to this solution.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
indent_size = 4
6+
tab_width = 4
7+
end_of_line = crlf
8+
trim_trailing_whitespace = true
9+
10+
[*.cs]
11+
dotnet_sort_system_directives_first = true

0 commit comments

Comments
 (0)