Jira (PUP-10146) Add File HTTP service

26 views
Skip to first unread message

Josh Cooper (JIRA)

unread,
Nov 18, 2019, 7:37:04 PM11/18/19
to puppe...@googlegroups.com
Josh Cooper created an issue
 
Puppet / Task PUP-10146
Add File HTTP service
Issue Type: Task Task
Assignee: Unassigned
Created: 2019/11/18 4:36 PM
Priority: Normal Normal
Reporter: Josh Cooper

Implement a :file service with methods for:

GET /puppet/v3/file_metadata
GET /puppet/v3/file_metadatas
GET /puppet/v3/file_content

file_metadata

Requires :mount_point, :path, environment arguments
Optionally accepts links, checksum_type, {{source_permissions}

file_metadatas

Requires :mount_point, :path, environment arguments
Optionally accepts recurse, ignore, links, checksum_type, {{source_permissions}

file_content

Require :mount_point, :path

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Nov 18, 2019, 7:38:03 PM11/18/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Coremunity

Josh Cooper (JIRA)

unread,
Nov 18, 2019, 7:52:03 PM11/18/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Implement a {{:file}} service with methods for:

{noformat}

GET /puppet/v3/file_metadata
GET /puppet/v3/file_metadatas
GET /puppet/v3/file_content
{noformat}


h4. file_metadata

Requires {{:mount_point}}, {{:path}}, {{environment}} arguments
Optionally accepts {{links}}, {{checksum_type}}, {{source_permissions}
}

h4. file_metadatas

Requires {{:mount_point}}, {{:path}}, {{environment}} arguments
Optionally accepts {{recurse}}, {{ignore}}, {{links}}, {{checksum_type}}, {{source_permissions}
}

h4. file_content

Require {{:mount_point}}, {{:path}}

Josh Cooper (JIRA)

unread,
Nov 19, 2019, 6:19:03 PM11/19/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Implement a {{:file}} service with methods for:

{noformat}
GET /puppet/v3/file_metadata
GET /puppet/v3/file_metadatas
GET /puppet/v3/file_content
{noformat}

See Puppet::Indirector::Rest#headers for how to generate list of accepted headers

h4. file_metadata

Requires {{:mount_point}}, {{:path}}, {{environment}}
, arguments
Optionally accepts {{links}}, {{checksum_type}}, {{source_permissions}}
, {{ssl_context}}
Call {{Puppet::FileServing::Metadata#render}} to serialize and {{Puppet::FileServing::Metadata#mime}} to specify content-type

h4. file_metadatas

Requires {{:mount_point}}, {{:path}}, {{environment}} arguments
Optionally accepts {{recurse}}, {{ignore}}, {{links}}, {{checksum_type}}, {{source_permissions}} , {{ssl_context}}
Call {{Puppet::FileServing::Metadata#render}} to serialize and {{Puppet::FileServing::Metadata#mime}} to specify content-type

h4. file_content

Require {{:mount_point}}, {{:path}}

Optional accepts {{ssl_context}}
Always {{Accept: application/octet-stream}}.

Melissa Stone (JIRA)

unread,
Nov 19, 2019, 6:20:03 PM11/19/19
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Sprint: Coremunity Hopper

Josh Cooper (JIRA)

unread,
Dec 18, 2019, 6:30:03 PM12/18/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Implement a {{:file}} service with methods for:

{noformat}
GET /puppet/v3/file_metadata get_file_metadata
GET /puppet/v3/file_metadatas get_file_metadatas
GET /puppet/v3/file_content get_file_content
{noformat}

See Puppet::Indirector::Rest#headers for how to generate list of accepted headers

h4. file_metadata get_file_metadata

Requires Required arguments {{:mount_point}}, {{:path}}, {{environment}} , arguments
Optionally accepts Optional arguments {{links}}, {{checksum_type}}, {{source_permissions}}, defaulting to whatever puppet 6 does
Use the
{{ ssl_context Content-Type }}
Call
header in the response to lookup the network formatter. If the {{ Puppet::FileServing::Metadata#render Content-Type }} contains a {{charset}}, force encode the response body that that encoding. Use the formatter to serialize and deserialize the {{Puppet::FileServing::Metadata #mime }} instance.
If the response code is 404, then I believe we want
to specify content-type treat that as not an error (due to a long standing puppet bug).

h4.
file_metadatas get_file_metadatas

Requires Required arguments {{:mount_point}}, {{:path}}, {{environment}} arguments
Optionally accepts Optional arguments {{recurse}}, {{ignore}}, {{links}}, {{checksum_type}}, {{source_permissions}} , {{ssl_context}}
Call Use the {{ Puppet::FileServing::Metadata#render Content-Type }} header in the response to serialize and lookup the network formatter. Use the formatter to deserialize an array of {{Puppet::FileServing::Metadata #mime }} instances.
If the response code is 404, then I believe we want
to specify content-type treat that as not an error (due to a long standing puppet bug).

h4.
file_content get_file_content

Require Required arguments {{:mount_point}}, {{:path}}
Optional accepts {{ssl_context}}
Always set header {{Accept: application/octet-stream}}.
Force encode the response body as {{Encoding::BINARY}}.
Stream the response body to the caller.

Melissa Stone (JIRA)

unread,
Dec 20, 2019, 3:43:03 PM12/20/19
to puppe...@googlegroups.com
Melissa Stone assigned an issue to Melissa Stone
Change By: Melissa Stone
Assignee: Melissa Stone

Melissa Stone (JIRA)

unread,
Dec 20, 2019, 3:44:03 PM12/20/19
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Sprint: Coremunity Hopper Platform Core KANBAN

Melissa Stone (JIRA)

unread,
Dec 30, 2019, 1:51:03 PM12/30/19
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Sprint: Platform Core KANBAN Coremunity Hopper

Melissa Stone (JIRA)

unread,
Dec 30, 2019, 1:51:03 PM12/30/19
to puppe...@googlegroups.com
Melissa Stone assigned an issue to Unassigned
Change By: Melissa Stone
Assignee: Melissa Stone

Melissa Stone (JIRA)

unread,
Jan 2, 2020, 1:27:03 PM1/2/20
to puppe...@googlegroups.com
Melissa Stone assigned an issue to Melissa Stone

Melissa Stone (JIRA)

unread,
Jan 2, 2020, 1:27:04 PM1/2/20
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Sprint: Coremunity Hopper Platform Core KANBAN

Josh Cooper (JIRA)

unread,
Jan 8, 2020, 6:39:04 PM1/8/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Implement a {{:file}} service with methods for:

{noformat}
get_file_metadata
get_file_metadatas
get_file_content
{noformat}

h4. get_file_metadata
(singular)

Required arguments {{
: mount_point}}, {{ : path}}, {{environment}} , where {{mount_point}} can be {{modules}}, {{tasks}}, {{plugins}}, etc, and {{path}} is a file system path encoded in the URL.
Optional arguments {{links}}, {{checksum_type}}, {{source_permissions}}, defaulting to whatever puppet 6 does
Use the {{Content-Type}} header in the response to lookup the network formatter. If the {{Content-Type}} contains a {{charset}}, force encode the response body that that encoding. Use the formatter to deserialize the {{Puppet::FileServing::Metadata}} instance.
If the response code is 404, then I believe we want to treat that as not an error (due to a long standing puppet bug).

For example, here is a file request, where the {{mount=modules}} and {{path=foo/file}}:

{noformat}
HTTP GET https://brown-flurry.delivery.puppetlabs.net:8140/puppet/v3/file_metadata/modules/foo/file?environment=production&links=manage&checksum_type=md5&source_permissions=ignore
{noformat}

And a directory request, where the {{mount=modules}} and {{path=foo/directory}}

{noformat}
HTTP GET https://brown-flurry.delivery.puppetlabs.net:8140/puppet/v3/file_metadata/modules/foo/directory?environment=production&links=manage&checksum_type=md5&source_permissions=ignore
{noformat}

h4. get_file_metadatas (plural)

Required arguments {{
: mount_point}}, {{ : environment}}
Optional arguments {{
path}}, {{ environment recurse }}
Optional arguments
, {{ recurse recurselimit }}, {{ignore}}, {{links}}, {{checksum_type}}, {{source_permissions}} . Note {{ignore}} can have multiple values, so we should accept an array of values.
Use the {{Content-Type}} header in the response to lookup the network formatter. Use the formatter to deserialize an array of {{Puppet::FileServing::Metadata}} instances.
If the response code is 404

For example
, then I believe we want to treat that as not an error (due to here is a long standing recursive directory request:

{noformat}
HTTP GET https://brown-flurry.delivery.puppetlabs.net:8140/
puppet bug) /v3/file_metadatas/modules/foo/directory?environment=production&links=manage&recurse=true&source_permissions=ignore&checksum_type=md5 {noformat}

The {{path}} can be omitted when recursing the top-level mount such as {{pluginsync}}:

{noformat}
HTTP GET https://brown-flurry
. delivery.puppetlabs.net:8140/puppet/v3/file_metadatas/plugins?environment=production&links=follow&recurse=true&source_permissions=ignore&ignore=.svn&ignore=CVS&ignore=.git&ignore=.hg&checksum_type=md5
{noformat}

h4. get_file_content


Required arguments {{:mount_point}}, {{:path}}
Always set header {{Accept: application/octet-stream}}.
Force encode the response body as {{Encoding::BINARY}}.
Stream the response body to the caller.

Melissa Stone (JIRA)

unread,
Jan 15, 2020, 1:55:04 PM1/15/20
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Fix Version/s: PUP 6.13.0

Melissa Stone (JIRA)

unread,
Jan 15, 2020, 1:56:04 PM1/15/20
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Release Notes: Not Needed

Josh Cooper (JIRA)

unread,
Jan 15, 2020, 2:21:05 PM1/15/20
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Jan 17, 2020, 2:44:03 PM1/17/20
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-10146

Passed master CI in 1f28c53d4765f87eda1045c4910cbd05de93c68f

Reply all
Reply to author
Forward
0 new messages