Skip to content

Commit

Permalink
Update aterm_101.md to include xtoshell (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
carolyncole authored Mar 21, 2024
1 parent fdbf08c commit 14b5b20
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/aterm_101.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,3 +398,24 @@ asset.collection.accumulator.add \
:id path=/princeton/tigerdata \
:cascade true
```

## xtoshell

The xtoshell command can be used to convert our API xml to the arguments to a `service.execute` command.

For example:
In the rails console run something like:

**Note** The gsubs at the end are to remove all spaces and <arg></arg> and the session_id attribute

**Note 2** Our version of mediaflux in docker does not have this command. The xtoshell command does exist on td-meta1
```
session_id = User.first.mediaflux_session
project = project.first
project_name = ProjectMediaflux.safe_name(project.directory)
project_namespace = "#{Rails.configuration.mediaflux['api_root_ns']}/#{project_name}NS"
store_name = Store.default(session_id: session_id).name
namespace = Mediaflux::Http::NamespaceCreateRequest.new(namespace: project_namespace, description: "Namespace for project #{project.title}", store: store_name, session_token: session_id)
puts namespace.xml_payload.gsub("\n","").gsub(" "," ").gsub(" "," ").gsub(" "," ").gsub("\"","'").gsub("> <","><").gsub("<args>","").gsub("</args>","").gsub(/session='.*'/,"")
```
Copy the output and in aterm run `service.execute` and paste the output

0 comments on commit 14b5b20

Please sign in to comment.