How to filter and delete artifactory repos not updated since 2 years - repository

I would like to filter all repos not updated since 2 years. How is that possible?

Each repository have a creation date as part of its info:
Therefore, you can use the Artifactory Query Language (AQL) to search for the list of repositories 'older than'.

Related

How can I migrate Exchange Groups to Google Groups?

I'm looking for a way to migrate data from LDAP-hosted groups to Google Groups.
With GCDS only the users are migrated, but I would like to migrate the data, do you know any way?
Thanks team
I've migrate groups between different directories using custom-written scripts. This requires some type of mapping between IDs. That is I know the fully qualified DN of each member within the LDAP-hosted group, I can match that up to a record in the new directory -- e.g. cn=lisa,ou=users,o=example has uid lisaj, and there's a corresponding account with the logon id lisaj in the new directory. I've had to do migrations where there was no direct correlation available within the two directories, and successfully linked the two systems using a text file with cross-reference info. A line in the file might say "lisaj 019485-B9184A-9284C-1949" to map my user id in the old system to a record identifier in the new one.
Basic process:
Connect to source LDAP
Find all in-scope groups For each in-scope group, get member list
Find the corresponding group in the new directory (if none exists,
create it)
For each member, find corresponding account in new
directory
Add member to group in new directory
(https://developers.google.com/admin-sdk/directory/v1/reference/members/insert
for Google Groups,
https://github.com/alfasin/Google-Admin-Directory-API has some Python
examples)
As a one-off process, it's pretty simple. If you need the two directories to remain in sync for some time, the script becomes a little more complicated. Assuming the old directory is "authoritative" (the one with the 'right' data -- and you can only make changes in one of the directories, otherwise it's impossible to tell which members actually should be in the group), you need to check the new directory group for any members that aren't a member of the old directory group and remove them as well as add any old directory group members that aren't in the new directory group yet. I generally add a "last modified" constraint to the filter used to locate groups in the old directory -- e.g. find all group objects where the lastModified timestamp is in the past 24 hrs -- to avoid continually reprocessing data for groups that haven't changed.

How to create a Query to search at 2 workspaces in Magnolia?

I am trying to create a query so I can search for assets that have been published in Magnolia but that are inside of pages that had not been published.
I created a query for those assets that have been published to search inside the 'dam' repository wiht JRC-SQL2:
select p.*
from [mgnl:asset] as p
where (ISDESCENDANTNODE('/demo-features/tests')
or ISSAMENODE('/demo-features/tests'))
and (p.[mgnl:activationStatus] <> '')
but when I try to add any sort of extra condition to search in the 'website' repository in order to check if the asset exists there, I have been unable to create one that works.
I tried with UNION, IN, INNER JOIN, but because the information I seek it's in another repository Magnolia does not permit me to reach it.
Could any of you point me a way to reach information from 2 repositories at the same time?
Each workspace and each repository has it's own index. Therefore you can't combine searching over them in single query.

Reduce Active Directory users in Jira using LDAP Query

I am retrieving users for Active directory in Jira 7 by using LDAP. I am trying to reduce the number of users brought from LDAP to a particular group that we have created. So in order to do that i put (objectCategory=group)(cn=WebAgileDevs) in the group object filter along with the default settings. The only thing i change is the Base DN and credentials required. When i save and test it does show me that it is testing 1 group and 15 users which is what i want!(See the screenshot). BUT, when i go and sync it, it brings in 43000 users!! What am i missing???
Test Remote Directory Screenshot
The group filter is used to filter the list of groups that are imported to JIRA, and the user filter is used to filter the list of users that are imported to JIRA. The two need not necessarily correspond. Your group filter would be instructing JIRA to bring in only that one group (into the list of groups), but without further refinement, your user filter will still be pulling in all users, as you noticed. This means that you need to adjust the user filter too.
From your question, you want to import only those users who are a member of a specific group. Atlassian provides some general guidance here.
The last example on that page is particularly relevant for you:
(&(objectCategory=Person)(sAMAccountName=*)(memberOf=cn=CaptainPlanet,ou=users,dc=company,dc=com))
This tells JIRA to pull in only those user objects that are a member of the group cn=CaptainPlanet,ou=users,dc=company,dc=com. You would want to replace this with your cn=WebAgileDevs (plus whatever trailing qualifiers you need to fully qualify the group name).

Cross-project time-record filtering using Active Collab 5 API

For Active Collab team watching this tag.
I am working on a project that uses new Active Collab 5 API, I am having performance issue trying to run reports.
Example I try to build reports on date-range, and currently to achieve that I need to first run a call to get all projects.
Followed by a loop with this call:
API::get('/projects/'.$id.'/time-records/filtered-by-date?' . http_build_query(['from' => $from, 'to' => $to]))
However we have a large number of projects, in addition to high number of active projects we also need to filter Archived projects as well to get correct reports for billing.
Now I work with around 1500 projects in AC.
So I need to make 1500 API calls which takes a huge performance hit. Is there a way that you can possibly build something that would work along these lines.
API::get(/timerecords/filter-by-date);
with a possible passed parameter that will say (all, active, complited) project state.
Please let me know what you can do or if I have missed something in your documentation that already does this.
Thanks
What you need here is not a request that goes through all projects one by one, but a request that it tailored for cross-project reporting. Active Collab 5 has just the right API endpoint for that - /reports/run.
As an example, you can use this command to query time records and expenses from all active projects that were tracked today:
curl -H "X-Angie-AuthApiToken: YOUR-API-TOKEN" "http://your.activecollab.com/api/v1/reports/run?type=TrackingFilter&project_filter=active&tracked_on_filter=today"
Notice the route (/reports/run) and query arguments:
type - specify type of the report, in this case time and expense tracking report,
project_filter - specify project filter. Apart from active, other useful values of this filter are completed (for completed projects), selected_1,2,3,4 (selected projects with a list of project ID-s), client_1,2,3,4 (projects for clients with the given ID-s), category_1,2,3,4 (projects in categories with the given ID-s),
tracked_on_filter - filter by the date when records were tracked. To target a particular date use selected_date_YYYY-MM-DD and to target a date range use selected_range_YYYY-MM-DD:YYYY-MM-DD.
tracked_by_filter - filter by who tracked the time. It can have various values, like anybody, logged_user, selected_1,2,3.
To list only time records, set type_filter to time (or to expenses if you want only expenses to be listed).

How do I retrieve a list of only those users and groups that have been added since a certain date from an LDAP directory?

My application does an LDAP query once a day and fetches all the users and groups in a given container. Once it is fetched, my app goes iterates through the list of users of groups, adding only the new ones to my application's database (it adds only username).
If there are 50,000 users, my application server is busy for 45 minutes every day performing this operation.
Is there any way to specify that I need a "delta" in my LDAP query so that I retrieve only those users who got added/modified/deleted since my last LDAP query?
I think there should be a modifyTimestamp on each entry. Take a peek with something like softerra ldap browser (http://download.softerra.com/files/ldapbrowser26.msi). If it exists you should be able to add a condition to your ldap query to look for entries that have been changed since you last ran the sync job.
For users try:
directorySearcher.Filter = "(&(objectCategory=person)(objectClass=user)(whenChanged>=" + yourLastQueryDate.ToString("yyyyMMddHHmmss") + ".0Z))";
For groups try:
directorySearcher.Filter = "(&(objectCategory=group)(whenChanged>=" + yourLastQueryDate.ToString("yyyyMMddHHmmss") + ".0Z))";
And then:
SearchResultCollection adSearchResults = dSearcher.FindAll();
Note: be sure your last query date is in UTC/Zulu time OR use the ".nZ" suffix to adjust for your timezone.
It depends on your directory. There should be an attribute such as a timestamp or sequence number that you can use to filter your LDAP query with. In Active Directory for instance, the value is 'uSNChanged'.
There are two main choices for tracking changes: polling and DirSync. These articles should give you some background and help you to choose what's best for you.
http://support.microsoft.com/kb/891995
http://msdn.microsoft.com/en-us/library/ms677974(VS.85).aspx
and here's some .NET stuff:
http://msdn.microsoft.com/en-us/library/system.directoryservices.directorysynchronization.aspx
You need to check the operational attributes for your Directory .
With OpenLDAP you can add + sign to get operational attributes and check from createTimestamp:
It is always in Zulu format i.e. YYYYMMDDHHMMSSZ. With other DS like fedora-ds You need to search for the operation attribute.
ldapsearch -x < other_options > createTimestamp