Skip to content

Commit f8bd882

Browse files
authored
feat(api): Add logging endpoints and reverse proxy configuration (#307)
* feat(api): Add logging endpoints and reverse proxy configuration - Introduced new endpoints for retrieving system logs and streaming logs via WebSocket. - Added endpoint to fetch orchestrator host system logs. - Implemented endpoint for retrieving orchestrator host reverse proxy configuration. - Updated error response structure across various endpoints to use "error" instead of "message". - Enhanced API documentation to reflect the new endpoints and changes in response formats. feat(catalog): Implement compression options for manifest files - Added support for compressing manifest files during the generation process. - Introduced new fields in the PushCatalogManifestRequest model to handle compression options. - Updated the manifest generation logic to calculate original and packed sizes, and log compression details. feat(pdfile): Implement new command processors for VM import functionality - Added command processors for handling new PDFile commands: COMPRESS_PACK, FORCE, IS_COMPRESSED, VM_REMOTE_PATH, VM_SIZE, and VM_TYPE. - Implemented the runImportVM function to handle the import of VMs with the new parameters. - Enhanced validation logic to ensure proper handling of new command arguments. refactor(api): Improve API documentation extraction logic - Refactored the logic for extracting API documentation from Go files to improve clarity and maintainability. - Added module information retrieval to enhance the handling of import paths in the documentation process. * Add CompressPackLevelCommandProcessor and helper functions for float rounding - Implemented CompressPackLevelCommandProcessor to handle the COMPRESS_PACK_LEVEL command. - Added error handling for missing and invalid arguments. - Introduced a helper function to round float values with specified precision.
1 parent eaa0188 commit f8bd882

Some content is hidden

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

62 files changed

+3032
-1050
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ _site/
2525
*.log.*
2626
*.log
2727
commit.msg
28+
.cache/

docs/_data/docs_devops_menu.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
link: /docs/devops/restapi/overview/
2323
- name: Authentication
2424
link: /docs/devops/restapi/authentication/
25-
- name: Endpoints
26-
hidden: true
27-
path: /docs/devops/restapi/endpoints/
25+
- name: Api Reference
26+
link: /docs/devops/restapi/reference/
2827
- label: Catalog
2928
items:
3029
- name: Overview

docs/_data/navigation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
hidden: true
1919
description: Learn how to use the Github Actions with Parallels Desktop DevOps Service to automate your CI/CD pipelines.
2020
link: /docs//github-actions/
21+
- name: Api Reference
22+
link: /docs/devops/restapi/reference/
2123
- name: Features
2224
link: /features/
2325
hidden: true

docs/_layouts/api.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="category-menu">
99
<div class="api-menu-container">
1010
<div class="api-dropdown-root-item{% if page_name == 'rest-api' %} active{% endif %}">
11-
<a class="api-menu-item" href="{{ site.baseurl }}/rest-api">All </a>
11+
<a class="api-menu-item" href="{{ site.baseurl }}/docs/devops/restapi/reference/">All </a>
1212
</div>
1313
{% for category in page.categories %}
1414
{% if category.endpoints.size > 0 %}
@@ -19,7 +19,7 @@
1919
<path d="M18 7L10 15L2 7" stroke-width="2" stroke-miterlimit="10"></path>
2020
</svg>
2121
</a>
22-
<a class="api-menu-item{% if page_name == category.path %} active{% endif %}" href="{{ site.baseurl }}/rest-api/{{ category.path }}">
22+
<a class="api-menu-item{% if page_name == category.path %} active{% endif %}" href="{{ site.baseurl }}/docs/devops/restapi/reference/{{ category.path }}">
2323
<div class="menu-item-text">
2424
{{ category.name }}
2525
</div>
@@ -28,17 +28,18 @@
2828
<div class="api-dropdown-menu{% if page_name == category.path %} expanded{% endif %}" target="dropdown-{{ category.path }}">
2929
<ul>
3030
{% for endpoint in category.endpoints %}
31+
{% assign anchor_id = page.api_prefix | append: endpoint.path | append: '_' | append: endpoint.method | replace: '/', '_' | replace: '.', '_' | replace: ':', '_' %}
3132
<li class="api-dropdown-menu-item">
3233
<span class="endpoint {{ endpoint.method | upcase }}"></span>
33-
<a href=" {{ site.baseurl }}/rest-api/{{ category.path }}?#{{ endpoint.path }}">{{ endpoint.path }}</a>
34+
<a href="{{ site.baseurl }}/docs/devops/restapi/reference/{{ category.path }}#{{ anchor_id }}">{{ endpoint.path }}</a>
3435
</li>
3536
{% endfor %}
3637
</ul>
3738
</div>
3839
</div>
3940
{% else %}
4041
<div class="api-dropdown-root-item{% if page_name == category.path %} active{% endif %}">
41-
<a class="api-menu-item" href="{{ site.baseurl }}/rest-api/{{ category.path }}">
42+
<a class="api-menu-item" href="{{ site.baseurl }}/docs/devops/restapi/reference/{{ category.path }}">
4243
{{ category.name }}
4344
</a>
4445
</div>
@@ -60,8 +61,8 @@
6061
{% assign endpoints = page.endpoints %}
6162
{% for endpoint in endpoints %}
6263
{% assign path = page.api_prefix | append: endpoint.path %}
63-
{% assign id = site.api_prefix | append: endpoint.path | append: '_' | append: endpoint.method | replace: '/', '_' | replace: '.', '_' | replace: ':', '_' %}
64-
<section class="api-main-content">
64+
{% assign id = page.api_prefix | append: endpoint.path | append: '_' | append: endpoint.method | replace: '/', '_' | replace: '.', '_' | replace: ':', '_' %}
65+
<section class="api-main-content" id="{{ id }}" style="scroll-margin-top: 120px;">
6566
<section class="api-main-body">
6667
{% if endpoint.title %}
6768
<h6 class="endpoint-title">
@@ -70,7 +71,7 @@ <h6 class="endpoint-title">
7071
{% endif %}
7172
<h4 class="api-endpoint-header">
7273
<div class="endpoint-header">
73-
<a class="endpoint-link" id="{{ id }}">
74+
<a class="endpoint-link">
7475
{{ path }}
7576
{% if endpoint.method %}
7677
<span class="endpoint {{ endpoint.method | upcase }}"></span>

docs/_plugins/parallels-desktop-file.rb

Lines changed: 131 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class ParallelsDesktopFile < Rouge::RegexLexer
1010

1111
KEYWORDS = %w(
1212
TO FROM INSECURE AUTHENTICATE PROVIDER LOCAL_PATH DESCRIPTION TAG ROLE CLAIM CATALOG_ID VERSION ARCHITECTURE
13-
MACHINE_NAME OWNER DESTINATION START_AFTER_PULL DO RUN
13+
MACHINE_NAME OWNER DESTINATION START_AFTER_PULL DO MINIMUM_REQUIREMENT COMPRESS_PACK COMPRESS_PACK_LEVEL
14+
VM_REMOTE_PATH FORCE VM_SIZE VM_TYPE IS_COMPRESSED EXECUTE CLONE RUN
1415
).join('|')
1516

1617
AUTHENTICATE_SUBCOMMANDS = %w(
@@ -21,61 +22,172 @@ class ParallelsDesktopFile < Rouge::RegexLexer
2122
USERNAME PASSWORD NAME BUCKET REGION ACCESS_KEY SECRET_KEY
2223
).join('|')
2324

25+
MINIMUM_REQUIREMENT_SUBCOMMANDS = %w(
26+
CPU RAM DISK MEMORY
27+
).join('|')
28+
29+
FORCE_SUBCOMMANDS = %w(
30+
true false
31+
).join('|')
32+
33+
COMPRESS_PACK_LEVEL_SUBCOMMANDS = %w(
34+
default balanced best_speed best_compression no_compression
35+
).join('|')
36+
37+
COMPRESS_PACK_SUBCOMMANDS = %w(
38+
true false
39+
).join('|')
40+
41+
IS_COMPRESSED_SUBCOMMANDS = %w(
42+
true false
43+
).join('|')
44+
45+
VM_TYPE_SUBCOMMANDS = %w(
46+
pvm macvm
47+
).join('|')
48+
2449
state :root do
2550
rule %r/\s+/, Text
51+
rule %r/#.*?$/, Comment
52+
53+
rule %r/^((?:ONBUILD\s+)?RUN)(\s+)([^\n#]*)(\s*)(#.*)?$/io do |m|
54+
token Keyword, m[1]
55+
token Text::Whitespace, m[2]
56+
command = m[3] || ''
57+
unless command.empty?
58+
stripped = command.rstrip
59+
trailing = command[stripped.length..] || ''
60+
token Name::Function, stripped unless stripped.empty?
61+
token Text::Whitespace, trailing unless trailing.empty?
62+
end
63+
token Text::Whitespace, m[4] if m[4] && !m[4].empty?
64+
token Comment, m[5] if m[5]
65+
end
2666

2767
rule %r/^(FROM)(\s+)(.*)(\s+)(AS)(\s+)(.*)/io do
2868
groups Keyword, Text::Whitespace, Str, Text::Whitespace, Keyword, Text::Whitespace, Str
2969
end
3070

3171
rule %r/^(AUTHENTICATE)(\s+)(#{AUTHENTICATE_SUBCOMMANDS})(\s+)(.*)/io do
32-
groups Keyword, Text::Whitespace, Name::Variable, Text::Whitespace, Punctuation
72+
groups Keyword, Text::Whitespace, Name::Variable, Text::Whitespace, Str
3373
end
3474

3575
rule %r/^(AUTHENTICATE)(\s+)(#{AUTHENTICATE_SUBCOMMANDS})(.*)/io do
3676
groups Keyword, Text::Whitespace, Error, Error
3777
end
3878

79+
rule %r/^(PROVIDER)(\s+)(?=[^#]*=)/io do
80+
groups Keyword, Text::Whitespace
81+
push :provider
82+
end
83+
3984
rule %r/^(PROVIDER)(\s+)(#{PROVIDER_SUBCOMMANDS})(\s+)(.*)/io do
40-
groups Keyword, Text::Whitespace, Name::Variable, Text::Whitespace, Punctuation
85+
groups Keyword, Text::Whitespace, Name::Variable, Text::Whitespace, Str
86+
end
87+
88+
rule %r/^(MINIMUM_REQUIREMENT)(\s+)(#{MINIMUM_REQUIREMENT_SUBCOMMANDS})(\s+)(.*)/io do
89+
groups Keyword, Text::Whitespace, Name::Variable, Text::Whitespace, Str
90+
end
91+
92+
rule %r/^(FORCE)(\s+)(#{FORCE_SUBCOMMANDS})(?=\s*(#|$))/io do
93+
groups Keyword, Text::Whitespace, Name::Constant
94+
end
95+
96+
rule %r/^(FORCE)(\s+)(\S.*)/io do
97+
groups Keyword, Text::Whitespace, Error
98+
end
99+
100+
rule %r/^(COMPRESS_PACK_LEVEL)(\s+)(#{COMPRESS_PACK_LEVEL_SUBCOMMANDS})(?=\s*(#|$))/io do
101+
groups Keyword, Text::Whitespace, Name::Constant
102+
end
103+
104+
rule %r/^(COMPRESS_PACK_LEVEL)(\s+)(\S.*)/io do
105+
groups Keyword, Text::Whitespace, Error
106+
end
107+
108+
rule %r/^(COMPRESS_PACK)(\s+)(#{COMPRESS_PACK_SUBCOMMANDS})(?=\s*(#|$))/io do
109+
groups Keyword, Text::Whitespace, Name::Constant
110+
end
111+
112+
rule %r/^(COMPRESS_PACK)(\s+)(\S.*)/io do
113+
groups Keyword, Text::Whitespace, Error
114+
end
115+
116+
rule %r/^(IS_COMPRESSED)(\s+)(#{IS_COMPRESSED_SUBCOMMANDS})(?=\s*(#|$))/io do
117+
groups Keyword, Text::Whitespace, Name::Constant
118+
end
119+
120+
rule %r/^(IS_COMPRESSED)(\s+)(\S.*)/io do
121+
groups Keyword, Text::Whitespace, Error
122+
end
123+
124+
rule %r/^(VM_TYPE)(\s+)(#{VM_TYPE_SUBCOMMANDS})(?=\s*(#|$))/io do
125+
groups Keyword, Text::Whitespace, Name::Constant
126+
end
127+
128+
rule %r/^(VM_TYPE)(\s+)(\S.*)/io do
129+
groups Keyword, Text::Whitespace, Error
41130
end
42131

43132
rule %r/^(PROVIDER)(\s+)(#{PROVIDER_SUBCOMMANDS})(.*)/io do
44133
groups Keyword, Text::Whitespace, Error, Error
45134
end
46135

47-
rule %r/^(TAG)(\s+)(.*)/io do
48-
groups Keyword, Text::Whitespace, Punctuation
136+
rule %r/^(TAG)(\s+)/io do
137+
groups Keyword, Text::Whitespace
138+
push :csv
49139
end
50140

51-
rule %r/^(ROLE)(\s+)(.*)/io do
52-
groups Keyword, Text::Whitespace, Punctuation
141+
rule %r/^(ROLE)(\s+)/io do
142+
groups Keyword, Text::Whitespace
143+
push :csv
53144
end
54145

55-
rule %r/^(CLAIM)(\s+)(.*)/io do
56-
groups Keyword, Text::Whitespace, Punctuation
146+
rule %r/^(CLAIM)(\s+)/io do
147+
groups Keyword, Text::Whitespace
148+
push :csv
57149
end
58150

59151
rule %r/^(#{KEYWORDS})\b(.*)/io do
60152
groups Keyword, Str
61153
end
62154

63-
rule %r/#.*?$/, Comment
155+
rule %r/\w+/, Text
156+
rule %r/[^\w]+/, Text
157+
rule %r/./, Text
158+
end
64159

65-
rule %r/^(ONBUILD\s+)?RUN(\s+)/i do
66-
token Keyword
67-
push :run
160+
state :provider do
161+
rule %r/#.*?$/, Comment, :pop!
162+
rule %r/\n/, Text, :pop!
163+
rule %r/\s+/, Text
164+
165+
rule %r/([A-Z0-9_-]+)(=)([^;#\s]+)(;)/io do
166+
groups Name::Attribute, Operator, Str, Punctuation
167+
end
168+
169+
rule %r/([A-Z0-9_-]+)(=)([^;#\s]+)/io do
170+
groups Name::Attribute, Operator, Str
68171
end
69172

70-
rule %r/\w+/, Text
71-
rule %r/[^\w]+/, Text
72173
rule %r/./, Text
73174
end
74175

75-
state :run do
176+
state :csv do
177+
rule %r/#.*?$/, Comment, :pop!
76178
rule %r/\n/, Text, :pop!
77-
rule %r/\\./m, Str::Escape
78-
rule(/(\\.|[^\n\\])+/) { delegate @shell }
179+
rule %r/\s+/, Text
180+
181+
rule %r/([^,#\s]+)(,)/ do
182+
groups Name::Variable, Punctuation
183+
end
184+
185+
rule %r/[^,#\s]+/ do |m|
186+
token Name::Variable, m[0]
187+
end
188+
189+
rule %r/./, Text
79190
end
191+
80192
end
81-
end
193+
end

docs/_plugins/prldevops.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ParallelsDevops < Rouge::RegexLexer
99
aliases 'prldevops'
1010

1111
KEYWORDS = %w(
12-
catalog push pull api update-root-password gen-rsa
12+
catalog push pull run list import import-vm api update-root-password gen-rsa
1313
).join('|')
1414

1515
AUTHENTICATE_SUBCOMMANDS = %w(

docs/_sass/_api.scss

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,13 @@
141141

142142
@media screen and (min-width: $l-breakpoint) {
143143
display: flex;
144-
width: $api-side-menu-l-width
144+
width: $api-side-menu-l-width;
145+
position: sticky;
146+
top: 90px;
147+
align-self: flex-start;
148+
max-height: calc(100vh - 110px);
149+
overflow-y: auto;
150+
padding-right: 10px;
145151
}
146152

147153
@media screen and (min-width: $xl-breakpoint) {
@@ -1134,4 +1140,4 @@
11341140
}
11351141
}
11361142
}
1137-
}
1143+
}

0 commit comments

Comments
 (0)